Compare commits

..

19 commits
0.9.8 ... main

Author SHA1 Message Date
ea10fd012f
Disable cleanPath() for testing 2025-03-24 19:01:12 -07:00
69a9eac414
Add baseline file for testing 2025-03-24 17:36:30 -07:00
5a2824507f
Removed paths quoting 2025-03-24 16:12:15 -07:00
3e350e617a
Bump detekt extension to version 0.9.10-SNAPSHOT 2025-03-24 16:11:11 -07:00
432e5ffed1
Enable extension logging in examples 2025-03-24 16:09:45 -07:00
e6d5c6c38f
Quote and clean path in the process command list 2025-03-24 10:06:41 -07:00
7d5b50641c
Add OS matrix to test the project and examples on Ubuntu, Windows and macOS 2025-03-24 01:44:39 -07:00
30f92d1262
Bump Kotlin extension to version 1.1.0-SNAPSHOT 2025-03-24 01:39:53 -07:00
8d4643d99a
Bump Kotlin to version 2.1.20 2025-03-24 01:38:50 -07:00
0efd5ab2fe
JDK 24 2025-03-18 23:34:19 -07:00
3df50c2e79
Add generic installation instructions 2025-03-18 13:07:29 -07:00
012cd14067
Bump PMD extension to version 1.2.1 2025-03-18 13:06:22 -07:00
e39302bf8b
Bump JUnit to version 5.12.1 2025-03-18 13:06:07 -07:00
41d6667dca
Bump bld to version 2.2.1 2025-02-24 22:48:05 -08:00
7386332361
Version 0.9.9 2025-02-23 16:32:20 -08:00
95971222f9
Bump Detekt to version 1.23.8 2025-02-23 16:29:33 -08:00
ae53af2ba6
Bump PMD extension to version 1.2.0 2025-02-23 15:44:28 -08:00
7ad511a40c
Bump JUnit to version 5.12.0 2025-02-23 15:44:28 -08:00
1115acaad4
Update pages actions to the latest versions 2025-02-23 15:44:27 -08:00
17 changed files with 98 additions and 50 deletions

View file

@ -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, 23]
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
@ -22,12 +24,16 @@ jobs:
distribution: "zulu"
java-version: ${{ matrix.java-version }}
- name: Download dependencies
run: ./bld download
- name: Download dependencies [examples]
working-directory: examples
run: ./bld download
- name: Run Detekt [examples]
working-directory: examples
run: ./bld compile test-ci
- name: Download dependencies
run: ./bld download
- name: Run tests
run: ./bld compile test
run: ./bld compile test

View file

@ -47,11 +47,11 @@ jobs:
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
# Upload generated Javadocs repository
path: "build/javadoc/"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4

View file

@ -2,12 +2,12 @@
<library name="bld">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.0.jar!/" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.0-sources.jar!/" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1-sources.jar!/" />
</SOURCES>
<excluded>
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />

View file

@ -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"
]
}

View file

