Skip to content

Commit

Permalink
Bumping versions
Browse files Browse the repository at this point in the history
  • Loading branch information
spring-builds committed Jul 23, 2024
1 parent 6180ef2 commit 84b37bf
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,23 @@ List<ConfigurationProperty> mergedConfigurationProperties(Path unpackedDocs) {
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ void generate(File bomPath, File starterParentPath, File generatedTrainDocs) {
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@ File generate(List<Project> projects) {
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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ void should_return_a_list_of_docs_modules_to_download() throws URISyntaxExceptio

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"));
}

Expand Down

0 comments on commit 84b37bf

Please sign in to comment.