#155 - Fix calver version bump after conclude.
This commit is contained in:
@@ -242,7 +242,7 @@ class MavenBuildSystem implements BuildSystem {
|
||||
if (BUILD.equals(project)) {
|
||||
|
||||
if (!module.getTrain().usesCalver()) {
|
||||
mvn.execute(project, goals.and(arg("newVersion").withValue(information.getReleaseTrainNameVersion())) //
|
||||
mvn.execute(project, goals.and(arg("newVersion").withValue(information.getReleaseTrainVersion())) //
|
||||
.and(arg("generateBackupPoms").withValue("false")) //
|
||||
.and(arg("groupId").withValue("org.springframework.data")) //
|
||||
.and(arg("artifactId").withValue("spring-data-releasetrain")));
|
||||
|
||||
@@ -92,31 +92,6 @@ public class UpdateInformation {
|
||||
return new Repository(train.getIteration());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the version {@link String} to be used to describe the release train.
|
||||
*
|
||||
* @return will never be {@literal null}.
|
||||
*/
|
||||
public String getReleaseTrainNameVersion() {
|
||||
|
||||
boolean usesCalver = train.getTrain().usesCalver();
|
||||
|
||||
switch (phase) {
|
||||
case PREPARE:
|
||||
return train.getReleaseTrainNameAndVersion();
|
||||
case CLEANUP:
|
||||
case MAINTENANCE:
|
||||
|
||||
if (usesCalver) {
|
||||
return String.format("%s-SNAPSHOT", train.getNextBugfixName());
|
||||
}
|
||||
|
||||
return String.format("%s-BUILD-SNAPSHOT", train.getName());
|
||||
}
|
||||
|
||||
throw new IllegalStateException("Unexpected phase detected " + phase + " detected!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the version {@link String} to be used to describe the release train.
|
||||
*
|
||||
@@ -129,10 +104,19 @@ public class UpdateInformation {
|
||||
switch (phase) {
|
||||
case PREPARE:
|
||||
return train.getReleaseTrainNameAndVersion();
|
||||
case CLEANUP:
|
||||
case MAINTENANCE:
|
||||
if (usesCalver) {
|
||||
return String.format("%s-SNAPSHOT", train.getNextBugfixName());
|
||||
}
|
||||
|
||||
case CLEANUP:
|
||||
|
||||
if (usesCalver) {
|
||||
|
||||
if (train.getIteration().isGAIteration()) {
|
||||
return String.format("%s-SNAPSHOT", train.getNextIterationName());
|
||||
}
|
||||
|
||||
return String.format("%s-SNAPSHOT", train.getNextBugfixName());
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ class ReleaseCommands extends TimedCommand {
|
||||
|
||||
git.prepare(iteration);
|
||||
|
||||
// build.runPreReleaseChecks(iteration);
|
||||
build.runPreReleaseChecks(iteration);
|
||||
|
||||
misc.prepareChangelogs(iteration);
|
||||
misc.updateResources(iteration);
|
||||
|
||||
@@ -81,7 +81,7 @@ public class TrainIteration implements Streamable<ModuleIteration> {
|
||||
return String.format("%s-%s", getCalver().toMajorMinorBugfix(), iteration);
|
||||
}
|
||||
|
||||
return getCalver().toString();
|
||||
return getCalver().toMajorMinorBugfix();
|
||||
}
|
||||
|
||||
if (iteration.isGAIteration()) {
|
||||
@@ -104,20 +104,24 @@ public class TrainIteration implements Streamable<ModuleIteration> {
|
||||
|
||||
Version version = getTrain().getCalver();
|
||||
|
||||
if (getIteration().isServiceIteration()) {
|
||||
return version.withBugfix(getIteration().getBugfixValue());
|
||||
}
|
||||
|
||||
return version;
|
||||
return version.withBugfix(getIteration().getBugfixValue());
|
||||
}
|
||||
|
||||
public String getNextBugfixName() {
|
||||
|
||||
Version version = getTrain().getCalver();
|
||||
if (getIteration().isServiceIteration()) {
|
||||
|
||||
if (getIteration().isGAIteration() || getIteration().isServiceIteration()) {
|
||||
return version.withBugfix(getIteration().getBugfixValue() + 1).toMajorMinorBugfix();
|
||||
}
|
||||
|
||||
return version.toMajorMinorBugfix();
|
||||
}
|
||||
|
||||
public String getNextIterationName() {
|
||||
|
||||
Version version = getTrain().getCalver().nextMinor();
|
||||
|
||||
return version.toMajorMinorBugfix();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user