From e7f30c760b945ff6e25e7d12a7ac182ee94b71bf Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Thu, 5 Jan 2017 16:18:59 +0000 Subject: [PATCH] builder:TemplateProperties: added --- .../ruleset/builder/OutputProperties.java | 2 -- .../ruleset/builder/TemplateProperties.java | 35 +++++++++++++++++++ builder/src/main/resources/application.yml | 5 ++- 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/TemplateProperties.java 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 176466e..39ec1ba 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 @@ -30,7 +30,5 @@ class OutputProperties { private Map rulesetFiles; /** - * Template for Checkstyle XML files. */ - private Path checkstyleXmlTemplate; } diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/TemplateProperties.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/TemplateProperties.java new file mode 100644 index 0000000..259d759 --- /dev/null +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/TemplateProperties.java @@ -0,0 +1,35 @@ +package net.kemitix.checkstyle.ruleset.builder; + +import lombok.Getter; +import lombok.Setter; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +import java.nio.file.Path; + +/** + * Properties for template files. + * + * @author Paul Campbell (pcampbell@kemitix.net) + */ +@Setter +@Getter +@Configuration +@ConfigurationProperties(prefix = "template") +class TemplateProperties { + + /** + * Template for Checkstyle XML files. + */ + private Path checkstyleXml; + + /** + * Template for README.md file. + */ + private Path readmeTemplate; + + /** + * The directory containing the README fragments. + */ + private Path readmeFragments; +} diff --git a/builder/src/main/resources/application.yml b/builder/src/main/resources/application.yml index 051261c..434d757 100644 --- a/builder/src/main/resources/application.yml +++ b/builder/src/main/resources/application.yml @@ -6,7 +6,10 @@ output: JAVADOC: checkstyle-3-javadoc.xml TWEAKS: checkstyle-4-tweaks.xml COMPLEXITY: checkstyle-5-complexity.xml - checkstyle-xml-template: builder/src/main/resources/checkstyle-template.xml +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 rules: - name: AbbreviationAsWordInName