builder:OutputProperties: restructured output file specification

Map the filenames from each of the RuleLevel values.
This commit is contained in:
Paul Campbell 2017-01-05 06:58:52 +00:00
parent ac3f7b28ab
commit f57fcfe3f6
2 changed files with 15 additions and 29 deletions

View file

@ -2,18 +2,17 @@ package net.kemitix.checkstyle.ruleset.builder;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import java.io.File; import java.nio.file.Path;
import java.util.Map;
/** /**
* Properties defining the output files. * Properties defining the output files.
* *
* @author Paul Campbell (pcampbell@kemitix.net) * @author Paul Campbell (pcampbell@kemitix.net)
*/ */
@Slf4j
@Setter @Setter
@Getter @Getter
@Configuration @Configuration
@ -23,30 +22,15 @@ class OutputProperties {
/** /**
* The directory to create the output files in. * 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<RuleLevel, String> rulesetFiles;
/** /**
* The name of the level 2 ruleset file. * Template for Checkstyle XML files.
*/ */
private String level2; private Path checkstyleXmlTemplate;
/**
* 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;
} }

View file

@ -1,10 +1,12 @@
output: output:
directory: src/main/resources/net/kemitix directory: ruleset/src/main/resources/net/kemitix
level1: checkstyle-1-layout.xml ruleset-files:
level2: checkstyle-2-naming.xml LAYOUT: checkstyle-1-layout.xml
level3: checkstyle-3-javadoc.xml NAMING: checkstyle-2-naming.xml
level4: checkstyle-4-tweaks.xml JAVADOC: checkstyle-3-javadoc.xml
level5: checkstyle-5-complexity.xml TWEAKS: checkstyle-4-tweaks.xml
COMPLEXITY: checkstyle-5-complexity.xml
checkstyle-xml-template: builder/src/main/resources/checkstyle-template.xml
rules: rules:
- -
name: AbbreviationAsWordInName name: AbbreviationAsWordInName