#32 - Allow enforcing to build milestone releases on a branch.
Train has now a method withAlwaysUseBranch(…) to define that milestone releases are supposed to be build from a branch, too. Introduced Kay release train using that new flag and setting up a customized Iteration chain including a second milestone.
This commit is contained in:
@@ -48,7 +48,7 @@ public class Branch implements Comparable<Branch> {
|
|||||||
|
|
||||||
Assert.notNull(iterationVersion, "Iteration version must not be null!");
|
Assert.notNull(iterationVersion, "Iteration version must not be null!");
|
||||||
|
|
||||||
if (iterationVersion.isServiceIteration()) {
|
if (iterationVersion.isBranchVersion()) {
|
||||||
return from((VersionAware) iterationVersion);
|
return from((VersionAware) iterationVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,6 +63,12 @@ public class Branch implements Comparable<Branch> {
|
|||||||
return from(version.toString().concat(".x"));
|
return from(version.toString().concat(".x"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new {@link Branch} from the given name. Uses the local part of it only.
|
||||||
|
*
|
||||||
|
* @param name must not be {@literal null} or empty.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public static Branch from(String name) {
|
public static Branch from(String name) {
|
||||||
|
|
||||||
int slashIndex = name.lastIndexOf('/');
|
int slashIndex = name.lastIndexOf('/');
|
||||||
@@ -95,6 +101,10 @@ public class Branch implements Comparable<Branch> {
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
* @see java.lang.Comparable#compareTo(java.lang.Object)
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(Branch o) {
|
public int compareTo(Branch o) {
|
||||||
return name.compareToIgnoreCase(o.name);
|
return name.compareToIgnoreCase(o.name);
|
||||||
|
|||||||
@@ -28,8 +28,9 @@ import org.springframework.util.Assert;
|
|||||||
@Value
|
@Value
|
||||||
public class Iteration {
|
public class Iteration {
|
||||||
|
|
||||||
public static final Iteration SR6 = new Iteration("SR6", null);
|
public static final Iteration SR7 = new Iteration("SR7", null);
|
||||||
public static final Iteration SR5 = new Iteration("SR6", SR6);
|
public static final Iteration SR6 = new Iteration("SR6", SR7);
|
||||||
|
public static final Iteration SR5 = new Iteration("SR5", SR6);
|
||||||
public static final Iteration SR4 = new Iteration("SR4", SR5);
|
public static final Iteration SR4 = new Iteration("SR4", SR5);
|
||||||
public static final Iteration SR3 = new Iteration("SR3", SR4);
|
public static final Iteration SR3 = new Iteration("SR3", SR4);
|
||||||
public static final Iteration SR2 = new Iteration("SR2", SR3);
|
public static final Iteration SR2 = new Iteration("SR2", SR3);
|
||||||
|
|||||||
@@ -24,5 +24,5 @@ public interface IterationVersion extends VersionAware {
|
|||||||
|
|
||||||
Iteration getIteration();
|
Iteration getIteration();
|
||||||
|
|
||||||
boolean isServiceIteration();
|
boolean isBranchVersion();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,11 +65,11 @@ public class ModuleIteration implements IterationVersion {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.springframework.data.release.model.IterationVersion#isServiceIteration()
|
* @see org.springframework.data.release.model.IterationVersion#isBranchVersion()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean isServiceIteration() {
|
public boolean isBranchVersion() {
|
||||||
return getIteration().isServiceIteration();
|
return getIteration().isServiceIteration() || trainIteration.getTrain().isAlwaysUseBranch();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -15,19 +15,22 @@
|
|||||||
*/
|
*/
|
||||||
package org.springframework.data.release.model;
|
package org.springframework.data.release.model;
|
||||||
|
|
||||||
|
import static org.springframework.data.release.model.Iteration.*;
|
||||||
import static org.springframework.data.release.model.Projects.*;
|
import static org.springframework.data.release.model.Projects.*;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.data.release.model.Train.Iterations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Oliver Gierke
|
* @author Oliver Gierke
|
||||||
*/
|
*/
|
||||||
public class ReleaseTrains {
|
public class ReleaseTrains {
|
||||||
|
|
||||||
public static final List<Train> TRAINS;
|
public static final List<Train> TRAINS;
|
||||||
public static final Train CODD, DIJKSTRA, EVANS, FOWLER, GOSLING, HOPPER, INGALLS;
|
public static final Train CODD, DIJKSTRA, EVANS, FOWLER, GOSLING, HOPPER, INGALLS, KAY;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
|
||||||
@@ -40,9 +43,17 @@ public class ReleaseTrains {
|
|||||||
new Module(NEO4J, "4.1"), new Module(COUCHBASE, "2.1"), new Module(ELASTICSEARCH, "2.0"));
|
new Module(NEO4J, "4.1"), new Module(COUCHBASE, "2.1"), new Module(ELASTICSEARCH, "2.0"));
|
||||||
INGALLS = HOPPER.next("Ingalls", Transition.MINOR);
|
INGALLS = HOPPER.next("Ingalls", Transition.MINOR);
|
||||||
|
|
||||||
|
Iteration M2 = new Iteration("M2", RC1);
|
||||||
|
|
||||||
|
Iterations iterations = new Iterations(new Iteration("M1", M2), M2, RC1, GA, SR1, SR2, SR3, SR4, SR5, SR6, SR7);
|
||||||
|
|
||||||
|
KAY = INGALLS.next("Kay", Transition.MAJOR)//
|
||||||
|
.withAlwaysUseBranch(true)//
|
||||||
|
.withIterations(iterations);
|
||||||
|
|
||||||
// Trains
|
// Trains
|
||||||
|
|
||||||
TRAINS = Arrays.asList(CODD, DIJKSTRA, EVANS, FOWLER, GOSLING, HOPPER, INGALLS);
|
TRAINS = Arrays.asList(CODD, DIJKSTRA, EVANS, FOWLER, GOSLING, HOPPER, INGALLS, KAY);
|
||||||
|
|
||||||
// Train names
|
// Train names
|
||||||
|
|
||||||
|
|||||||
@@ -17,9 +17,12 @@ package org.springframework.data.release.model;
|
|||||||
|
|
||||||
import static org.springframework.data.release.model.Iteration.*;
|
import static org.springframework.data.release.model.Iteration.*;
|
||||||
|
|
||||||
|
import lombok.AccessLevel;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.Value;
|
import lombok.Value;
|
||||||
|
import lombok.experimental.Wither;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@@ -38,21 +41,20 @@ import org.springframework.util.Assert;
|
|||||||
* @author Oliver Gierke
|
* @author Oliver Gierke
|
||||||
*/
|
*/
|
||||||
@Value
|
@Value
|
||||||
|
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
public class Train implements Streamable<Module> {
|
public class Train implements Streamable<Module> {
|
||||||
|
|
||||||
private final String name;;
|
private final String name;;
|
||||||
private final Modules modules;
|
private final Modules modules;
|
||||||
private final Iterations iterations;
|
private @Wither Iterations iterations;
|
||||||
|
private @Wither boolean alwaysUseBranch;
|
||||||
|
|
||||||
public Train(String name, Module... modules) {
|
public Train(String name, Module... modules) {
|
||||||
this(name, Arrays.asList(modules));
|
this(name, Arrays.asList(modules));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Train(String name, Collection<Module> modules) {
|
public Train(String name, Collection<Module> modules) {
|
||||||
|
this(name, Modules.of(modules), Iterations.DEFAULT, false);
|
||||||
this.name = name;
|
|
||||||
this.modules = Modules.of(modules);
|
|
||||||
this.iterations = Iterations.DEFAULT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -182,7 +184,7 @@ public class Train implements Streamable<Module> {
|
|||||||
@ToString
|
@ToString
|
||||||
public static class Iterations implements Iterable<Iteration> {
|
public static class Iterations implements Iterable<Iteration> {
|
||||||
|
|
||||||
public static Iterations DEFAULT = new Iterations(M1, RC1, GA, SR1, SR2, SR3, SR4, SR5, SR6);
|
public static Iterations DEFAULT = new Iterations(M1, RC1, GA, SR1, SR2, SR3, SR4, SR5, SR6, SR7);
|
||||||
|
|
||||||
private final List<Iteration> iterations;
|
private final List<Iteration> iterations;
|
||||||
|
|
||||||
|
|||||||
@@ -25,10 +25,10 @@ public class SimpleIterationVersion implements IterationVersion {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.springframework.data.release.model.IterationVersion#isServiceIteration()
|
* @see org.springframework.data.release.model.IterationVersion#isBranchVersion()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean isServiceIteration() {
|
public boolean isBranchVersion() {
|
||||||
return iteration.isServiceIteration();
|
return iteration.isServiceIteration();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user