#144 - Polishing.

Correctly format next version identifier.
This commit is contained in:
Mark Paluch
2020-06-19 14:33:17 +02:00
parent ec5a0bd7d6
commit 115f6054fb
4 changed files with 23 additions and 17 deletions

View File

@@ -147,10 +147,10 @@ public class Train implements Streamable<Module> {
List<Project> exclusionList = Arrays.asList(exclusions); List<Project> exclusionList = Arrays.asList(exclusions);
return modules.stream().// return modules.stream() //
filter(module -> !exclusionList.contains(module.getProject())).// .filter(module -> !exclusionList.contains(module.getProject())) //
map(module -> new ModuleIteration(module, new TrainIteration(this, iteration))).// .map(module -> new ModuleIteration(module, new TrainIteration(this, iteration))) //
collect(Collectors.toList()); .collect(Collectors.toList());
} }
public TrainIteration getIteration(String name) { public TrainIteration getIteration(String name) {

View File

@@ -114,11 +114,10 @@ public class TrainIteration implements Streamable<ModuleIteration> {
public String getNextBugfixName() { public String getNextBugfixName() {
Version version = getTrain().getCalver(); Version version = getTrain().getCalver();
int currentBugfixLevel = 0;
if (getIteration().isServiceIteration()) { if (getIteration().isServiceIteration()) {
currentBugfixLevel = getIteration().getBugfixValue(); return version.withBugfix(getIteration().getBugfixValue() + 1).toMajorMinorBugfix();
} }
return version.withBugfix(currentBugfixLevel + 1).toString(); return version.toMajorMinorBugfix();
} }
} }

View File

@@ -45,7 +45,7 @@ class ProjectMetadata {
/** /**
* Creates a new {@link ProjectMetadata} instace from the given {@link MaintainedVersion} in the context of the * Creates a new {@link ProjectMetadata} instace from the given {@link MaintainedVersion} in the context of the
* {@link MaintainedVersions}. * {@link MaintainedVersions}.
* *
* @param version must not be {@literal null}. * @param version must not be {@literal null}.
* @param versions must not be {@literal null}. * @param versions must not be {@literal null}.
*/ */
@@ -61,7 +61,7 @@ class ProjectMetadata {
/** /**
* Returns the release status used on Sagan. * Returns the release status used on Sagan.
* *
* @return * @return
*/ */
public String getReleaseStatus() { public String getReleaseStatus() {
@@ -85,7 +85,7 @@ class ProjectMetadata {
/** /**
* Returns the group identifier of the release. * Returns the group identifier of the release.
* *
* @return * @return
*/ */
public String getGroupId() { public String getGroupId() {
@@ -94,7 +94,7 @@ class ProjectMetadata {
/** /**
* Returns the artifact identifier. * Returns the artifact identifier.
* *
* @return * @return
*/ */
public String getArtifactId() { public String getArtifactId() {
@@ -108,7 +108,7 @@ class ProjectMetadata {
/** /**
* Returns whether the version is the most current one. * Returns whether the version is the most current one.
* *
* @return * @return
*/ */
public Boolean getCurrent() { public Boolean getCurrent() {
@@ -117,7 +117,7 @@ class ProjectMetadata {
/** /**
* Returns the reference documentation URL for non-snapshot versions and not the build project. * Returns the reference documentation URL for non-snapshot versions and not the build project.
* *
* @return * @return
*/ */
public String getRefDocUrl() { public String getRefDocUrl() {
@@ -129,7 +129,7 @@ class ProjectMetadata {
/** /**
* Returns the JavaDoc URL for non-snapshot versions and not the build project. * Returns the JavaDoc URL for non-snapshot versions and not the build project.
* *
* @return * @return
*/ */
public String getApiDocUrl() { public String getApiDocUrl() {
@@ -146,7 +146,7 @@ class ProjectMetadata {
/** /**
* Return the version to use. For the build project that's the release train name, for everything else the artifact * Return the version to use. For the build project that's the release train name, for everything else the artifact
* version. * version.
* *
* @return * @return
*/ */
public String getVersion() { public String getVersion() {
@@ -163,7 +163,7 @@ class ProjectMetadata {
return train.getCalver().toMajorMinorBugfix(); return train.getCalver().toMajorMinorBugfix();
} }
return String.format("%s-%s", train.getName(), version.getReleaseTrainSuffix()); return String.format("%s-%s", train.getCalver().toMajorMinorBugfix(), version.getReleaseTrainSuffix());
} }
return String.format("%s-%s", train.getName(), return String.format("%s-%s", train.getName(),

View File

@@ -75,7 +75,14 @@ class SaganOperations {
Map<Project, MaintainedVersions> versions = findVersions(trains); Map<Project, MaintainedVersions> versions = findVersions(trains);
ExecutionUtils.run(executor, Streamable.of(versions.entrySet()), ExecutionUtils.run(executor, Streamable.of(versions.entrySet()),
entry -> client.updateProjectMetadata(entry.getKey(), entry.getValue())); entry -> {
if (entry.getKey() == Projects.BOM) {
return;
}
client.updateProjectMetadata(entry.getKey(), entry.getValue());
});
} }
/** /**