From f57fcfe3f6019acd3c9039cc966df9b883614b8f Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Thu, 5 Jan 2017 06:58:52 +0000 Subject: [PATCH] builder:OutputProperties: restructured output file specification Map the filenames from each of the RuleLevel values. --- .../ruleset/builder/OutputProperties.java | 30 +++++-------------- builder/src/main/resources/application.yml | 14 +++++---- 2 files changed, 15 insertions(+), 29 deletions(-) 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 dffb53f..176466e 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 @@ -2,18 +2,17 @@ package net.kemitix.checkstyle.ruleset.builder; import lombok.Getter; import lombok.Setter; -import lombok.extern.slf4j.Slf4j; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration; -import java.io.File; +import java.nio.file.Path; +import java.util.Map; /** * Properties defining the output files. * * @author Paul Campbell (pcampbell@kemitix.net) */ -@Slf4j @Setter @Getter @Configuration @@ -23,30 +22,15 @@ class OutputProperties { /** * The directory to create the output files in. */ - private File directory; + private Path directory; /** - * The name of the level 1 ruleset file. + * Checkstyle XML files to create for each ruleset level. */ - private String level1; + private Map rulesetFiles; /** - * The name of the level 2 ruleset file. + * Template for Checkstyle XML files. */ - private String level2; - - /** - * The name of the level 3 ruleset file. - */ - private String level3; - - /** - * The name of the level 4 ruleset file. - */ - private String level4; - - /** - * The name of the level 5 ruleset file. - */ - private String level5; + private Path checkstyleXmlTemplate; } diff --git a/builder/src/main/resources/application.yml b/builder/src/main/resources/application.yml index 999da34..051261c 100644 --- a/builder/src/main/resources/application.yml +++ b/builder/src/main/resources/application.yml @@ -1,10 +1,12 @@ output: - directory: src/main/resources/net/kemitix - level1: checkstyle-1-layout.xml - level2: checkstyle-2-naming.xml - level3: checkstyle-3-javadoc.xml - level4: checkstyle-4-tweaks.xml - level5: checkstyle-5-complexity.xml + directory: ruleset/src/main/resources/net/kemitix + ruleset-files: + LAYOUT: checkstyle-1-layout.xml + NAMING: checkstyle-2-naming.xml + 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 rules: - name: AbbreviationAsWordInName