- * Set to: {@code rulesets/java/quickstart.xml}
*/
public static final String RULE_SET_DEFAULT = "rulesets/java/quickstart.xml";
private static final Logger LOGGER = Logger.getLogger(PmdOperation.class.getName());
private static final String PMD_DIR = "pmd";
- /**
- * The list of paths to exclude.
- */
- private final Collection
- * The built-in rule set paths are:
- * The valid values are the standard character sets of {@link java.nio.charset.Charset Charset}. Specifies the character set encoding of the source code files. The default is
- * {@link StandardCharsets#UTF_8 UTF-8}. The valid values are the standard character sets of {@link java.nio.charset.Charset Charset}.
- * Default is: {@code true}
- *
- * Note: If only violations are found, see {@link #failOnViolation(boolean) failOnViolation}
- *
- * @param failOnError whether to exit and fail the build if recoverable errors occurred
- * @return this operation
- * @see #failOnViolation(boolean)
- */
- public PmdOperation failOnError(boolean failOnError) {
- failOnError_ = failOnError;
- return this;
- }
-
- /**
- * Sets whether the build will continue on violations.
- *
- * Note: If additionally recoverable errors occurred, see {@link #failOnError(boolean) failOnError}
- *
- * @param failOnViolation whether to exit and fail the build if violations are found
- * @return this operation
+ * Sets whether the build will continue on warnings.
*/
public PmdOperation failOnViolation(boolean failOnViolation) {
- failOnViolation_ = failOnViolation;
+ this.failOnViolation = failOnViolation;
return this;
}
/**
* Forces a language to be used for all input files, irrespective of file names.
- *
- * @param languageVersion the language version
- * @return this operation
*/
- public PmdOperation forceLanguageVersion(LanguageVersion languageVersion) {
- forcedLanguageVersion_ = languageVersion;
+ public PmdOperation forceVersion(LanguageVersion languageVersion) {
+ this.forcedLanguageVersion = languageVersion;
return this;
}
@@ -550,58 +233,21 @@ public class PmdOperation extends AbstractOperation
- * While clicking on the URI works in IntelliJ IDEA, Visual Studio Code, etc.; it might not in terminal emulators.
- *
- * Default: {@code TRUE}
- */
- public PmdOperation includeLineNumber(boolean includeLineNumber) {
- includeLineNumber_ = includeLineNumber;
+ this.ignoreFile = ignoreFile;
return this;
}
@@ -609,290 +255,114 @@ public class PmdOperation extends AbstractOperation
- * Previous entries are disregarded.
- *
- * @param inputPath one or more paths
- * @return this operation
- * @see #addInputPaths(File...)
- */
- public PmdOperation inputPaths(File... inputPath) {
- return inputPathsFiles(List.of(inputPath));
- }
-
- /**
- * Sets paths to source files, or directories containing source files to analyze.
- *
- * Previous entries are disregarded.
- *
- * @param inputPath one or more paths
- * @return this operation
- * @see #addInputPaths(String...)
- */
- public PmdOperation inputPaths(String... inputPath) {
- return inputPathsStrings(List.of(inputPath));
- }
-
- /**
- * Sets paths to source files, or directories containing source files to analyze.
- *
- * Previous entries are disregarded.
- *
- * @param inputPath a collection of input paths
- * @return this operation
- * @see #addInputPaths(Collection)
- */
- public PmdOperation inputPaths(Collection
- * Previous entries are disregarded.
- *
- * @param inputPath a collection of input paths
- * @return this operation
- * @see #addInputPathsFiles(Collection)
- */
- public PmdOperation inputPathsFiles(Collection
- * Previous entries are disregarded.
- *
- * @param inputPath a collection of input paths
- * @return this operation
- * @see #addInputPathsStrings(Collection)
- */
- public PmdOperation inputPathsStrings(Collection
- * If the classpath String looks like a URL to a file (i.e. starts with {@code file://}) the file will be read with
- * each line representing an entry on the classpath.
+ * Sets several paths to shorten paths that are output in the report. Previous relative paths will be disregarded.
*
- * @param classpath one or more classpath
- * @return this operation
- */
- public PmdOperation prependAuxClasspath(String... classpath) {
- prependClasspath_ = String.join(File.pathSeparator, classpath);
- return this;
- }
-
- /**
- * Returns the prepended classpath.
- *
- * @return the classpath
- */
- public String prependAuxClasspath() {
- return prependClasspath_;
- }
-
- /**
- * Adds several paths to shorten paths that are output in the report.
- *
- * @param relativeRoot one or more relative root paths
- * @return this operation
- * @see #relativizeRoots(Collection)
+ * @see #addRelativizeRoot(Path...)
*/
public PmdOperation relativizeRoots(Path... relativeRoot) {
- return relativizeRoots(List.of(relativeRoot));
- }
-
- /**
- * Adds several paths to shorten paths that are output in the report.
- *
- * @param relativeRoot one or more relative root paths
- * @return this operation
- * @see #relativizeRootsFiles(Collection)
- */
- public PmdOperation relativizeRoots(File... relativeRoot) {
- return relativizeRootsFiles(List.of(relativeRoot));
- }
-
- /**
- * Adds several paths to shorten paths that are output in the report.
- *
- * @param relativeRoot one or more relative root paths
- * @return this operation
- * @see #relativizeRootsStrings(Collection)
- */
- public PmdOperation relativizeRoots(String... relativeRoot) {
- return relativizeRootsStrings(List.of(relativeRoot));
- }
-
- /**
- * Adds several paths to shorten paths that are output in the report.
- *
- * @param relativeRoot a collection of relative root paths
- * @return this operation
- * @see #relativizeRoots(Path...)
- */
- public PmdOperation relativizeRoots(Collection
* The built-in rule set paths are:
*
- * The built-in rule set paths are:
- *
- *
- *
- * @param ruleSet a collection of rule set paths
- * @return this operation
- * @see #ruleSets(Collection)
- */
- public PmdOperation addRuleSet(Collection
@@ -1087,90 +413,43 @@ public class PmdOperation extends AbstractOperation
*
- * @param ruleSet one or more rule set
- * @return this operation
* @see #addRuleSet(String...)
*/
public PmdOperation ruleSets(String... ruleSet) {
- return ruleSets(List.of(ruleSet));
- }
-
- /**
- * Sets new rule set paths, disregarding any previous entries.
- *
- *
- *
- * @param ruleSet a collection of rule set paths
- * @return this operation
- * @see #addRuleSet(Collection)
- */
- public PmdOperation ruleSets(Collection