From 9d8ab4a7bc7b814907e3c8d7b56f5ab777ab79bc Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sat, 3 May 2025 19:00:34 -0700 Subject: [PATCH 1/5] Cleanup tests --- .idea/misc.xml | 4 + .../bld/extension/CheckstyleOperation.java | 2 + .../extension/CheckstyleOperationTest.java | 540 ++++++++++-------- 3 files changed, 311 insertions(+), 235 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 1bf9192..2643b0c 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,10 @@ + + + + diff --git a/src/main/java/rife/bld/extension/CheckstyleOperation.java b/src/main/java/rife/bld/extension/CheckstyleOperation.java index 97eeb55..f7689ba 100644 --- a/src/main/java/rife/bld/extension/CheckstyleOperation.java +++ b/src/main/java/rife/bld/extension/CheckstyleOperation.java @@ -455,6 +455,7 @@ public class CheckstyleOperation extends AbstractProcessOperation Date: Mon, 19 May 2025 12:40:01 -0700 Subject: [PATCH 2/5] Generate and convert JUnit report for xunit-viewer --- .github/workflows/bld.yml | 3 +- .idea/misc.xml | 2 +- .../extension/CheckstyleOperationBuild.java | 31 ++++++++++++++++++- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bld.yml b/.github/workflows/bld.yml index 6966bcb..b2bf24e 100644 --- a/.github/workflows/bld.yml +++ b/.github/workflows/bld.yml @@ -7,7 +7,6 @@ jobs: strategy: matrix: 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 }} @@ -36,4 +35,4 @@ jobs: run: ./bld download - name: Run tests - run: ./bld compile test \ No newline at end of file + run: ./bld compile test diff --git a/.idea/misc.xml b/.idea/misc.xml index 2643b0c..dfdb820 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -29,7 +29,7 @@ - + \ No newline at end of file diff --git a/src/bld/java/rife/bld/extension/CheckstyleOperationBuild.java b/src/bld/java/rife/bld/extension/CheckstyleOperationBuild.java index c720a08..92f8203 100644 --- a/src/bld/java/rife/bld/extension/CheckstyleOperationBuild.java +++ b/src/bld/java/rife/bld/extension/CheckstyleOperationBuild.java @@ -22,6 +22,9 @@ import rife.bld.publish.PublishDeveloper; import rife.bld.publish.PublishLicense; import rife.bld.publish.PublishScm; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.List; import java.util.Locale; @@ -107,6 +110,32 @@ public class CheckstyleOperationBuild extends Project { .command("scripts/cliargs.sh") .execute(); } - super.test(); + + var testResultsDir = "build/test-results/test/"; + var op = testOperation().fromProject(this); + op.testToolOptions().reportsDir(new File(testResultsDir)); + + Exception ex = null; + try { + op.execute(); + } catch (Exception e) { + ex = e; + } + + var xunitViewer = new File("/usr/bin/xunit-viewer"); + if (xunitViewer.exists() && xunitViewer.canExecute()) { + var reportsDir = "build/reports/tests/test/"; + + Files.createDirectories(Path.of(reportsDir)); + + new ExecOperation() + .fromProject(this) + .command(xunitViewer.getPath(), "-r", testResultsDir, "-o", reportsDir + "index.html") + .execute(); + } + + if (ex != null) { + throw ex; + } } } From f0638897786367de0cef72ccb4cdc0f23c1f64f5 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Thu, 22 May 2025 09:27:01 -0700 Subject: [PATCH 3/5] Bump Checkstyle to version 10.24.0 --- README.md | 2 +- examples/src/bld/java/com/example/ExamplesBuild.java | 2 +- src/bld/java/rife/bld/extension/CheckstyleOperationBuild.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bec8a94..f02c333 100644 --- a/README.md +++ b/README.md @@ -45,5 +45,5 @@ not provided by the extension. For example: ```java repositories = List.of(MAVEN_CENTRAL); -scope(test).include(dependency("com.puppycrawl.tools", "checkstyle", version(10, 23, 1))); +scope(test).include(dependency("com.puppycrawl.tools", "checkstyle", version(10, 24, 0))); ``` diff --git a/examples/src/bld/java/com/example/ExamplesBuild.java b/examples/src/bld/java/com/example/ExamplesBuild.java index f3a5f6d..ac1419d 100644 --- a/examples/src/bld/java/com/example/ExamplesBuild.java +++ b/examples/src/bld/java/com/example/ExamplesBuild.java @@ -26,7 +26,7 @@ public class ExamplesBuild extends BaseProject { repositories = List.of(MAVEN_CENTRAL); - scope(test).include(dependency("com.puppycrawl.tools", "checkstyle", version(10, 23, 1))); + scope(test).include(dependency("com.puppycrawl.tools", "checkstyle", version(10, 24, 0))); testOperation().mainClass("com.example.ExamplesTest"); } diff --git a/src/bld/java/rife/bld/extension/CheckstyleOperationBuild.java b/src/bld/java/rife/bld/extension/CheckstyleOperationBuild.java index 92f8203..be8739a 100644 --- a/src/bld/java/rife/bld/extension/CheckstyleOperationBuild.java +++ b/src/bld/java/rife/bld/extension/CheckstyleOperationBuild.java @@ -49,7 +49,7 @@ public class CheckstyleOperationBuild extends Project { scope(compile) .include(dependency("com.uwyn.rife2", "bld", version(2, 2, 1))); scope(test) - .include(dependency("com.puppycrawl.tools", "checkstyle", version(10, 23, 1))) + .include(dependency("com.puppycrawl.tools", "checkstyle", version(10, 24, 0))) .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))); From def9be96f1703d99cf4d619ade206b542091a15e Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Thu, 22 May 2025 09:28:46 -0700 Subject: [PATCH 4/5] Add support for the new generate checks and file suppression option --- .../bld/extension/CheckstyleOperation.java | 19 +++++++++++++++++++ .../extension/CheckstyleOperationTest.java | 9 +++++++++ src/test/resources/checkstyle-args.txt | 1 + 3 files changed, 29 insertions(+) diff --git a/src/main/java/rife/bld/extension/CheckstyleOperation.java b/src/main/java/rife/bld/extension/CheckstyleOperation.java index f7689ba..cdcd630 100644 --- a/src/main/java/rife/bld/extension/CheckstyleOperation.java +++ b/src/main/java/rife/bld/extension/CheckstyleOperation.java @@ -314,6 +314,25 @@ public class CheckstyleOperation extends AbstractProcessOperation Date: Thu, 22 May 2025 09:35:37 -0700 Subject: [PATCH 5/5] Version 1.0.15 --- examples/lib/bld/bld-wrapper.properties | 2 +- src/bld/java/rife/bld/extension/CheckstyleOperationBuild.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/lib/bld/bld-wrapper.properties b/examples/lib/bld/bld-wrapper.properties index ab1936c..3b1cdef 100644 --- a/examples/lib/bld/bld-wrapper.properties +++ b/examples/lib/bld/bld-wrapper.properties @@ -1,7 +1,7 @@ bld.downloadExtensionJavadoc=false bld.downloadExtensionSources=true bld.downloadLocation= -bld.extension-checkstyle=com.uwyn.rife2:bld-checkstyle:1.0.14 +bld.extension-checkstyle=com.uwyn.rife2:bld-checkstyle:1.0.15 bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES bld.sourceDirectories= bld.version=2.2.1 diff --git a/src/bld/java/rife/bld/extension/CheckstyleOperationBuild.java b/src/bld/java/rife/bld/extension/CheckstyleOperationBuild.java index be8739a..7a2c1a7 100644 --- a/src/bld/java/rife/bld/extension/CheckstyleOperationBuild.java +++ b/src/bld/java/rife/bld/extension/CheckstyleOperationBuild.java @@ -37,7 +37,7 @@ public class CheckstyleOperationBuild extends Project { public CheckstyleOperationBuild() { pkg = "rife.bld.extension"; name = "CheckstyleOperation"; - version = version(1, 0, 15, "SNAPSHOT"); + version = version(1, 0, 15); javaRelease = 17;