#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);
return modules.stream().//
filter(module -> !exclusionList.contains(module.getProject())).//
map(module -> new ModuleIteration(module, new TrainIteration(this, iteration))).//
collect(Collectors.toList());
return modules.stream() //
.filter(module -> !exclusionList.contains(module.getProject())) //
.map(module -> new ModuleIteration(module, new TrainIteration(this, iteration))) //
.collect(Collectors.toList());
}
public TrainIteration getIteration(String name) {

View File

@@ -114,11 +114,10 @@ public class TrainIteration implements Streamable<ModuleIteration> {
public String getNextBugfixName() {
Version version = getTrain().getCalver();
int currentBugfixLevel = 0;
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
* {@link MaintainedVersions}.
*
*
* @param version 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.
*
*
* @return
*/
public String getReleaseStatus() {
@@ -85,7 +85,7 @@ class ProjectMetadata {
/**
* Returns the group identifier of the release.
*
*
* @return
*/
public String getGroupId() {
@@ -94,7 +94,7 @@ class ProjectMetadata {
/**
* Returns the artifact identifier.
*
*
* @return
*/
public String getArtifactId() {
@@ -108,7 +108,7 @@ class ProjectMetadata {
/**
* Returns whether the version is the most current one.
*
*
* @return
*/
public Boolean getCurrent() {
@@ -117,7 +117,7 @@ class ProjectMetadata {
/**
* Returns the reference documentation URL for non-snapshot versions and not the build project.
*
*
* @return
*/
public String getRefDocUrl() {
@@ -129,7 +129,7 @@ class ProjectMetadata {
/**
* Returns the JavaDoc URL for non-snapshot versions and not the build project.
*
*
* @return
*/
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
* version.
*
*
* @return
*/
public String getVersion() {
@@ -163,7 +163,7 @@ class ProjectMetadata {
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(),

View File

@@ -75,7 +75,14 @@ class SaganOperations {
Map<Project, MaintainedVersions> versions = findVersions(trains);
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());
});
}
/**