From af25b2f5073dd22dc99cf7d0901ea0920dac27c3 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sat, 1 Feb 2025 12:47:55 -0800 Subject: [PATCH 01/16] BREAKING: reworked excludes methods and added addExcludes methods --- .../java/rife/bld/extension/PmdOperation.java | 140 +++++++++++++++++- .../rife/bld/extension/PmdOperationTest.java | 113 +++++++++++--- 2 files changed, 226 insertions(+), 27 deletions(-) diff --git a/src/main/java/rife/bld/extension/PmdOperation.java b/src/main/java/rife/bld/extension/PmdOperation.java index aa0a61d..25b25c6 100644 --- a/src/main/java/rife/bld/extension/PmdOperation.java +++ b/src/main/java/rife/bld/extension/PmdOperation.java @@ -52,7 +52,7 @@ public class PmdOperation extends AbstractOperation { /** * The list of paths to exclude. */ - private final List excludes_ = new ArrayList<>(); + private final Collection excludes_ = new ArrayList<>(); /** * The input paths (source) list. */ @@ -142,6 +142,79 @@ public class PmdOperation extends AbstractOperation { */ private int threads_ = 1; + /** + * Adds paths to exclude from the analysis. + * + * @param excludes one or more paths to exclude + * @return this operation + * @see #excludes(Path...) + * @since 1.2.0 + */ + public PmdOperation addExcludes(Path... excludes) { + return addExcludes(List.of(excludes)); + } + + /** + * Adds paths to exclude from the analysis. + * + * @param excludes paths to exclude + * @return this operation + * @see #excludes(Collection) + * @since 1.2.0 + */ + public PmdOperation addExcludes(Collection excludes) { + excludes_.addAll(excludes); + return this; + } + + /** + * Adds paths to exclude from the analysis. + * + * @param excludes one or more paths to exclude + * @return this operation + * @see #excludesFiles(Collection) + * @since 1.2.0 + */ + public PmdOperation addExcludesFiles(Collection excludes) { + return addExcludes(excludes.stream().map(File::toPath).toList()); + } + + /** + * Adds paths to exclude from the analysis. + * + * @param excludes one or more paths to exclude + * @return this operation + * @see #excludesFiles(File...) + * @since 1.2.0 + */ + public PmdOperation addExcludesFiles(File... excludes) { + return addExcludesFiles(List.of(excludes)); + } + + /** + * Adds paths to exclude from the analysis. + * + * @param excludes one or more paths to exclude + * @return this operation + * @see #excludesStrings(Collection) + * @since 1.2.0 + */ + public PmdOperation addExcludesStrings(Collection excludes) { + return addExcludes(excludes.stream().map(Paths::get).toList()); + } + + /** + * Adds paths to exclude from the analysis. + * + * @param excludes one or more paths to exclude + * @return this operation + * @see #excludesStrings(String...) + * @since 1.2.0 + */ + public PmdOperation addExcludesStrings(String... excludes) { + return addExcludesStrings(List.of(excludes)); + } + /** * Adds paths to source files, or directories containing source files to analyze.\ * @@ -322,23 +395,26 @@ public class PmdOperation extends AbstractOperation { } /** - * Adds paths to exclude from the analysis. + * Sets paths to exclude from the analysis. * * @param excludes one or more paths to exclude * @return this operation + * @see #addExcludes(Path...) */ public PmdOperation excludes(Path... excludes) { - excludes_.addAll(List.of(excludes)); + excludes(List.of(excludes)); return this; } /** - * Adds paths to exclude from the analysis. + * Sets paths to exclude from the analysis. * * @param excludes paths to exclude * @return this operation + * @see #addExcludes(Collection) */ public PmdOperation excludes(Collection excludes) { + excludes_.clear(); excludes_.addAll(excludes); return this; } @@ -348,10 +424,60 @@ public class PmdOperation extends AbstractOperation { * * @return the exclude paths */ - public List excludes() { + public Collection excludes() { return excludes_; } + /** + * Sets paths to exclude from the analysis. + * + * @param excludes one or more paths to exclude + * @return this operation + * @see #excludesFiles(Collection) + * @since 1.2.0 + */ + public PmdOperation excludesFiles(Collection excludes) { + excludes(excludes.stream().map(File::toPath).toList()); + return this; + } + + /** + * Sets paths to exclude from the analysis. + * + * @param excludes one or more paths to exclude + * @return this operation + * @see #excludesFiles(File...) + * @since 1.2.0 + */ + public PmdOperation excludesFiles(File... excludes) { + return excludesFiles(List.of(excludes)); + } + + /** + * Sets paths to exclude from the analysis. + * + * @param excludes one or more paths to exclude + * @return this operation + * @see #excludesStrings(Collection) + * @since 1.2.0 + */ + public PmdOperation excludesStrings(Collection excludes) { + excludes(excludes.stream().map(Paths::get).toList()); + return this; + } + + /** + * Sets paths to exclude from the analysis. + * + * @param excludes one or more paths to exclude + * @return this operation + * @see #excludesStrings(String...) + * @since 1.2.0 + */ + public PmdOperation excludesStrings(String... excludes) { + return excludesStrings(List.of(excludes)); + } + /** * Performs the PMD code analysis operation. */ @@ -519,7 +645,7 @@ public class PmdOperation extends AbstractOperation { // setExcludes if (!excludes_.isEmpty()) { - config.setExcludes(excludes_); + config.setExcludes(excludes_.stream().toList()); } // setFailOnError @@ -656,7 +782,7 @@ public class PmdOperation extends AbstractOperation { * * @param inputPath a collection of input paths * @return this operation - * @see #addInputPathsFiles(Collection) ) + * @see #addInputPathsFiles(Collection) */ public PmdOperation inputPathsFiles(Collection inputPath) { return inputPaths(inputPath.stream().map(File::toPath).toList()); diff --git a/src/test/java/rife/bld/extension/PmdOperationTest.java b/src/test/java/rife/bld/extension/PmdOperationTest.java index 48545e5..77321d6 100644 --- a/src/test/java/rife/bld/extension/PmdOperationTest.java +++ b/src/test/java/rife/bld/extension/PmdOperationTest.java @@ -47,6 +47,7 @@ import static org.assertj.core.api.Assertions.assertThatCode; * @since 1.0 */ class PmdOperationTest { + static final String BAR = "bar"; static final String CATEGORY_FOO = "category/foo.xml"; static final Path CODE_STYLE_SAMPLE = Path.of("src/test/resources/java/CodeStyle.java"); static final String CODE_STYLE_XML = "category/java/codestyle.xml"; @@ -55,6 +56,11 @@ class PmdOperationTest { static final String DOCUMENTATION_XML = "category/java/documentation.xml"; static final Path ERROR_PRONE_SAMPLE = Path.of("src/test/resources/java/ErrorProne.java"); static final String ERROR_PRONE_XML = "category/java/errorprone.xml"; + static final File FILE_BAR = new File(BAR); + static final String FOO = "foo"; + static final File FILE_FOO = new File(FOO); + static final Path PATH_BAR = Path.of(BAR); + static final Path PATH_FOO = Path.of(FOO); static final String PERFORMANCE_XML = "category/java/performance.xml"; static final String SECURITY_XML = "category/java/security.xml"; static final String TEST = "test"; @@ -67,6 +73,39 @@ class PmdOperationTest { .reportFile(Paths.get("build", COMMAND_NAME, "pmd-test-report.txt")); } + @Test + void testAddExcludes() { + var pmd = newPmdOperation().ruleSets(CATEGORY_FOO).addExcludes(PATH_FOO); + var config = pmd.initConfiguration(COMMAND_NAME); + assertThat(config.getExcludes()).containsExactly(PATH_FOO); + + pmd = pmd.addExcludes(PATH_BAR); + config = pmd.initConfiguration(COMMAND_NAME); + assertThat(config.getExcludes()).containsExactly(PATH_FOO, PATH_BAR); + } + + @Test + void testAddExcludesFiles() { + var pmd = newPmdOperation().ruleSets(CATEGORY_FOO).addExcludesFiles(FILE_FOO); + var config = pmd.initConfiguration(COMMAND_NAME); + assertThat(config.getExcludes()).containsExactly(FILE_FOO.toPath()); + + pmd = pmd.addExcludesFiles(FILE_BAR); + config = pmd.initConfiguration(COMMAND_NAME); + assertThat(config.getExcludes()).containsExactly(FILE_FOO.toPath(), FILE_BAR.toPath()); + } + + @Test + void testAddExcludesStrings() { + var pmd = newPmdOperation().ruleSets(CATEGORY_FOO).addExcludesStrings(FOO); + var config = pmd.initConfiguration(COMMAND_NAME); + assertThat(config.getExcludes()).containsExactly(PATH_FOO); + + pmd = pmd.addExcludesStrings(BAR); + config = pmd.initConfiguration(COMMAND_NAME); + assertThat(config.getExcludes()).containsExactly(PATH_FOO, PATH_BAR); + } + @Test void testAddInputPaths() throws ExitStatusException { var project = new BaseProject(); @@ -168,20 +207,55 @@ class PmdOperationTest { @Test void testExcludes() { - var foo = Path.of("foo/bar"); - var bar = Path.of("bar/foo"); var foz = Path.of("foz/baz"); var baz = Path.of("baz/foz"); - var excludes = List.of(foo, bar); - var pmd = newPmdOperation().ruleSets(CATEGORY_FOO).excludes(excludes); + var pmd = newPmdOperation().ruleSets(CATEGORY_FOO).excludes(PATH_FOO, PATH_BAR); var config = pmd.initConfiguration(COMMAND_NAME); - assertThat(config.getExcludes()).containsExactly(excludes.toArray(new Path[0])); + assertThat(pmd.excludes()).containsExactly(List.of(PATH_FOO, PATH_BAR).toArray(new Path[0])); + assertThat(config.getExcludes()).containsExactly(List.of(PATH_FOO, PATH_BAR).toArray(new Path[0])); - pmd = pmd.excludes(baz, foz); - assertThat(pmd.excludes()).hasSize(4); - config = pmd.initConfiguration(COMMAND_NAME); - assertThat(config.getExcludes()).hasSize(4).contains(bar, foz); + var excludes = List.of(List.of(PATH_FOO, PATH_BAR), List.of(foz, baz)); + for (var exclude : excludes) { + pmd = newPmdOperation().ruleSets(CATEGORY_FOO).excludes(exclude); + config = pmd.initConfiguration(COMMAND_NAME); + assertThat(config.getExcludes()).containsExactly(exclude.toArray(new Path[0])); + } + } + + @Test + void testExcludesFiles() { + var foz = new File("foz"); + var baz = new File("baz"); + + var pmd = newPmdOperation().ruleSets(CATEGORY_FOO).excludesFiles(FILE_FOO, FILE_BAR); + var config = pmd.initConfiguration(COMMAND_NAME); + assertThat(config.getExcludes()).containsExactly(FILE_FOO.toPath(), FILE_BAR.toPath()); + + var excludes = List.of(List.of(FILE_FOO, FILE_BAR), List.of(foz, baz)); + for (var exclude : excludes) { + pmd = newPmdOperation().ruleSets(CATEGORY_FOO).excludesFiles(exclude); + config = pmd.initConfiguration(COMMAND_NAME); + assertThat(config.getExcludes()).containsExactly(exclude.stream().map(File::toPath).toArray(Path[]::new)); + } + } + + @Test + void testExcludesStrings() { + var foz = "foz"; + var baz = "baz"; + + var pmd = newPmdOperation().ruleSets(CATEGORY_FOO).excludesStrings(FOO, BAR); + var config = pmd.initConfiguration(COMMAND_NAME); + assertThat(pmd.excludes()).containsExactly(PATH_FOO, PATH_BAR); + assertThat(config.getExcludes()).containsExactly(PATH_FOO, PATH_BAR); + + var excludes = List.of(List.of(FOO, BAR), List.of(foz, baz)); + for (var exclude : excludes) { + pmd = newPmdOperation().ruleSets(CATEGORY_FOO).excludesStrings(exclude); + config = pmd.initConfiguration(COMMAND_NAME); + assertThat(config.getExcludes()).containsExactly(exclude.stream().map(Paths::get).toArray(Path[]::new)); + } } @Test @@ -388,8 +462,8 @@ class PmdOperationTest { @Test void testPrependAuxClasspath() { - var pmd = newPmdOperation().ruleSets(CATEGORY_FOO).prependAuxClasspath("foo", "bar"); - assertThat(pmd.prependAuxClasspath()).isEqualTo("foo" + File.pathSeparator + "bar"); + var pmd = newPmdOperation().ruleSets(CATEGORY_FOO).prependAuxClasspath(FOO, BAR); + assertThat(pmd.prependAuxClasspath()).isEqualTo(FOO + File.pathSeparator + BAR); } @Test @@ -400,27 +474,26 @@ class PmdOperationTest { @Test void testRelativizeRoots() { - var foo = Path.of("foo/bar"); - var bar = Path.of("bar/foo"); var baz = Path.of("baz/foz"); - var pmd = newPmdOperation().ruleSets(List.of(CATEGORY_FOO)).relativizeRoots(foo).relativizeRoots(bar.toFile()) - .relativizeRoots(baz.toString()).relativizeRoots(List.of(foo, bar, baz)); + var pmd = newPmdOperation().ruleSets(List.of(CATEGORY_FOO)).relativizeRoots(PATH_FOO). + relativizeRoots(PATH_BAR.toFile()).relativizeRoots(baz.toString()) + .relativizeRoots(List.of(PATH_FOO, PATH_BAR, baz)); var config = pmd.initConfiguration(COMMAND_NAME); assertThat(config.getRelativizeRoots()).isEqualTo(pmd.relativizeRoots()) - .containsExactly(foo, bar, baz, foo, bar, baz); + .containsExactly(PATH_FOO, PATH_BAR, baz, PATH_FOO, PATH_BAR, baz); pmd = newPmdOperation().ruleSets(List.of(CATEGORY_FOO)) - .relativizeRootsFiles(List.of(foo.toFile(), bar.toFile(), baz.toFile())); + .relativizeRootsFiles(List.of(PATH_FOO.toFile(), PATH_BAR.toFile(), baz.toFile())); config = pmd.initConfiguration(COMMAND_NAME); assertThat(config.getRelativizeRoots()).as("List(File...)").isEqualTo(pmd.relativizeRoots()) - .containsExactly(foo, bar, baz); + .containsExactly(PATH_FOO, PATH_BAR, baz); pmd = newPmdOperation().ruleSets(List.of(CATEGORY_FOO)) - .relativizeRootsStrings(List.of(foo.toString(), bar.toString(), baz.toString())); + .relativizeRootsStrings(List.of(PATH_FOO.toString(), PATH_BAR.toString(), baz.toString())); config = pmd.initConfiguration(COMMAND_NAME); assertThat(config.getRelativizeRoots()).as("List(String....)").isEqualTo(pmd.relativizeRoots()) - .containsExactly(foo, bar, baz); + .containsExactly(PATH_FOO, PATH_BAR, baz); } @Test From dca8baf3adc84b3e097f7e678129425ba7316380 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sat, 1 Feb 2025 12:56:22 -0800 Subject: [PATCH 02/16] Version 1.2.0 --- src/bld/java/rife/bld/extension/PmdOperationBuild.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bld/java/rife/bld/extension/PmdOperationBuild.java b/src/bld/java/rife/bld/extension/PmdOperationBuild.java index 616d5d5..f1f3f3c 100644 --- a/src/bld/java/rife/bld/extension/PmdOperationBuild.java +++ b/src/bld/java/rife/bld/extension/PmdOperationBuild.java @@ -31,7 +31,7 @@ public class PmdOperationBuild extends Project { public PmdOperationBuild() { pkg = "rife.bld.extension"; name = "bld-pmd"; - version = version(1, 1, 11); + version = version(1, 2, 0); javaRelease = 17; From a2d37055c6f3b6321dd6b41cf4705df7d0a09524 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Mon, 24 Feb 2025 23:24:32 -0800 Subject: [PATCH 03/16] Bump JUnit to version 5.12.0 --- src/bld/java/rife/bld/extension/PmdOperationBuild.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bld/java/rife/bld/extension/PmdOperationBuild.java b/src/bld/java/rife/bld/extension/PmdOperationBuild.java index f1f3f3c..d5d6186 100644 --- a/src/bld/java/rife/bld/extension/PmdOperationBuild.java +++ b/src/bld/java/rife/bld/extension/PmdOperationBuild.java @@ -47,8 +47,8 @@ public class PmdOperationBuild extends Project { scope(runtime) .include(dependency("org.slf4j", "slf4j-simple", version(2, 0, 16))); scope(test) - .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 11, 4))) - .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 11, 4))) + .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 12, 0))) + .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 12, 0))) .include(dependency("org.assertj", "assertj-core", version(3, 27, 3))); javadocOperation() From e28496ca161d8c965613a58ca6f38cfabb8af826 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Mon, 24 Feb 2025 23:24:45 -0800 Subject: [PATCH 04/16] Bump bld to version 2.2.1 --- .idea/libraries/bld.xml | 4 ++-- .vscode/settings.json | 2 +- README.md | 2 +- lib/bld/bld-wrapper.jar | Bin 30440 -> 30440 bytes lib/bld/bld-wrapper.properties | 2 +- .../rife/bld/extension/PmdOperationBuild.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.idea/libraries/bld.xml b/.idea/libraries/bld.xml index 553c281..153a060 100644 --- a/.idea/libraries/bld.xml +++ b/.idea/libraries/bld.xml @@ -2,12 +2,12 @@ - + - + diff --git a/.vscode/settings.json b/.vscode/settings.json index a3f4fd0..ba429d0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,7 +9,7 @@ ], "java.configuration.updateBuildConfiguration": "automatic", "java.project.referencedLibraries": [ - "${HOME}/.bld/dist/bld-2.2.0.jar", + "${HOME}/.bld/dist/bld-2.2.1.jar", "lib/**/*.jar" ] } diff --git a/README.md b/README.md index 0bdcd9e..8c5f2ed 100755 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Java](https://img.shields.io/badge/java-17%2B-blue)](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) -[![bld](https://img.shields.io/badge/2.2.0-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld) +[![bld](https://img.shields.io/badge/2.2.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld) [![Release](https://flat.badgen.net/maven/v/metadata-url/repo.rife2.com/releases/com/uwyn/rife2/bld-pmd/maven-metadata.xml?color=blue)](https://repo.rife2.com/#/releases/com/uwyn/rife2/bld-pmd) [![Snapshot](https://flat.badgen.net/maven/v/metadata-url/repo.rife2.com/snapshots/com/uwyn/rife2/bld-pmd/maven-metadata.xml?label=snapshot)](https://repo.rife2.com/#/snapshots/com/uwyn/rife2/bld-pmd) [![GitHub CI](https://github.com/rife2/bld-pmd/actions/workflows/bld.yml/badge.svg)](https://github.com/rife2/bld-pmd/actions/workflows/bld.yml) diff --git a/lib/bld/bld-wrapper.jar b/lib/bld/bld-wrapper.jar index ed94afd16519c4e36ee7021c1d0bf621cbef8bb2..58e97611fd7803dded57c1ef01a3cab0625855d3 100644 GIT binary patch delta 187 zcmaFymhr_~M&1B#W)=|!4h{|m_016zdFz;g)W$wj8xTFY*Isk;dz;xzAkOAq`)&wB z+KF8cETUR)o)OIWUT6rGnyg)-sK~+);LXk<_eVm3oq>UY6^H}88JR>F;I>T8EpY}L ozq!N{O#d$l0n=fn5PEH?E13VaG!7zO=Fb6iK@`Z$$!p830egZxApigX delta 187 zcmaFymhr_~M&1B#W)=|!4h{~6zZ115^42i}sf~T6HXwR(uf68x_cpVcK%C9J_T3PM zv=h4?SVXnpJR_L#z0eRWHCekvQIUZmz?+?;A60|21SMSTDO diff --git a/lib/bld/bld-wrapper.properties b/lib/bld/bld-wrapper.properties index b2bcd09..4745e94 100644 --- a/lib/bld/bld-wrapper.properties +++ b/lib/bld/bld-wrapper.properties @@ -2,4 +2,4 @@ bld.downloadExtensionJavadoc=false bld.downloadExtensionSources=true bld.downloadLocation= bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES -bld.version=2.2.0 +bld.version=2.2.1 diff --git a/src/bld/java/rife/bld/extension/PmdOperationBuild.java b/src/bld/java/rife/bld/extension/PmdOperationBuild.java index d5d6186..a09e641 100644 --- a/src/bld/java/rife/bld/extension/PmdOperationBuild.java +++ b/src/bld/java/rife/bld/extension/PmdOperationBuild.java @@ -42,7 +42,7 @@ public class PmdOperationBuild extends Project { var pmd = version(7, 10, 0); scope(compile) - .include(dependency("com.uwyn.rife2", "bld", version(2, 2, 0))) + .include(dependency("com.uwyn.rife2", "bld", version(2, 2, 1))) .include(dependency("net.sourceforge.pmd", "pmd-java", pmd)); scope(runtime) .include(dependency("org.slf4j", "slf4j-simple", version(2, 0, 16))); From fb0acda205aa948d0d42954ac0e76cf5b48afd4c Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Tue, 25 Feb 2025 11:26:15 -0800 Subject: [PATCH 05/16] Bump SLF4J to version 2.0.17 --- src/bld/java/rife/bld/extension/PmdOperationBuild.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bld/java/rife/bld/extension/PmdOperationBuild.java b/src/bld/java/rife/bld/extension/PmdOperationBuild.java index a09e641..6c0152a 100644 --- a/src/bld/java/rife/bld/extension/PmdOperationBuild.java +++ b/src/bld/java/rife/bld/extension/PmdOperationBuild.java @@ -45,7 +45,7 @@ public class PmdOperationBuild extends Project { .include(dependency("com.uwyn.rife2", "bld", version(2, 2, 1))) .include(dependency("net.sourceforge.pmd", "pmd-java", pmd)); scope(runtime) - .include(dependency("org.slf4j", "slf4j-simple", version(2, 0, 16))); + .include(dependency("org.slf4j", "slf4j-simple", version(2, 0, 17))); scope(test) .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 12, 0))) .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 12, 0))) From cfbeeeb5c7ac5bb183a3d26f966857076f6c5a50 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Fri, 28 Feb 2025 11:04:50 -0800 Subject: [PATCH 06/16] Bump PMD to version 7.11.0 --- src/bld/java/rife/bld/extension/PmdOperationBuild.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bld/java/rife/bld/extension/PmdOperationBuild.java b/src/bld/java/rife/bld/extension/PmdOperationBuild.java index 6c0152a..cfcb385 100644 --- a/src/bld/java/rife/bld/extension/PmdOperationBuild.java +++ b/src/bld/java/rife/bld/extension/PmdOperationBuild.java @@ -40,7 +40,7 @@ public class PmdOperationBuild extends Project { repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, RIFE2_RELEASES, RIFE2_SNAPSHOTS); - var pmd = version(7, 10, 0); + var pmd = version(7, 11, 0); scope(compile) .include(dependency("com.uwyn.rife2", "bld", version(2, 2, 1))) .include(dependency("net.sourceforge.pmd", "pmd-java", pmd)); From 67ce6546fe0c5dfb1e4f8c5b51c40e63078cefee Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Fri, 28 Feb 2025 11:08:20 -0800 Subject: [PATCH 07/16] Version 1.2.1 --- src/bld/java/rife/bld/extension/PmdOperationBuild.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bld/java/rife/bld/extension/PmdOperationBuild.java b/src/bld/java/rife/bld/extension/PmdOperationBuild.java index cfcb385..34a3232 100644 --- a/src/bld/java/rife/bld/extension/PmdOperationBuild.java +++ b/src/bld/java/rife/bld/extension/PmdOperationBuild.java @@ -31,7 +31,7 @@ public class PmdOperationBuild extends Project { public PmdOperationBuild() { pkg = "rife.bld.extension"; name = "bld-pmd"; - version = version(1, 2, 0); + version = version(1, 2, 1); javaRelease = 17; From 91c9556bd95e939d6f9ec5d58aa788954d375222 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Tue, 18 Mar 2025 12:29:21 -0700 Subject: [PATCH 08/16] Add generic installation instruction --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8c5f2ed..dbf968f 100755 --- a/README.md +++ b/README.md @@ -7,9 +7,17 @@ [![Snapshot](https://flat.badgen.net/maven/v/metadata-url/repo.rife2.com/snapshots/com/uwyn/rife2/bld-pmd/maven-metadata.xml?label=snapshot)](https://repo.rife2.com/#/snapshots/com/uwyn/rife2/bld-pmd) [![GitHub CI](https://github.com/rife2/bld-pmd/actions/workflows/bld.yml/badge.svg)](https://github.com/rife2/bld-pmd/actions/workflows/bld.yml) -To install, please refer to the [extensions documentation](https://github.com/rife2/bld/wiki/Extensions). +To install the latest version, add the following to the `lib/bld/bld-wrapper.properties` file: -To check all source code using the [Java Quickstart](https://docs.pmd-code.org/latest/pmd_rules_java.html) configuration, add the following to your build file: +```properties +bld.extension-pmd=com.uwyn.rife2:bld-pmd +``` + +For more information, please refer to the [extensions](https://github.com/rife2/bld/wiki/Extensions) documentation. + +## Check Source with PMD + +To check all source Codecode using the [Java Quickstart](https://docs.pmd-code.org/latest/pmd_rules_java.html) configuration, add the following to your build file: ```java @BuildCommand(summary = "Checks source code with PMD") From 4feba23b90c7062a61cde4c203e0aa84f3ec2e62 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Tue, 18 Mar 2025 23:39:47 -0700 Subject: [PATCH 09/16] Bump JUnit to version 5.12.1 --- src/bld/java/rife/bld/extension/PmdOperationBuild.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bld/java/rife/bld/extension/PmdOperationBuild.java b/src/bld/java/rife/bld/extension/PmdOperationBuild.java index 34a3232..87e92f6 100644 --- a/src/bld/java/rife/bld/extension/PmdOperationBuild.java +++ b/src/bld/java/rife/bld/extension/PmdOperationBuild.java @@ -31,7 +31,7 @@ public class PmdOperationBuild extends Project { public PmdOperationBuild() { pkg = "rife.bld.extension"; name = "bld-pmd"; - version = version(1, 2, 1); + version = version(1, 2, 2, "SNAPSHOT"); javaRelease = 17; @@ -47,8 +47,8 @@ public class PmdOperationBuild extends Project { scope(runtime) .include(dependency("org.slf4j", "slf4j-simple", version(2, 0, 17))); scope(test) - .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 12, 0))) - .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 12, 0))) + .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 12, 1))) + .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 12, 1))) .include(dependency("org.assertj", "assertj-core", version(3, 27, 3))); javadocOperation() From 355cdf770a73b572f27d67f02776be9fd9c27a5f Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Tue, 18 Mar 2025 23:39:56 -0700 Subject: [PATCH 10/16] JDK 24 --- .github/workflows/bld.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bld.yml b/.github/workflows/bld.yml index f7e10f8..138f5e5 100644 --- a/.github/workflows/bld.yml +++ b/.github/workflows/bld.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - java-version: [17, 21, 23] + java-version: [17, 21, 24] steps: - name: Checkout source repository From d304b931f9c5a8a598f5e255d43b25a19bb202f1 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Tue, 25 Mar 2025 12:28:54 -0700 Subject: [PATCH 11/16] Add OS matrix for Ubuntu, Windows and macOS --- .github/workflows/bld.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bld.yml b/.github/workflows/bld.yml index 138f5e5..947f3c4 100644 --- a/.github/workflows/bld.yml +++ b/.github/workflows/bld.yml @@ -1,14 +1,16 @@ name: bld-ci -on: [push, pull_request, workflow_dispatch] +on: [ push, pull_request, workflow_dispatch ] jobs: build-bld-project: - runs-on: ubuntu-latest - strategy: matrix: - java-version: [17, 21, 24] + java-version: [ 17, 21, 24 ] + kotlin-version: [ 1.9.25, 2.0.21, 2.1.20 ] + os: [ ubuntu-latest, windows-latest, macos-latest ] + + runs-on: ${{ matrix.os }} steps: - name: Checkout source repository @@ -26,4 +28,4 @@ jobs: run: ./bld download - name: Run tests - run: ./bld compile test + run: ./bld compile test \ No newline at end of file From 7ae16506774602505c5c8f792e0048b7bf183c12 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Fri, 28 Mar 2025 05:05:57 -0700 Subject: [PATCH 12/16] Bump PMD from 7.11.0 to 7.12.0 --- src/bld/java/rife/bld/extension/PmdOperationBuild.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bld/java/rife/bld/extension/PmdOperationBuild.java b/src/bld/java/rife/bld/extension/PmdOperationBuild.java index 87e92f6..6f2d8a9 100644 --- a/src/bld/java/rife/bld/extension/PmdOperationBuild.java +++ b/src/bld/java/rife/bld/extension/PmdOperationBuild.java @@ -40,7 +40,7 @@ public class PmdOperationBuild extends Project { repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, RIFE2_RELEASES, RIFE2_SNAPSHOTS); - var pmd = version(7, 11, 0); + var pmd = version(7, 12, 0); scope(compile) .include(dependency("com.uwyn.rife2", "bld", version(2, 2, 1))) .include(dependency("net.sourceforge.pmd", "pmd-java", pmd)); From a15218eb1db7ecdcb011eefdc05dcf626ffa6cc5 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Fri, 28 Mar 2025 05:14:21 -0700 Subject: [PATCH 13/16] Version 1.2.2 --- src/bld/java/rife/bld/extension/PmdOperationBuild.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bld/java/rife/bld/extension/PmdOperationBuild.java b/src/bld/java/rife/bld/extension/PmdOperationBuild.java index 6f2d8a9..608abbf 100644 --- a/src/bld/java/rife/bld/extension/PmdOperationBuild.java +++ b/src/bld/java/rife/bld/extension/PmdOperationBuild.java @@ -31,7 +31,7 @@ public class PmdOperationBuild extends Project { public PmdOperationBuild() { pkg = "rife.bld.extension"; name = "bld-pmd"; - version = version(1, 2, 2, "SNAPSHOT"); + version = version(1, 2, 2); javaRelease = 17; From 9e8f6c049772118a8303f14d5a1b0000b0bb4e37 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sat, 12 Apr 2025 20:58:01 -0700 Subject: [PATCH 14/16] Bump JUnit to version 5.12.2 --- src/bld/java/rife/bld/extension/PmdOperationBuild.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bld/java/rife/bld/extension/PmdOperationBuild.java b/src/bld/java/rife/bld/extension/PmdOperationBuild.java index 608abbf..00f5097 100644 --- a/src/bld/java/rife/bld/extension/PmdOperationBuild.java +++ b/src/bld/java/rife/bld/extension/PmdOperationBuild.java @@ -47,8 +47,8 @@ public class PmdOperationBuild extends Project { scope(runtime) .include(dependency("org.slf4j", "slf4j-simple", version(2, 0, 17))); scope(test) - .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 12, 1))) - .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 12, 1))) + .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 12, 2))) + .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 12, 2))) .include(dependency("org.assertj", "assertj-core", version(3, 27, 3))); javadocOperation() From 86ea747ba2e57d3c4de567857eb42ad5cd2912e2 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Fri, 25 Apr 2025 08:02:04 -0700 Subject: [PATCH 15/16] Bump PMD to version 7.13.0 --- src/bld/java/rife/bld/extension/PmdOperationBuild.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bld/java/rife/bld/extension/PmdOperationBuild.java b/src/bld/java/rife/bld/extension/PmdOperationBuild.java index 00f5097..867cd32 100644 --- a/src/bld/java/rife/bld/extension/PmdOperationBuild.java +++ b/src/bld/java/rife/bld/extension/PmdOperationBuild.java @@ -40,7 +40,7 @@ public class PmdOperationBuild extends Project { repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, RIFE2_RELEASES, RIFE2_SNAPSHOTS); - var pmd = version(7, 12, 0); + var pmd = version(7, 13, 0); scope(compile) .include(dependency("com.uwyn.rife2", "bld", version(2, 2, 1))) .include(dependency("net.sourceforge.pmd", "pmd-java", pmd)); From 9ea433edce81d9bc653dbebf163cdca6ed931bb5 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Fri, 25 Apr 2025 08:06:30 -0700 Subject: [PATCH 16/16] Version 1.2.3 --- src/bld/java/rife/bld/extension/PmdOperationBuild.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bld/java/rife/bld/extension/PmdOperationBuild.java b/src/bld/java/rife/bld/extension/PmdOperationBuild.java index 867cd32..cbaa6ba 100644 --- a/src/bld/java/rife/bld/extension/PmdOperationBuild.java +++ b/src/bld/java/rife/bld/extension/PmdOperationBuild.java @@ -31,7 +31,7 @@ public class PmdOperationBuild extends Project { public PmdOperationBuild() { pkg = "rife.bld.extension"; name = "bld-pmd"; - version = version(1, 2, 2); + version = version(1, 2, 3); javaRelease = 17;