From 218eb4d6866411bb648a471e334d1d91b6659cc1 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Wed, 18 Mar 2020 17:55:17 +0000 Subject: [PATCH] Upgrade spring and lombok (#285) * Bump lombok from 1.18.10 to 1.18.12 Bumps [lombok](https://github.com/rzwitserloot/lombok) from 1.18.10 to 1.18.12. - [Release notes](https://github.com/rzwitserloot/lombok/releases) - [Changelog](https://github.com/rzwitserloot/lombok/blob/master/doc/changelog.markdown) - [Commits](https://github.com/rzwitserloot/lombok/compare/v1.18.10...v1.18.12) Signed-off-by: dependabot-preview[bot] * Bump spring-boot.version from 2.1.9.RELEASE to 2.2.5.RELEASE Bumps `spring-boot.version` from 2.1.9.RELEASE to 2.2.5.RELEASE. Updates `spring-boot-dependencies` from 2.1.9.RELEASE to 2.2.5.RELEASE - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v2.1.9.RELEASE...v2.2.5.RELEASE) Updates `spring-boot-maven-plugin` from 2.1.9.RELEASE to 2.2.5.RELEASE - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v2.1.9.RELEASE...v2.2.5.RELEASE) Signed-off-by: dependabot-preview[bot] * Configuration Properties no longer appears to work with File or Path The base path also appears to have changed when running builder to be within the builder project. * [changelog] updated Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- CHANGELOG.org | 8 +++++++- builder/pom.xml | 4 ++-- .../ruleset/builder/OutputProperties.java | 2 +- .../checkstyle/ruleset/builder/ReadmeWriter.java | 3 ++- builder/src/main/resources/application.yml | 10 +++++----- .../ruleset/builder/OutputPropertiesTest.java | 2 +- .../ruleset/builder/ReadmeWriterTest.java | 16 +++------------- 7 files changed, 21 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index d433386..5ea4936 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -5,14 +5,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -* [5.4.0] - 2020-03-17 +* [5.4.0] - 2020-03-18 ** Changed - Replace Jenkins with Github Actions for CI (#282) +** Removed + + - Disable sevntu (#284) + ** Dependencies + * Bump spring-boot.version from 2.1.9.RELEASE to 2.2.5.RELEASE (#279) + * Bump lombok from 1.18.10 to 1.18.12 (#272) * Bump checkstyle from 8.20 to 8.29 (#268) * Bump tiles-maven-plugin from 2.15 to 2.16 (#256) * Bump maven-checkstyle-plugin from 3.1.0 to 3.1.1 (#274) diff --git a/builder/pom.xml b/builder/pom.xml index 6776207..2f5ee84 100644 --- a/builder/pom.xml +++ b/builder/pom.xml @@ -27,9 +27,9 @@ 8.30 1.37.1 1.35.0 - 1.18.10 + 1.18.12 Brussels-SR6 - 2.1.9.RELEASE + 2.2.5.RELEASE 3.2.7 1.0.0 3.3.3 diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/OutputProperties.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/OutputProperties.java index 23b2f29..3b5d393 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/OutputProperties.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/OutputProperties.java @@ -32,5 +32,5 @@ class OutputProperties { /** * The README.md file. */ - private Path readme; + private String readme; } diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeWriter.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeWriter.java index 2c9bf75..edf08ee 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeWriter.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeWriter.java @@ -5,6 +5,7 @@ import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Component; import java.nio.file.Path; +import java.nio.file.Paths; /** * Writes the README file. @@ -25,7 +26,7 @@ class ReadmeWriter implements CommandLineRunner { public void run(final String... args) throws Exception { Path templatePath = templateProperties.getReadmeTemplate(); String templateBody = fileReader.read(templatePath); - Path outputPath = outputProperties.getReadme(); + Path outputPath = Paths.get(outputProperties.getReadme()); String outputBody = readmeBuilder.build(templateBody); fileWriter.write(outputPath, outputBody); } diff --git a/builder/src/main/resources/application.yml b/builder/src/main/resources/application.yml index 810853b..7d062f2 100644 --- a/builder/src/main/resources/application.yml +++ b/builder/src/main/resources/application.yml @@ -1,5 +1,5 @@ output: - directory: ruleset/src/main/resources/net/kemitix + directory: ../ruleset/src/main/resources/net/kemitix ruleset-files: DISABLED: checkstyle-0-disabled.xml LAYOUT: checkstyle-1-layout.xml @@ -7,11 +7,11 @@ output: JAVADOC: checkstyle-3-javadoc.xml TWEAKS: checkstyle-4-tweaks.xml COMPLEXITY: checkstyle-5-complexity.xml - readme: README.md + readme: ../README.md template: - checkstyle-xml: builder/src/main/resources/checkstyle-template.xml - readme-template: builder/src/main/resources/README-template.md - readme-fragments: builder/src/main/resources/rules + checkstyle-xml: src/main/resources/checkstyle-template.xml + readme-template: src/main/resources/README-template.md + readme-fragments: src/main/resources/rules sources: - name: checkstyle diff --git a/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/OutputPropertiesTest.java b/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/OutputPropertiesTest.java index 8ffd97c..b01098d 100644 --- a/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/OutputPropertiesTest.java +++ b/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/OutputPropertiesTest.java @@ -27,7 +27,7 @@ public class OutputPropertiesTest { //given val directory = Paths.get("directory"); val rulesetFiles = new HashMap(); - val readme = Paths.get("readme.md"); + val readme = "readme.md"; //when outputProperties.setDirectory(directory); outputProperties.setRulesetFiles(rulesetFiles); diff --git a/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/ReadmeWriterTest.java b/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/ReadmeWriterTest.java index 354fda9..bfd70a9 100644 --- a/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/ReadmeWriterTest.java +++ b/builder/src/test/java/net/kemitix/checkstyle/ruleset/builder/ReadmeWriterTest.java @@ -1,25 +1,16 @@ package net.kemitix.checkstyle.ruleset.builder; -import lombok.val; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; -import org.junit.rules.TemporaryFolder; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import java.io.File; import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; import java.nio.file.Path; -import java.util.Arrays; +import java.nio.file.Paths; import java.util.UUID; -import java.util.function.Supplier; -import java.util.stream.Stream; -import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.verify; @@ -47,8 +38,7 @@ public class ReadmeWriterTest { @Mock private Path templatePath; - @Mock - private Path outputPath; + private String outputPath = UUID.randomUUID().toString(); private String templateBody = UUID.randomUUID().toString(); private String formattedOutput = UUID.randomUUID().toString(); @@ -73,7 +63,7 @@ public class ReadmeWriterTest { //when readmeWriter.run(); //then - verify(fileWriter).write(outputPath, formattedOutput); + verify(fileWriter).write(Paths.get(outputPath), formattedOutput); } }