diff --git a/.idea/libraries/bld.xml b/.idea/libraries/bld.xml index 7aa10eb..3409629 100644 --- a/.idea/libraries/bld.xml +++ b/.idea/libraries/bld.xml @@ -2,11 +2,11 @@ - + - + diff --git a/.vscode/settings.json b/.vscode/settings.json index ba59365..122fc60 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,7 +7,7 @@ ], "java.configuration.updateBuildConfiguration": "automatic", "java.project.referencedLibraries": [ - "${HOME}/.rife2/dist/rife2-1.5.19.jar", + "${HOME}/.rife2/dist/rife2-1.5.20.jar", "lib/compile/*.jar", "lib/runtime/*.jar", "lib/test/*.jar" diff --git a/README.md b/README.md index d4ef9b9..9e985d2 100755 --- a/README.md +++ b/README.md @@ -10,7 +10,9 @@ To check all source code using the [java quickstart rule](https://pmd.github.io/ ```java @BuildCommand public void pmd() throws Exception { - new PmdOperation(this).execute(); + new PmdOperation + .fromProject(this) + .execute(); } ``` ```text @@ -22,7 +24,8 @@ To check the main source code using a custom rule, [java error prone rule](https ```java @BuildCommand public void pmdMain() throws Exception { - new PmdOperation(this) + new PmdOperation + .fromProject(this) .failOnValidation(true) .addInputPath(project.srcMainDirectory().toPath()) .addRuletSet("config/pmd.xml", "category/java/errorprone.xml"); diff --git a/lib/bld/bld-wrapper.jar b/lib/bld/bld-wrapper.jar index 48e3283..2c3f5a5 100644 Binary files a/lib/bld/bld-wrapper.jar and b/lib/bld/bld-wrapper.jar differ diff --git a/lib/bld/bld-wrapper.properties b/lib/bld/bld-wrapper.properties index ab612ce..711e55e 100644 --- a/lib/bld/bld-wrapper.properties +++ b/lib/bld/bld-wrapper.properties @@ -3,4 +3,4 @@ bld.downloadExtensionSources=true bld.extensions= bld.repositories=MAVEN_CENTRAL,RIFE2 rife2.downloadLocation= -rife2.version=1.5.19 +rife2.version=1.5.20 diff --git a/src/bld/java/rife/bld/extension/PmdOperationBuild.java b/src/bld/java/rife/bld/extension/PmdOperationBuild.java index aeb1157..546555f 100644 --- a/src/bld/java/rife/bld/extension/PmdOperationBuild.java +++ b/src/bld/java/rife/bld/extension/PmdOperationBuild.java @@ -18,7 +18,7 @@ public class PmdOperationBuild extends Project { downloadSources = true; repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES); scope(compile) - .include(dependency("com.uwyn.rife2", "rife2", version(1, 5, 19))) + .include(dependency("com.uwyn.rife2", "rife2", version(1, 5, 20))) .include(dependency("net.sourceforge.pmd:pmd-java:6.55.0")); scope(runtime) .include(dependency("net.sourceforge.pmd:pmd:6.55.0")); diff --git a/src/main/java/rife/bld/extension/PmdOperation.java b/src/main/java/rife/bld/extension/PmdOperation.java index 2125be1..1ef78b2 100644 --- a/src/main/java/rife/bld/extension/PmdOperation.java +++ b/src/main/java/rife/bld/extension/PmdOperation.java @@ -20,7 +20,7 @@ import net.sourceforge.pmd.PMDConfiguration; import net.sourceforge.pmd.PmdAnalysis; import net.sourceforge.pmd.RulePriority; import net.sourceforge.pmd.lang.LanguageVersion; -import rife.bld.Project; +import rife.bld.BaseProject; import rife.bld.operations.AbstractOperation; import java.net.URI; @@ -122,26 +122,11 @@ public class PmdOperation extends AbstractOperation { /** * The project reference. */ - private Project project; + private BaseProject project; /** - * Creates a new operation. - *

- * The defaults are: - *

    - *
  • encoding={@code UTF-9}
  • - *
  • incrementAnalysis={@code true}
  • - *
  • reportFormat={@code text}
  • - *
  • rulePriority={@code LOW}
  • - *
  • suppressedMarker={@code NOPMD}
  • - *
- */ - public PmdOperation() { - super(); - } - - /** - * Creates a new operation. + * Configures a PMD operation from a {@link BaseProject}. + * *

* The defaults are: *

    @@ -156,13 +141,13 @@ public class PmdOperation extends AbstractOperation { *
  • suppressedMarker={@code NOPMD}
  • *
*/ - public PmdOperation(Project project) { - super(); + public PmdOperation fromProject(BaseProject project) { this.project = project; inputPaths.add(project.srcMainDirectory().toPath()); inputPaths.add(project.srcTestDirectory().toPath()); ruleSets.add(RULE_SET_DEFAULT); + return this; } /** @@ -225,7 +210,7 @@ public class PmdOperation extends AbstractOperation { } /** - * Set the default language to be used for all input files. + * Sets the default language to be used for all input files. */ public PmdOperation defaultLanguage(LanguageVersion... languageVersion) { this.languageVersions.addAll(List.of(languageVersion)); @@ -471,7 +456,7 @@ public class PmdOperation extends AbstractOperation { } /** - * Set the input URI to process for source code objects. + * Sets the input URI to process for source code objects. */ public PmdOperation uri(URI inputUri) { this.inputUri = inputUri;