@ -3,12 +3,20 @@
[![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-detekt/maven-metadata.xml?color=blue)](https://repo.rife2.com/#/releases/com/uwyn/rife2/bld-detekt)
[![Snapshot](https://flat.badgen.net/maven/v/metadata-url/repo.rife2.com/snapshots/com/uwyn/rife2/bld-detekt/maven-metadata.xml?label=snapshot)](https://repo.rife2.com/#/snapshots/com/uwyn/rife2/bld-detekt)
[![GitHub CI](https://github.com/rife2/bld-detekt/actions/workflows/bld.yml/badge.svg)](https://github.com/rife2/bld-detekt/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:
```properties
bld.extension-detekt=com.uwyn.rife2:bld-detekt
```
For more information, please refer to the [extensions](https://github.com/rife2/bld/wiki/Extensions) documentation.
## Check Source Code with Detekt
To check all Kotlin source code located in the project, add the following to your build file:
```java

6
examples/.idea/bld.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="BldConfiguration">
<events />
</component>
</project>

View file

@ -2,12 +2,12 @@
<library name="bld">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.0.jar!/" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.0-sources.jar!/" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1-sources.jar!/" />
</SOURCES>
<excluded>
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />

View file

@ -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"
]
}

Binary file not shown.

View file

@ -1,8 +1,8 @@
bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
bld.downloadLocation=
bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.8
bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.4
bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.10-SNAPSHOT
bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.1.0-SNAPSHOT
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.sourceDirectories=
bld.version=2.2.0
bld.version=2.2.1

View file

@ -31,13 +31,14 @@ public class ExampleBuild extends Project {
repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, RIFE2_RELEASES);
final var kotlin = version(2, 1, 0);
final var kotlin = version(2, 1, 20);
scope(compile)
.include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin));
scope(test)
.include(dependency("org.jetbrains.kotlin", "kotlin-test-junit5", kotlin))
.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, 1)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 12, 1)))
.include(dependency("org.junit.platform", "junit-platform-launcher", version(1, 12, 1)));
// Include the Kotlin source directory when creating or publishing sources Java Archives
jarSourcesOperation().sourceDirectories(new File(srcMainDirectory(), "kotlin"));
@ -45,14 +46,14 @@ public class ExampleBuild extends Project {
public static void main(String[] args) {
// Enable detailed logging
// var level = Level.ALL;
// var logger = Logger.getLogger("rife.bld.extension");
// var consoleHandler = new ConsoleHandler();
//
// consoleHandler.setLevel(level);
// logger.addHandler(consoleHandler);
// logger.setLevel(level);
// logger.setUseParentHandlers(false);
var level = Level.ALL;
var logger = Logger.getLogger("rife.bld.extension");
var consoleHandler = new ConsoleHandler();
consoleHandler.setLevel(level);
logger.addHandler(consoleHandler);
logger.setLevel(level);
logger.setUseParentHandlers(false);
new ExampleBuild().start(args);
}
@ -100,4 +101,13 @@ public class ExampleBuild extends Project {
.input("src/test/kotlin")
.execute();
}
@BuildCommand(value = "test-ci", summary = "Run detek with a test baseline")
public void testCi() throws ExitStatusException, IOException, InterruptedException {
// Run detek with the test basline (for CI testing)
new DetektOperation()
.fromProject(this)
.baseline("src/test/resources/detekt-baseline.xml")
.execute();
}
}

View file

@ -0,0 +1,12 @@
<?xml version="1.0" ?>
<SmellBaseline>
<ManuallySuppressedIssues/>
<CurrentIssues>
<ID>EmptyIfBlock:Example.kt$Example.Companion${ }</ID>
<ID>MagicNumber:Example.kt$Example$5</ID>
<ID>NewLineAtEndOfFile:ExampleTest.kt$com.example.ExampleTest.kt</ID>
<ID>ThrowingExceptionsWithoutMessageOrCause:Example.kt$Example.Companion$IllegalStateException()</ID>
<ID>UseCheckOrError:Example.kt$Example.Companion$throw IllegalStateException()</ID>
<ID>VariableNaming:Example.kt$Example$// https://detekt.dev/docs/rules/naming#variablenaming val Message: String get() = "Hello World!"</ID>
</CurrentIssues>
</SmellBaseline>

Binary file not shown.

View file

@ -2,7 +2,7 @@ bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
bld.downloadLocation=
bld.extension-exec=com.uwyn.rife2:bld-exec:1.0.4
bld.extension-pmd=com.uwyn.rife2:bld-pmd:1.1.10
bld.extension-pmd=com.uwyn.rife2:bld-pmd:1.2.1
bld.repositories=MAVEN_CENTRAL,MAVEN_LOCAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.sourceDirectories=
bld.version=2.2.0
bld.version=2.2.1

View file

@ -23,6 +23,7 @@ import rife.bld.publish.PublishLicense;
import rife.bld.publish.PublishScm;
import java.util.List;
import java.util.Locale;
import static rife.bld.dependencies.Repository.*;
import static rife.bld.dependencies.Scope.compile;
@ -33,22 +34,22 @@ public class DetektOperationBuild extends Project {
public DetektOperationBuild() {
pkg = "rife.bld.extension";
name = "DetektOperation";
version = version(0, 9, 8);
version = version(0, 9, 10, "SNAPSHOT");
javaRelease = 17;
downloadSources = true;
autoDownloadPurge = true;
repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL, RIFE2_RELEASES, RIFE2_SNAPSHOTS);
scope(compile)
.include(dependency("com.uwyn.rife2", "bld", version(2, 2, 0)))
.include(dependency("io.gitlab.arturbosch.detekt", "detekt-cli", version(1, 23, 7)));
.include(dependency("com.uwyn.rife2", "bld", version(2, 2, 1)))
.include(dependency("io.gitlab.arturbosch.detekt", "detekt-cli", version(1, 23, 8)));
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.assertj", "assertj-core", version(3, 27, 2)));
.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()
.javadocOptions()
.author()
@ -97,10 +98,13 @@ public class DetektOperationBuild extends Project {
@Override
public void test() throws Exception {
new ExecOperation()
.fromProject(this)
.command("scripts/cliargs.sh")
.execute();
var os = System.getProperty("os.name");
if (os != null && os.toLowerCase(Locale.US).contains("linux")) {
new ExecOperation()
.fromProject(this)
.command("scripts/cliargs.sh")
.execute();
}
super.test();
}

View file

@ -48,10 +48,10 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
"kotlin-reflect-",
"kotlin-script-runtime-",
"kotlin-stdlib-",
"kotlin-stdlib-jdk7-",
"kotlin-stdlib-jdk8-",
"kotlinx-coroutines-",
"kotlinx-html-jvm-",
"kotlinx-serialization-",
"poko-annotations-jvm-",
"sarif4k-jvm-",
"snakeyaml-engine-",
"trove4j-");
@ -324,7 +324,6 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
return configStrings(List.of(configs));
}
/**
* Paths to the config files ({@code path/to/config.yml}).
*
@ -702,7 +701,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
}
}
}
return String.join(":", jars);
return String.join(File.pathSeparator, jars);
}
/**

View file

@ -19,6 +19,8 @@ package rife.bld.extension;
import org.assertj.core.api.AutoCloseableSoftAssertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledOnOs;
import org.junit.jupiter.api.condition.OS;
import rife.bld.BaseProject;
import rife.bld.blueprints.BaseProjectBlueprint;
import rife.bld.extension.detekt.Report;
@ -92,6 +94,7 @@ class DetektOperationTest {
}
@Test
@EnabledOnOs(OS.LINUX)
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
void testCheckAllParameters() throws IOException {
var args = Files.readAllLines(Paths.get("src", "test", "resources", "detekt-args.txt"));
@ -241,7 +244,7 @@ class DetektOperationTest {
void testExampleBaseline() throws IOException, ExitStatusException, InterruptedException {
var tmpDir = Files.createTempDirectory("bld-detekt-").toFile();
var baseline = new File(tmpDir, "detekt-baseline.xml");
var baseline = new File(tmpDir, "examples/src/test/resources/detekt-baseline.xml");
var op = new DetektOperation()
.fromProject(new BaseProjectBlueprint(new File("examples"), "com.example",