diff --git a/.idea/misc.xml b/.idea/misc.xml index cf8a3be..22c7683 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,6 +3,20 @@ + + + diff --git a/examples/lib/bld/bld-wrapper.properties b/examples/lib/bld/bld-wrapper.properties index 7a088fe..dfa1d5b 100644 --- a/examples/lib/bld/bld-wrapper.properties +++ b/examples/lib/bld/bld-wrapper.properties @@ -1,6 +1,6 @@ bld.downloadExtensionJavadoc=false bld.downloadExtensionSources=true -bld.extensions=com.uwyn.rife2:bld-kotlin:0.9.7 +bld.extensions=com.uwyn.rife2:bld-kotlin:0.9.4 bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.4 bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES bld.downloadLocation= diff --git a/examples/src/bld/java/com/example/ExampleBuild.java b/examples/src/bld/java/com/example/ExampleBuild.java index 32e06e4..9c02b47 100644 --- a/examples/src/bld/java/com/example/ExampleBuild.java +++ b/examples/src/bld/java/com/example/ExampleBuild.java @@ -31,7 +31,7 @@ public class ExampleBuild extends Project { repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, RIFE2_RELEASES); - final var kotlin = version(2, 0, 0); + final var kotlin = version(1, 9, 24); scope(compile) .include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin)); scope(test) diff --git a/src/bld/java/rife/bld/extension/DetektOperationBuild.java b/src/bld/java/rife/bld/extension/DetektOperationBuild.java index 15bf2ff..6c87b41 100644 --- a/src/bld/java/rife/bld/extension/DetektOperationBuild.java +++ b/src/bld/java/rife/bld/extension/DetektOperationBuild.java @@ -34,7 +34,7 @@ public class DetektOperationBuild extends Project { public DetektOperationBuild() { pkg = "rife.bld.extension"; name = "DetektOperation"; - version = version(0, 9, 5, "SNAPSHOT"); + version = version(0, 9, 4); javaRelease = 17; downloadSources = true; @@ -47,7 +47,7 @@ public class DetektOperationBuild extends Project { scope(test) .include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 2))) .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 2))) - .include(dependency("org.assertj", "assertj-core", version(3, 26, 0))); + .include(dependency("org.assertj", "assertj-core", version(3, 25, 3))); javadocOperation() .javadocOptions() .author() diff --git a/src/main/java/rife/bld/extension/DetektOperation.java b/src/main/java/rife/bld/extension/DetektOperation.java index 6db96db..7541107 100644 --- a/src/main/java/rife/bld/extension/DetektOperation.java +++ b/src/main/java/rife/bld/extension/DetektOperation.java @@ -257,10 +257,10 @@ public class DetektOperation extends AbstractProcessOperation { super.execute(); if (successful_ && LOGGER.isLoggable(Level.INFO)) { if (createBaseline_) { - LOGGER.info("Detekt baseline generated successfully: " + LOGGER.info("Detekt baseline successfully generated: " + "file://" + new File(baseline_).toURI().getPath()); } else { - LOGGER.info("Detekt operation finished successfully."); + LOGGER.info("Detekt executed successfully."); } } } @@ -402,7 +402,7 @@ public class DetektOperation extends AbstractProcessOperation { // report if (!report_.isEmpty()) { report_.forEach(it -> { - args.add("--report"); + args.add("-r"); args.add(it.id().name().toLowerCase() + ":" + it.path()); }); } diff --git a/src/test/java/rife/bld/extension/DetektOperationTest.java b/src/test/java/rife/bld/extension/DetektOperationTest.java index 26e42e6..dd3e4f4 100644 --- a/src/test/java/rife/bld/extension/DetektOperationTest.java +++ b/src/test/java/rife/bld/extension/DetektOperationTest.java @@ -18,7 +18,6 @@ package rife.bld.extension; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import rife.bld.BaseProject; import rife.bld.blueprints.BaseProjectBlueprint; import rife.bld.operations.exceptions.ExitStatusException; @@ -58,74 +57,6 @@ class DetektOperationTest { } } - @Test - void testCheckAllParameters() { - var params = List.of( - "--all-rules", - "--auto-correct", - "--base-path", - "--baseline", - "--build-upon-default-config", - "--classpath", - "--config", - "--config-resource", - "--create-baseline", - "--debug", - "--disable-default-rulesets", - "--excludes", - "--generate-config", - "--includes", - "--input", - "--jdk-home", - "--jvm-target", - "--language-version", - "--max-issues", - "--parallel", - "--plugins", - "--report" - ); - - var args = new DetektOperation() - .fromProject(new BaseProject()) - .allRules(true) - .autoCorrect(true) - .basePath("basePath") - .baseline("baseline") - .buildUponDefaultConfig(true) - .classPath("classpath") - .classPath(List.of("path2", "path3")) - .config("config") - .config(List.of("config2", "config4")) - .configResource("configResource") - .createBaseline(true) - .debug(true) - .disableDefaultRuleSets(true) - .excludes("excludes") - .generateConfig(true) - .includes("patterns") - .input("input") - .jdkHome("jdkHome") - .jvmTarget("jvmTarget") - .languageVersion("languageVersion") - .maxIssues(10) - .parallel(true) - .plugins("jars") - .plugins(List.of("jars2", "jar3")) - .report(new DetektReport(DetektReportId.HTML, "reports")) - .executeConstructProcessCommandList(); - - for (var p : params) { - var found = false; - for (var a : args) { - if (a.startsWith(p)) { - found = true; - break; - } - } - assertThat(found).as(p + " not found.").isTrue(); - } - } - @Test void testExampleBaseline() throws IOException, ExitStatusException, InterruptedException { var tmpDir = Files.createTempDirectory("bld-detekt-").toFile();