Skip to content

Commit

Permalink
Reverted build-docs.sh
Browse files Browse the repository at this point in the history
Revised TaskTemplate to retain order of link init in the constructor.
  • Loading branch information
corneil committed Nov 13, 2024
1 parent afad738 commit 8118ada
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.springframework.cloud.dataflow.schema.SchemaVersionTarget;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.hateoas.Link;
import org.springframework.hateoas.PagedModel;
import org.springframework.hateoas.RepresentationModel;
import org.springframework.http.HttpMethod;
import org.springframework.util.Assert;
Expand All @@ -66,8 +65,6 @@ public class TaskTemplate implements TaskOperations {

private static final String EXECUTIONS_CURRENT_RELATION_VERSION = "1.7.0";

private static final String VALIDATION_RELATION_VERSION = "1.7.0";

private static final String VALIDATION_THIN_TASK_VERSION = "2.11.3";

private static final String VALIDATION_TASK_LAUNCH_VERSION = "2.11.0";
Expand Down Expand Up @@ -139,29 +136,29 @@ public class TaskTemplate implements TaskOperations {
EXECUTION_RELATION_BY_NAME,
EXECUTIONS_INFO_RELATION,
PLATFORM_LIST_RELATION,
RETRIEVE_LOG
RETRIEVE_LOG,
VALIDATION_REL
).forEach(relation -> {
Assert.isTrue(resources.getLink(relation).isPresent(), () -> relation + " relation is required");
});

this.restTemplate = restTemplate;
this.dataFlowServerVersion = dataFlowServerVersion;
this.restTemplate = restTemplate;

String version = VersionUtils.getThreePartVersion(dataFlowServerVersion);
if (VersionUtils.isDataFlowServerVersionGreaterThanOrEqualToRequiredVersion(version, EXECUTIONS_CURRENT_RELATION_VERSION)) {
Assert.isTrue(resources.getLink(EXECUTIONS_CURRENT_RELATION).isPresent(), ()-> EXECUTIONS_CURRENT_RELATION + " relation is required");
this.executionsCurrentLink = resources.getLink(EXECUTIONS_CURRENT_RELATION).get();
} else {
this.executionsCurrentLink = null;
}
if (VersionUtils.isDataFlowServerVersionGreaterThanOrEqualToRequiredVersion(version, VALIDATION_RELATION_VERSION)) {
Assert.isTrue(resources.getLink(VALIDATION_REL).isPresent(), ()->VALIDATION_REL + " relation is required");
this.validationLink = resources.getLink(VALIDATION_REL).get();
} else {
this.validationLink = null;
}

this.aboutLink = resources.getLink("about").get();

if(VersionUtils.isDataFlowServerVersionGreaterThanOrEqualToRequiredVersion(version, VALIDATION_THIN_TASK_VERSION) && resources.getLink(THIN_EXECUTIONS_RELATION).isPresent()) {
this.definitionsLink = resources.getLink(DEFINITIONS_RELATION).get();
this.definitionLink = resources.getLink(DEFINITION_RELATION).get();
this.executionsLink = resources.getLink(EXECUTIONS_RELATION).get();
this.executionLink = resources.getLink(EXECUTION_RELATION).get();
if(VersionUtils.isDataFlowServerVersionGreaterThanOrEqualToRequiredVersion(version, VALIDATION_THIN_TASK_VERSION)) {
Assert.isTrue(resources.getLink(THIN_EXECUTIONS_RELATION).isPresent(), () -> THIN_EXECUTIONS_RELATION + " relation is required");
this.thinExecutionsLink = resources.getLink(THIN_EXECUTIONS_RELATION).get();
} else {
Expand All @@ -180,16 +177,10 @@ public class TaskTemplate implements TaskOperations {
} else {
this.executionLaunchLink = null;
}


this.aboutLink = resources.getLink("about").get();

this.definitionsLink = resources.getLink(DEFINITIONS_RELATION).get();
this.definitionLink = resources.getLink(DEFINITION_RELATION).get();
this.executionsLink = resources.getLink(EXECUTIONS_RELATION).get();
this.executionLink = resources.getLink(EXECUTION_RELATION).get();
this.executionByNameLink = resources.getLink(EXECUTION_RELATION_BY_NAME).get();
this.executionsInfoLink = resources.getLink(EXECUTIONS_INFO_RELATION).get();

this.validationLink = resources.getLink(VALIDATION_REL).get();
this.platformListLink = resources.getLink(PLATFORM_LIST_RELATION).get();
this.retrieveLogLink = resources.getLink(RETRIEVE_LOG).get();
}
Expand Down
6 changes: 3 additions & 3 deletions src/scripts/build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if [ -z "$BASH_VERSION" ]; then
exit 1
fi
SCDIR=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
SCDIR=$(realpath "$SCDIR/../..")
pushd "$SCDIR" || exit
./mvnw install -DskipTests -am -pl :spring-cloud-dataflow-classic-docs,:spring-cloud-dataflow-docs,:spring-cloud-skipper-server-core,:spring-cloud-skipper-docs -Pfull,docs
SCDIR=$(realpath $SCDIR)
pushd "$SCDIR" > /dev/null || exit
./mvnw install -DskipTests -am -pl :spring-cloud-dataflow-classic-docs,:spring-cloud-dataflow-docs,:spring-cloud-skipper-server-core,:spring-cloud-skipper-docs -Pfull,docs -B --no-transfer-progress
popd > /dev/null || exit

0 comments on commit 8118ada

Please sign in to comment.