Updated dependencies

Bumped Gradle to version 8.10.1
Bumped Kotlin to version 2.0.20
Bumped bld to version 2.1.0
This commit is contained in:
Erik C. Thauvin 2024-09-09 11:33:38 -07:00
parent 94254cd590
commit 3b18ff1612
Signed by: erik
GPG key ID: 776702A6A2DA330E
32 changed files with 163 additions and 128 deletions

View file

@ -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

View file

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

6
.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-1.9.1.jar!/" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-1.9.1-sources.jar!/" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.1.0-sources.jar!/" />
</SOURCES>
<excluded>
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />

View file

@ -9,9 +9,9 @@
<root url="file://$PROJECT_DIR$/lib/compile" />
<root url="file://$PROJECT_DIR$/lib/provided" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="false" type="SOURCES" />
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="false" type="SOURCES" />
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="true" type="SOURCES" />
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="true" type="SOURCES" />
</library>
</component>

View file

@ -8,7 +8,7 @@
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/runtime" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="false" type="SOURCES" />
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="true" type="SOURCES" />
</library>
</component>

View file

@ -10,9 +10,9 @@
<root url="file://$PROJECT_DIR$/lib/test" />
<root url="file://$PROJECT_DIR$/lib/provided" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" type="SOURCES" />
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="false" type="SOURCES" />
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="true" type="SOURCES" />
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="true" type="SOURCES" />
</library>
</component>

View file

@ -2,7 +2,7 @@
[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](https://opensource.org/licenses/BSD-3-Clause)
[![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/1.9.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld)
[![bld](https://img.shields.io/badge/2.1.0-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld)
[![release](https://img.shields.io/github/release/ethauvin/semver.svg)](https://github.com/ethauvin/semver/releases/latest)
[![Nexus Snapshot](https://img.shields.io/nexus/s/net.thauvin.erik/semver?label=snapshot&server=https%3A%2F%2Foss.sonatype.org%2F)](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/semver/)
[![Maven Central](https://img.shields.io/maven-central/v/net.thauvin.erik/semver.svg)](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)
}
}
```

View file

@ -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/

View file

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

View file

@ -2,12 +2,16 @@
<library name="compile">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib/compile" />
<root url="file://$PROJECT_DIR$/lib/provided" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/compile" />
<root url="file://$PROJECT_DIR$/lib/provided" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="false" type="SOURCES" />
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="true" type="SOURCES" />
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="true" type="SOURCES" />
</library>
</component>

View file

@ -8,7 +8,7 @@
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/runtime" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="false" type="SOURCES" />
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/runtime" recursive="true" type="SOURCES" />
</library>
</component>

View file

@ -2,13 +2,17 @@
<library name="test">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib/test" />
<root url="file://$PROJECT_DIR$/lib/provided" />
<root url="file://$PROJECT_DIR$/src/test/resources" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/test" />
<root url="file://$PROJECT_DIR$/lib/provided" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" type="SOURCES" />
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="true" type="SOURCES" />
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="true" />
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="true" type="SOURCES" />
</library>
</component>

View file

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

View file

@ -0,0 +1,10 @@
## Examples
To compile & run the examples:
```console
./bld compile
./bld run
./bld run-example
```

View file

@ -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

View file

@ -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.
*
* <ul style="list-style-type:none">
* <li>./bld run</li>
* <li>./bld runExample</li>
* </ul>
*/
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();
}

View file

@ -6,8 +6,8 @@
<outputRelativeToContentRoot value="true" />
<option name="semver.project.dir" value="$PROJECT_DIR$" />
<processorPath useClasspath="false">
<entry name="$MAVEN_REPOSITORY$/net/thauvin/erik/semver/1.2.2-SNAPSHOT/semver-1.2.2-SNAPSHOT.jar" />
<entry name="$MAVEN_REPOSITORY$/com/github/spullara/mustache/java/compiler/0.9.12/compiler-0.9.12.jar" />
<entry name="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.thauvin.erik/semver/1.2.2-SNAPSHOT/31d53f3e9fdd226343234d13a080d6fd12b58ae6/semver-1.2.2-SNAPSHOT.jar" />
<entry name="$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.github.spullara.mustache.java/compiler/0.9.13/60666500a7dce7a5d3e17c09b46ea6f037192bd5/compiler-0.9.13.jar" />
</processorPath>
<module name="examples-java.main" />
</profile>

View file

@ -0,0 +1,9 @@
## Examples
To run the examples:
```console
./gradlew run
./gradlew runExample
```

View file

@ -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'

View file

@ -5,6 +5,6 @@
<option name="sourceMapPrefix" />
</component>
<component name="KotlinJpsPluginSettings">
<option name="version" value="1.9.23" />
<option name="version" value="2.0.20" />
</component>
</project>

View file

@ -4,7 +4,7 @@
<component name="PDMPlugin">
<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" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/classes" />
</component>
</project>

11
examples/kotlin/README.md Normal file
View file

@ -0,0 +1,11 @@
## Examples
To run the examples:
```console
./gradlew run
./gradlew runJava
./gradlew runExample
./gradlew runJavaExample
```

View file

@ -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)
}
}

Binary file not shown.

View file

@ -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

View file

@ -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

View file

@ -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 ##########################################################################

Binary file not shown.

View file

@ -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

View file

@ -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();
}
}