Bumping versions
This commit is contained in:
@@ -34,21 +34,23 @@ class ConfigurationPropertiesAggregator {
|
||||
try {
|
||||
return Files.walk(unpackedDocs).filter(path -> path.endsWith("_configprops.adoc")).flatMap(path -> {
|
||||
try {
|
||||
return Files.readAllLines(path).stream()
|
||||
.filter(s -> !StringUtils.isEmpty(s) && !wordsToIgnore.contains(s)).map(s -> {
|
||||
// |foo|bar|baz -> foo|bar|baz -> split ->
|
||||
// foo,bar,baz
|
||||
String[] strings = s.substring(1).split("\\|");
|
||||
if (strings.length == 3) {
|
||||
return new ConfigurationProperty(strings[0].trim(),
|
||||
strings[1].trim().replace("`", ""), strings[2].trim());
|
||||
}
|
||||
else if (strings.length == 2) {
|
||||
return new ConfigurationProperty(strings[0].trim(),
|
||||
strings[1].trim().replace("`", ""), "");
|
||||
}
|
||||
return new ConfigurationProperty(strings[0].trim(), "", "");
|
||||
});
|
||||
return Files.readAllLines(path)
|
||||
.stream()
|
||||
.filter(s -> !StringUtils.isEmpty(s) && !wordsToIgnore.contains(s))
|
||||
.map(s -> {
|
||||
// |foo|bar|baz -> foo|bar|baz -> split ->
|
||||
// foo,bar,baz
|
||||
String[] strings = s.substring(1).split("\\|");
|
||||
if (strings.length == 3) {
|
||||
return new ConfigurationProperty(strings[0].trim(), strings[1].trim().replace("`", ""),
|
||||
strings[2].trim());
|
||||
}
|
||||
else if (strings.length == 2) {
|
||||
return new ConfigurationProperty(strings[0].trim(), strings[1].trim().replace("`", ""),
|
||||
"");
|
||||
}
|
||||
return new ConfigurationProperty(strings[0].trim(), "", "");
|
||||
});
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new IllegalStateException(e);
|
||||
|
||||
@@ -48,9 +48,11 @@ public class GenerateReleaseTrainDocs {
|
||||
List<Project> mavenPropertiesToDocsProjects(File file) {
|
||||
Model model = PomReader.readPom(file);
|
||||
Properties properties = model.getProperties();
|
||||
return properties.entrySet().stream().filter(e -> e.getKey().toString().endsWith(".version"))
|
||||
.map(e -> new Project(e.getKey().toString().replace(".version", ""), e.getValue().toString()))
|
||||
.collect(Collectors.toCollection(LinkedList::new));
|
||||
return properties.entrySet()
|
||||
.stream()
|
||||
.filter(e -> e.getKey().toString().endsWith(".version"))
|
||||
.map(e -> new Project(e.getKey().toString().replace(".version", ""), e.getValue().toString()))
|
||||
.collect(Collectors.toCollection(LinkedList::new));
|
||||
}
|
||||
|
||||
Project springBootVersion(File file) {
|
||||
|
||||
@@ -55,8 +55,12 @@ class TemplateGenerator {
|
||||
Template template = template(templateFile.getName().replace(".hbs", ""));
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("projects", projects);
|
||||
map.put("springBootVersion", projects.stream().filter(project -> project.name.equals("spring-boot"))
|
||||
.findFirst().orElse(new Project("spring-boot", "")).getVersion());
|
||||
map.put("springBootVersion",
|
||||
projects.stream()
|
||||
.filter(project -> project.name.equals("spring-boot"))
|
||||
.findFirst()
|
||||
.orElse(new Project("spring-boot", ""))
|
||||
.getVersion());
|
||||
map.put("springCloudProjects", templateProjects);
|
||||
String applied = template.apply(map);
|
||||
Files.write(outputFile.toPath(), applied.getBytes());
|
||||
|
||||
@@ -34,12 +34,13 @@ public class GenerateReleaseTrainDocsTests {
|
||||
|
||||
List<Project> projects = new GenerateReleaseTrainDocs().mavenPropertiesToDocsProjects(testPom);
|
||||
|
||||
BDDAssertions.then(projects).extracting("name").containsOnly("spring-cloud-foo-bus", "spring-cloud-foo-build",
|
||||
"spring-cloud-foo-commons", "spring-cloud-foo-circuitbreaker", "spring-cloud-foo-config",
|
||||
"spring-cloud-foo-consul", "spring-cloud-foo-contract", "spring-cloud-foo-function",
|
||||
"spring-cloud-foo-gateway", "spring-cloud-foo-kubernetes", "spring-cloud-foo-netflix",
|
||||
"spring-cloud-foo-openfeign", "spring-cloud-foo-task", "spring-cloud-foo-vault",
|
||||
"spring-cloud-foo-zookeeper");
|
||||
BDDAssertions.then(projects)
|
||||
.extracting("name")
|
||||
.containsOnly("spring-cloud-foo-bus", "spring-cloud-foo-build", "spring-cloud-foo-commons",
|
||||
"spring-cloud-foo-circuitbreaker", "spring-cloud-foo-config", "spring-cloud-foo-consul",
|
||||
"spring-cloud-foo-contract", "spring-cloud-foo-function", "spring-cloud-foo-gateway",
|
||||
"spring-cloud-foo-kubernetes", "spring-cloud-foo-netflix", "spring-cloud-foo-openfeign",
|
||||
"spring-cloud-foo-task", "spring-cloud-foo-vault", "spring-cloud-foo-zookeeper");
|
||||
BDDAssertions.then(projects).contains(new Project("spring-cloud-foo-bus", "2.2.3.RELEASE"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user