Compare commits
4 commits
154359e0cd
...
6fa52100ec
Author | SHA1 | Date | |
---|---|---|---|
6fa52100ec | |||
61c200ee54 | |||
833eddf28c | |||
0a716260ac |
6 changed files with 76 additions and 21 deletions
14
.idea/misc.xml
generated
14
.idea/misc.xml
generated
|
@ -3,20 +3,6 @@
|
||||||
<component name="EntryPointsManager">
|
<component name="EntryPointsManager">
|
||||||
<pattern value="rife.bld.extension.DetektOperationBuild" method="pmd" />
|
<pattern value="rife.bld.extension.DetektOperationBuild" method="pmd" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PDMPlugin">
|
|
||||||
<option name="customRuleSets">
|
|
||||||
<list>
|
|
||||||
<option value="K:\java\semver\config\pmd.xml" />
|
|
||||||
<option value="$PROJECT_DIR$/../bld-generated-version/config/pmd.xml" />
|
|
||||||
<option value="$PROJECT_DIR$/../bld-pitest/config/pmd.xml" />
|
|
||||||
<option value="$PROJECT_DIR$/../bld-jacoco-report/config/pmd.xml" />
|
|
||||||
<option value="$PROJECT_DIR$/../bld-checkstyle/config/pmd.xml" />
|
|
||||||
<option value="$PROJECT_DIR$/../bld-exec/config/pmd.xml" />
|
|
||||||
<option value="$PROJECT_DIR$/../bld-testng/config/pmd.xml" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
<option name="skipTestSources" value="false" />
|
|
||||||
</component>
|
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="17" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build" />
|
<output url="file://$PROJECT_DIR$/build" />
|
||||||
</component>
|
</component>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
bld.downloadExtensionJavadoc=false
|
bld.downloadExtensionJavadoc=false
|
||||||
bld.downloadExtensionSources=true
|
bld.downloadExtensionSources=true
|
||||||
bld.extensions=com.uwyn.rife2:bld-kotlin:0.9.4
|
bld.extensions=com.uwyn.rife2:bld-kotlin:0.9.7
|
||||||
bld.extension-detekt=com.uwyn.rife2:bld-detekt: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.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
|
||||||
bld.downloadLocation=
|
bld.downloadLocation=
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class ExampleBuild extends Project {
|
||||||
|
|
||||||
repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, RIFE2_RELEASES);
|
repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, RIFE2_RELEASES);
|
||||||
|
|
||||||
final var kotlin = version(1, 9, 24);
|
final var kotlin = version(2, 0, 0);
|
||||||
scope(compile)
|
scope(compile)
|
||||||
.include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin));
|
.include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin));
|
||||||
scope(test)
|
scope(test)
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class DetektOperationBuild extends Project {
|
||||||
public DetektOperationBuild() {
|
public DetektOperationBuild() {
|
||||||
pkg = "rife.bld.extension";
|
pkg = "rife.bld.extension";
|
||||||
name = "DetektOperation";
|
name = "DetektOperation";
|
||||||
version = version(0, 9, 4);
|
version = version(0, 9, 5, "SNAPSHOT");
|
||||||
|
|
||||||
javaRelease = 17;
|
javaRelease = 17;
|
||||||
downloadSources = true;
|
downloadSources = true;
|
||||||
|
@ -47,7 +47,7 @@ public class DetektOperationBuild extends Project {
|
||||||
scope(test)
|
scope(test)
|
||||||
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 2)))
|
.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.junit.platform", "junit-platform-console-standalone", version(1, 10, 2)))
|
||||||
.include(dependency("org.assertj", "assertj-core", version(3, 25, 3)));
|
.include(dependency("org.assertj", "assertj-core", version(3, 26, 0)));
|
||||||
javadocOperation()
|
javadocOperation()
|
||||||
.javadocOptions()
|
.javadocOptions()
|
||||||
.author()
|
.author()
|
||||||
|
|
|
@ -257,10 +257,10 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
super.execute();
|
super.execute();
|
||||||
if (successful_ && LOGGER.isLoggable(Level.INFO)) {
|
if (successful_ && LOGGER.isLoggable(Level.INFO)) {
|
||||||
if (createBaseline_) {
|
if (createBaseline_) {
|
||||||
LOGGER.info("Detekt baseline successfully generated: "
|
LOGGER.info("Detekt baseline generated successfully: "
|
||||||
+ "file://" + new File(baseline_).toURI().getPath());
|
+ "file://" + new File(baseline_).toURI().getPath());
|
||||||
} else {
|
} else {
|
||||||
LOGGER.info("Detekt executed successfully.");
|
LOGGER.info("Detekt operation finished successfully.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -402,7 +402,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
// report
|
// report
|
||||||
if (!report_.isEmpty()) {
|
if (!report_.isEmpty()) {
|
||||||
report_.forEach(it -> {
|
report_.forEach(it -> {
|
||||||
args.add("-r");
|
args.add("--report");
|
||||||
args.add(it.id().name().toLowerCase() + ":" + it.path());
|
args.add(it.id().name().toLowerCase() + ":" + it.path());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ package rife.bld.extension;
|
||||||
|
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
import rife.bld.BaseProject;
|
||||||
import rife.bld.blueprints.BaseProjectBlueprint;
|
import rife.bld.blueprints.BaseProjectBlueprint;
|
||||||
import rife.bld.operations.exceptions.ExitStatusException;
|
import rife.bld.operations.exceptions.ExitStatusException;
|
||||||
|
|
||||||
|
@ -57,6 +58,74 @@ 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
|
@Test
|
||||||
void testExampleBaseline() throws IOException, ExitStatusException, InterruptedException {
|
void testExampleBaseline() throws IOException, ExitStatusException, InterruptedException {
|
||||||
var tmpDir = Files.createTempDirectory("bld-detekt-").toFile();
|
var tmpDir = Files.createTempDirectory("bld-detekt-").toFile();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue