From bbc0a92d23ea944421c698604aa94723f76e7d6b Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Mon, 6 Nov 2023 12:56:29 -0800 Subject: [PATCH 1/2] Added support for method parameters as collection --- .idea/misc.xml | 6 ++++ examples/lib/bld/bld-wrapper.properties | 2 +- .../extension/JacocoReportOperationBuild.java | 6 ++-- .../bld/extension/JacocoReportOperation.java | 32 ++++++++++++++++--- 4 files changed, 39 insertions(+), 7 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 543a8e1..53e2d58 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,3 +1,4 @@ + @@ -33,6 +34,11 @@ \ No newline at end of file + diff --git a/.idea/misc.xml b/.idea/misc.xml index 53e2d58..b646895 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -29,6 +29,7 @@ + \ No newline at end of file + diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..e96f91a --- /dev/null +++ b/examples/README.md @@ -0,0 +1,6 @@ +# Compile and Generate JaCoCo Reports + +```console +./bld compile jacoco +``` + diff --git a/examples/src/bld/java/com/example/ExamplesBuild.java b/examples/src/bld/java/com/example/ExamplesBuild.java index d7aabc7..77b87fe 100644 --- a/examples/src/bld/java/com/example/ExamplesBuild.java +++ b/examples/src/bld/java/com/example/ExamplesBuild.java @@ -20,17 +20,18 @@ public class ExamplesBuild extends Project { repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL); scope(test) - .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 0))) - .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 0))); + .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 1))) + .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 1))); } public static void main(String[] args) { new ExamplesBuild().start(args); } + @BuildCommand(summary = "Generates Jacoco Reports") public void jacoco() throws IOException { new JacocoReportOperation() .fromProject(this) .execute(); } -} \ No newline at end of file +} diff --git a/lib/bld/bld-wrapper.properties b/lib/bld/bld-wrapper.properties index 2ba435d..69cad60 100644 --- a/lib/bld/bld-wrapper.properties +++ b/lib/bld/bld-wrapper.properties @@ -1,6 +1,6 @@ bld.downloadExtensionJavadoc=false bld.downloadExtensionSources=true -bld.extension-pmd=com.uwyn.rife2:bld-pmd:0.9.3 +bld.extension-pmd=com.uwyn.rife2:bld-pmd:0.9.4 bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES bld.downloadLocation= bld.version=1.7.5 diff --git a/src/bld/java/rife/bld/extension/JacocoReportOperationBuild.java b/src/bld/java/rife/bld/extension/JacocoReportOperationBuild.java index fa5e424..1c43919 100644 --- a/src/bld/java/rife/bld/extension/JacocoReportOperationBuild.java +++ b/src/bld/java/rife/bld/extension/JacocoReportOperationBuild.java @@ -48,8 +48,8 @@ public class JacocoReportOperationBuild extends Project { scope(runtime) .include(dependency("org.jacoco", "jacoco", jacocoVersion).exclude("*", "org.jacoco.doc")); scope(test) - .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 0))) - .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 0))) + .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 1))) + .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 1))) .include(dependency("org.assertj", "assertj-core", version(3, 24, 2))); javadocOperation() @@ -66,13 +66,23 @@ public class JacocoReportOperationBuild extends Project { .artifactId("bld-jacoco-report") .description("bld Extension to Generate JaCoCo Code Coverage Reports") .url("https://github.com/rife2/bld-pmd") - .developer(new PublishDeveloper().id("ethauvin").name("Erik C. Thauvin").email("erik@thauvin.net") - .url("https://erik.thauvin.net/")) - .license(new PublishLicense().name("The Apache License, Version 2.0") - .url("http://www.apache.org/licenses/LICENSE-2.0.txt")) - .scm(new PublishScm().connection("scm:git:https://github.com/rife2/bld-pmd.git") - .developerConnection("scm:git:git@github.com:rife2/bld-pmd.git") - .url("https://github.com/rife2/bld-pmd")) + .developer( + new PublishDeveloper() + .id("ethauvin") + .name("Erik C. Thauvin") + .email("erik@thauvin.net") + .url("https://erik.thauvin.net/") + ) + .license( + new PublishLicense() + .name("The Apache License, Version 2.0") + .url("http://www.apache.org/licenses/LICENSE-2.0.txt") + ) + .scm( + new PublishScm().connection("scm:git:https://github.com/rife2/bld-pmd.git") + .developerConnection("scm:git:git@github.com:rife2/bld-pmd.git") + .url("https://github.com/rife2/bld-pmd") + ) .signKey(property("sign.key")) .signPassphrase(property("sign.passphrase")); } diff --git a/src/main/java/rife/bld/extension/JacocoReportOperation.java b/src/main/java/rife/bld/extension/JacocoReportOperation.java index d777f63..36257b1 100644 --- a/src/main/java/rife/bld/extension/JacocoReportOperation.java +++ b/src/main/java/rife/bld/extension/JacocoReportOperation.java @@ -111,7 +111,10 @@ public class JacocoReportOperation extends AbstractOperation classFiles) { this.classFiles.addAll(classFiles); return this; @@ -127,6 +133,9 @@ public class JacocoReportOperation extends AbstractOperation execFiles) { this.execFiles.addAll(execFiles); @@ -238,6 +259,9 @@ public class JacocoReportOperation extends AbstractOperation sourceFiles) { this.sourceFiles.addAll(sourceFiles); return this; @@ -332,6 +371,9 @@ public class JacocoReportOperation extends AbstractOperation