diff --git a/.circleci/config.yml b/.circleci/config.yml
index 20fd6d1..a89d1b8 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -1,40 +1,41 @@
-version: 2
-defaults: &defaults
- working_directory: ~/repo
- environment:
- JVM_OPTS: -Xmx3200m
- TERM: dumb
- CI_NAME: "CircleCI"
+version: 2.1
-defaults_bld: &defaults_bld
- steps:
- - checkout
- - run:
- name: Download the dependencies
- command: ./bld download
- - run:
- name: Run tests with bld
- command: ./bld compile test
+commands:
+ build_and_test:
+ parameters:
+ reports-dir:
+ type: string
+ default: "build/reports/test_results"
+ steps:
+ - checkout
+ - run:
+ name: Download dependencies
+ command: ./bld download
+ - run:
+ name: Compile source
+ command: ./bld compile
+ - run:
+ name: Run tests
+ command: ./bld jacoco -reports-dir=<< parameters.reports-dir >>
+ - store_test_results:
+ path: << parameters.reports-dir >>
+ - store_artifacts:
+ path: build/reports/jacoco/test/html
jobs:
- bld_jdk21:
- <<: *defaults
-
- docker:
- - image: cimg/openjdk:21.0
-
- <<: *defaults_bld
-
bld_jdk17:
- <<: *defaults
-
docker:
- - image: cimg/openjdk:17.0
+ - image: cimg/openjdk:17
+ steps:
+ - build_and_test
- <<: *defaults_bld
+ bld_jdk21:
+ docker:
+ - image: cimg/openjdk:21
+ steps:
+ - build_and_test
workflows:
- version: 2
bld:
jobs:
- bld_jdk17
diff --git a/.github/workflows/bld.yml b/.github/workflows/bld.yml
index 45b3b77..1e81746 100644
--- a/.github/workflows/bld.yml
+++ b/.github/workflows/bld.yml
@@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
env:
- COVERAGE_SDK: "17"
+ COVERAGE_JDK: "17"
strategy:
matrix:
@@ -25,28 +25,28 @@ jobs:
distribution: "zulu"
java-version: ${{ matrix.java-version }}
- - name: Grant execute permission for bld
- run: chmod +x bld
-
- - name: Download the dependencies
+ - name: Download dependencies
run: ./bld download
- - name: Run tests with bld
- run: ./bld compile jacoco
+ - name: Compile source
+ run: ./bld compile
+
+ - name: Run tests
+ run: ./bld jacoco
- name: Remove pom.xml
- if: success() && matrix.java-version == env.COVERAGE_SDK
+ if: success() && matrix.java-version == env.COVERAGE_JDK
run: rm -rf pom.xml
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
- if: success() && matrix.java-version == env.COVERAGE_SDK
+ if: success() && matrix.java-version == env.COVERAGE_JDK
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
- if: success() && matrix.java-version == env.COVERAGE_SDK
+ if: success() && matrix.java-version == env.COVERAGE_JDK
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
diff --git a/.idea/bld.xml b/.idea/bld.xml
new file mode 100644
index 0000000..6600cee
--- /dev/null
+++ b/.idea/bld.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/bld.xml b/.idea/libraries/bld.xml
index 48e8fd5..8105a64 100644
--- a/.idea/libraries/bld.xml
+++ b/.idea/libraries/bld.xml
@@ -2,12 +2,12 @@
-
+
-
+
diff --git a/.idea/libraries/compile.xml b/.idea/libraries/compile.xml
index 143dc93..5316b95 100644
--- a/.idea/libraries/compile.xml
+++ b/.idea/libraries/compile.xml
@@ -9,9 +9,9 @@
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/runtime.xml b/.idea/libraries/runtime.xml
index 2ae5c4b..d4069f2 100644
--- a/.idea/libraries/runtime.xml
+++ b/.idea/libraries/runtime.xml
@@ -8,7 +8,7 @@
-
-
+
+
\ No newline at end of file
diff --git a/.idea/libraries/test.xml b/.idea/libraries/test.xml
index c16475a..05f52ce 100644
--- a/.idea/libraries/test.xml
+++ b/.idea/libraries/test.xml
@@ -10,9 +10,9 @@
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
index e4b57ca..e90782a 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
[](https://opensource.org/licenses/BSD-3-Clause)
[](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
-[](https://rife2.com/bld)
+[](https://rife2.com/bld)
[](https://github.com/ethauvin/semver/releases/latest)
[](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/semver/)
[](https://central.sonatype.com/artifact/net.thauvin.erik/semver)
@@ -297,7 +297,7 @@ dependencies {
kapt {
arguments {
- arg("semver.project.dir", projectDir)
+ arg("semver.project.dir", projectDir.absolutePath)
}
}
```
diff --git a/examples/java/bld/.gitignore b/examples/java/bld/.gitignore
index a2805aa..b53292f 100644
--- a/examples/java/bld/.gitignore
+++ b/examples/java/bld/.gitignore
@@ -5,6 +5,7 @@ lib/bld/**
!lib/bld/bld-wrapper.jar
!lib/bld/bld-wrapper.properties
lib/compile/
+lib/provided/
lib/runtime/
lib/standalone/
lib/test/
diff --git a/examples/java/bld/.idea/libraries/bld.xml b/examples/java/bld/.idea/libraries/bld.xml
index cb3eddb..8105a64 100644
--- a/examples/java/bld/.idea/libraries/bld.xml
+++ b/examples/java/bld/.idea/libraries/bld.xml
@@ -2,11 +2,12 @@
-
+
-
+
+
diff --git a/examples/java/bld/.idea/libraries/compile.xml b/examples/java/bld/.idea/libraries/compile.xml
index 9bd86aa..5316b95 100644
--- a/examples/java/bld/.idea/libraries/compile.xml
+++ b/examples/java/bld/.idea/libraries/compile.xml
@@ -2,12 +2,16 @@
+
+
-
-
+
+
+
+
\ No newline at end of file
diff --git a/examples/java/bld/.idea/libraries/runtime.xml b/examples/java/bld/.idea/libraries/runtime.xml
index 2ae5c4b..d4069f2 100644
--- a/examples/java/bld/.idea/libraries/runtime.xml
+++ b/examples/java/bld/.idea/libraries/runtime.xml
@@ -8,7 +8,7 @@
-
-
+
+
\ No newline at end of file
diff --git a/examples/java/bld/.idea/libraries/test.xml b/examples/java/bld/.idea/libraries/test.xml
index b80486a..05f52ce 100644
--- a/examples/java/bld/.idea/libraries/test.xml
+++ b/examples/java/bld/.idea/libraries/test.xml
@@ -2,13 +2,17 @@
+
+
-
-
+
+
+
+
\ No newline at end of file
diff --git a/examples/java/bld/.vscode/settings.json b/examples/java/bld/.vscode/settings.json
index d136e4d..4c33beb 100644
--- a/examples/java/bld/.vscode/settings.json
+++ b/examples/java/bld/.vscode/settings.json
@@ -9,7 +9,7 @@
],
"java.configuration.updateBuildConfiguration": "automatic",
"java.project.referencedLibraries": [
- "${HOME}/.bld/dist/bld-1.9.1.jar",
+ "${HOME}/.bld/dist/bld-2.1.0.jar",
"lib/**/*.jar"
]
}
diff --git a/examples/java/bld/README.md b/examples/java/bld/README.md
new file mode 100644
index 0000000..d1f800f
--- /dev/null
+++ b/examples/java/bld/README.md
@@ -0,0 +1,10 @@
+## Examples
+
+To compile & run the examples:
+
+```console
+./bld compile
+
+./bld run
+./bld run-example
+```
diff --git a/examples/java/bld/lib/bld/bld-wrapper.jar b/examples/java/bld/lib/bld/bld-wrapper.jar
index 36220d7..a7466c9 100644
Binary files a/examples/java/bld/lib/bld/bld-wrapper.jar and b/examples/java/bld/lib/bld/bld-wrapper.jar differ
diff --git a/examples/java/bld/lib/bld/bld-wrapper.properties b/examples/java/bld/lib/bld/bld-wrapper.properties
index 2e76ebe..1c0547e 100644
--- a/examples/java/bld/lib/bld/bld-wrapper.properties
+++ b/examples/java/bld/lib/bld/bld-wrapper.properties
@@ -1,7 +1,7 @@
bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
+bld.downloadLocation=
bld.extensions=
bld.repositories=MAVEN_CENTRAL,RIFE2_RELEASES
-bld.downloadLocation=
bld.sourceDirectories=
-bld.version=1.9.1
+bld.version=2.1.0
diff --git a/examples/java/bld/src/bld/java/com/example/ExampleBuild.java b/examples/java/bld/src/bld/java/com/example/ExampleBuild.java
index 5abcec1..34b7157 100644
--- a/examples/java/bld/src/bld/java/com/example/ExampleBuild.java
+++ b/examples/java/bld/src/bld/java/com/example/ExampleBuild.java
@@ -6,16 +6,12 @@ import rife.bld.Project;
import java.io.File;
import java.util.List;
-import static rife.bld.dependencies.Repository.*;
-import static rife.bld.dependencies.Scope.compile;
+import static rife.bld.dependencies.Repository.MAVEN_CENTRAL;
+import static rife.bld.dependencies.Repository.MAVEN_LOCAL;
+import static rife.bld.dependencies.Scope.provided;
/**
* Example build.
- *
- *
- * - ./bld run
- * - ./bld runExample
- *
*/
public class ExampleBuild extends Project {
public ExampleBuild() {
@@ -29,7 +25,7 @@ public class ExampleBuild extends Project {
repositories = List.of(MAVEN_LOCAL, MAVEN_CENTRAL);
- scope(compile).include(dependency("net.thauvin.erik", "semver", version(1, 2, 2, "SNAPSHOT")));
+ scope(provided).include(dependency("net.thauvin.erik", "semver", version(1, 2, 2, "SNAPSHOT")));
}
public static void main(String[] args) {
@@ -50,7 +46,7 @@ public class ExampleBuild extends Project {
super.compile();
}
- @BuildCommand(summary = "Run the example")
+ @BuildCommand(value = "run-example", summary = "Runs the example")
public void runExample() throws Exception {
runOperation().fromProject(this).mainClass("com.example.Example").execute();
}
diff --git a/examples/java/gradle/.idea/compiler.xml b/examples/java/gradle/.idea/compiler.xml
index 735a70b..a83902e 100644
--- a/examples/java/gradle/.idea/compiler.xml
+++ b/examples/java/gradle/.idea/compiler.xml
@@ -6,8 +6,8 @@
-
-
+
+
diff --git a/examples/java/gradle/README.md b/examples/java/gradle/README.md
new file mode 100644
index 0000000..f9153e3
--- /dev/null
+++ b/examples/java/gradle/README.md
@@ -0,0 +1,9 @@
+## Examples
+
+To run the examples:
+
+```console
+./gradlew run
+./gradlew runExample
+```
+
diff --git a/examples/java/gradle/build.gradle b/examples/java/gradle/build.gradle
index 7d6046b..abdecb5 100644
--- a/examples/java/gradle/build.gradle
+++ b/examples/java/gradle/build.gradle
@@ -4,9 +4,6 @@ plugins {
id 'com.github.ben-manes.versions' version '0.51.0'
}
-// ./gradlew run
-// ./gradlew runExample
-
defaultTasks 'run'
final def semverProcessor = 'net.thauvin.erik:semver:1.2.2-SNAPSHOT'
diff --git a/examples/kotlin/.idea/kotlinc.xml b/examples/kotlin/.idea/kotlinc.xml
index 7ec2206..834c71d 100644
--- a/examples/kotlin/.idea/kotlinc.xml
+++ b/examples/kotlin/.idea/kotlinc.xml
@@ -5,6 +5,6 @@
-
+
\ No newline at end of file
diff --git a/examples/kotlin/.idea/misc.xml b/examples/kotlin/.idea/misc.xml
index 2776887..1638c7b 100644
--- a/examples/kotlin/.idea/misc.xml
+++ b/examples/kotlin/.idea/misc.xml
@@ -4,7 +4,7 @@
-
+
\ No newline at end of file
diff --git a/examples/kotlin/README.md b/examples/kotlin/README.md
new file mode 100644
index 0000000..d48aeba
--- /dev/null
+++ b/examples/kotlin/README.md
@@ -0,0 +1,11 @@
+## Examples
+
+To run the examples:
+
+```console
+./gradlew run
+./gradlew runJava
+./gradlew runExample
+./gradlew runJavaExample
+```
+
diff --git a/examples/kotlin/build.gradle.kts b/examples/kotlin/build.gradle.kts
index 33f1326..52a9d95 100644
--- a/examples/kotlin/build.gradle.kts
+++ b/examples/kotlin/build.gradle.kts
@@ -1,16 +1,10 @@
plugins {
id("application")
id("com.github.ben-manes.versions") version "0.51.0"
- kotlin("jvm") version "1.9.24"
+ kotlin("jvm") version "2.0.20"
kotlin("kapt") version "1.9.23"
}
-// ./gradlew
-// ./gradlew run
-// ./gradlew runJava
-// ./gradlew runExample
-// ./gradlew runJavaExample
-
defaultTasks(ApplicationPlugin.TASK_RUN_NAME)
val semverProcessor = "net.thauvin.erik:semver:1.2.2-SNAPSHOT"
@@ -24,7 +18,7 @@ dependencies {
kapt {
arguments {
- arg("semver.project.dir", projectDir)
+ arg("semver.project.dir", projectDir.absolutePath)
}
}
diff --git a/examples/kotlin/gradle/wrapper/gradle-wrapper.jar b/examples/kotlin/gradle/wrapper/gradle-wrapper.jar
index e644113..a4b76b9 100644
Binary files a/examples/kotlin/gradle/wrapper/gradle-wrapper.jar and b/examples/kotlin/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/examples/kotlin/gradle/wrapper/gradle-wrapper.properties b/examples/kotlin/gradle/wrapper/gradle-wrapper.properties
index b82aa23..0aaefbc 100644
--- a/examples/kotlin/gradle/wrapper/gradle-wrapper.properties
+++ b/examples/kotlin/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
diff --git a/examples/kotlin/gradlew b/examples/kotlin/gradlew
index 1aa94a4..f5feea6 100755
--- a/examples/kotlin/gradlew
+++ b/examples/kotlin/gradlew
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+# SPDX-License-Identifier: Apache-2.0
+#
##############################################################################
#
@@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
-# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
-APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
+' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
diff --git a/examples/kotlin/gradlew.bat b/examples/kotlin/gradlew.bat
index 25da30d..9d21a21 100644
--- a/examples/kotlin/gradlew.bat
+++ b/examples/kotlin/gradlew.bat
@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
+@rem SPDX-License-Identifier: Apache-2.0
+@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
diff --git a/lib/bld/bld-wrapper.jar b/lib/bld/bld-wrapper.jar
index e5a703b..256649c 100644
Binary files a/lib/bld/bld-wrapper.jar and b/lib/bld/bld-wrapper.jar differ
diff --git a/lib/bld/bld-wrapper.properties b/lib/bld/bld-wrapper.properties
index 0df0d99..28a462f 100644
--- a/lib/bld/bld-wrapper.properties
+++ b/lib/bld/bld-wrapper.properties
@@ -1,9 +1,9 @@
bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
-bld.extension-exec=com.uwyn.rife2:bld-exec:1.0.0
-bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.5
-bld.extension-pmd=com.uwyn.rife2:bld-pmd:0.9.9
-bld.repositories=MAVEN_CENTRAL,RIFE2_RELEASES,MAVEN_LOCAL,RIFE2_SNAPSHOTS
bld.downloadLocation=
+bld.extension-exec=com.uwyn.rife2:bld-exec:1.0.3
+bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.8
+bld.extension-pmd=com.uwyn.rife2:bld-pmd:1.1.5
+bld.repositories=MAVEN_CENTRAL,RIFE2_RELEASES,MAVEN_LOCAL,RIFE2_SNAPSHOTS
bld.sourceDirectories=
-bld.version=1.9.1
+bld.version=2.1.0
diff --git a/src/bld/java/net/thauvin/erik/semver/SemverBuild.java b/src/bld/java/net/thauvin/erik/semver/SemverBuild.java
index 010372f..1a564ad 100644
--- a/src/bld/java/net/thauvin/erik/semver/SemverBuild.java
+++ b/src/bld/java/net/thauvin/erik/semver/SemverBuild.java
@@ -40,8 +40,7 @@ import rife.bld.extension.PmdOperation;
import rife.bld.publish.*;
import rife.tools.exceptions.FileUtilsErrorException;
-import java.io.IOException;
-import java.nio.file.Path;
+import java.io.File;
import java.util.List;
import static rife.bld.dependencies.Repository.*;
@@ -71,10 +70,10 @@ public class SemverBuild extends Project {
repositories = List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS);
scope(compile)
- .include(dependency("com.github.spullara.mustache.java", "compiler", version(0, 9, 13)));
+ .include(dependency("com.github.spullara.mustache.java", "compiler", version(0, 9, 14)));
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.junit.jupiter", "junit-jupiter", version(5, 11, 0)))
+ .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 11, 0)));
javadocOperation().javadocOptions()
@@ -86,6 +85,7 @@ public class SemverBuild extends Project {
.withCredentials(property("sonatype.user"), property("sonatype.password"))
: repository(SONATYPE_RELEASES_LEGACY.location())
.withCredentials(property("sonatype.user"), property("sonatype.password")))
+ .repository(repository("github"))
.info(new PublishInfo()
.groupId(pkg)
.artifactId(name.toLowerCase())
@@ -93,24 +93,20 @@ public class SemverBuild extends Project {
.version(version)
.description(description)
.url(url)
- .developer(
- new PublishDeveloper()
- .id("ethauvin")
- .name("Erik C. Thauvin")
- .email("erik@thauvin.net")
- .url("https://erik.thauvin.net/")
+ .developer(new PublishDeveloper()
+ .id("ethauvin")
+ .name("Erik C. Thauvin")
+ .email("erik@thauvin.net")
+ .url("https://erik.thauvin.net/")
)
- .license(
- new PublishLicense()
- .name("The BSD 3-Clause License")
- .url("https://opensource.org/licenses/BSD-3-Clause")
+ .license(new PublishLicense()
+ .name("The BSD 3-Clause License")
+ .url("https://opensource.org/licenses/BSD-3-Clause")
)
- .scm(
- new PublishScm()
- .connection("scm:git:" + url + ".git")
- .developerConnection("scm:git:git@github.com:ethauvin/" + name.toLowerCase()
- + ".git")
- .url(url)
+ .scm(new PublishScm()
+ .connection("scm:git:" + url + ".git")
+ .developerConnection("scm:git:git@github.com:ethauvin/" + name.toLowerCase() + ".git")
+ .url(url)
)
.signKey(property("sign.key"))
.signPassphrase(property("sign.passphrase")));
@@ -121,7 +117,7 @@ public class SemverBuild extends Project {
}
@BuildCommand(summary = "Generates JaCoCo Reports")
- public void jacoco() throws IOException {
+ public void jacoco() throws Exception {
new JacocoReportOperation().fromProject(this).execute();
}
@@ -142,30 +138,30 @@ public class SemverBuild extends Project {
}
@BuildCommand(summary = "Runs PMD analysis")
- public void pmd() {
+ public void pmd() throws Exception {
pmdOp.execute();
}
@BuildCommand(value = "pmd-cli", summary = "Runs PMD analysis (CLI)")
- public void pmdCli() {
+ public void pmdCli() throws Exception {
pmdOp.includeLineNumber(false).execute();
}
+ @BuildCommand(value = "pom-root", summary = "Generates the POM file in the root directory")
+ public void pomRoot() throws FileUtilsErrorException {
+ PomBuilder.generateInto(publishOperation().fromProject(this).info(), dependencies(),
+ new File(workDirectory, "pom.xml"));
+ }
+
@Override
public void publish() throws Exception {
super.publish();
- rootPom();
+ pomRoot();
}
@Override
public void publishLocal() throws Exception {
super.publishLocal();
- rootPom();
- }
-
- @BuildCommand(value = "pom-root", summary = "Generates the POM file in the root directory")
- public void rootPom() throws FileUtilsErrorException {
- PomBuilder.generateInto(publishOperation().info(), dependencies(),
- Path.of(workDirectory.getPath(), "pom.xml").toFile());
+ pomRoot();
}
}