diff --git a/.circleci/config.yml b/.circleci/config.yml index 9f4cf5a..d753e7d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,11 +30,11 @@ defaults_gradle: &defaults_gradle path: build/reports/ jobs: - build_gradle_jdk16: + build_gradle_jdk17: <<: *defaults docker: - - image: cimg/openjdk:16.0 + - image: cimg/openjdk:17.0 <<: *defaults_gradle @@ -51,4 +51,4 @@ workflows: gradle: jobs: - build_gradle_jdk8 - - build_gradle_jdk16 + - build_gradle_jdk17 diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 71b9695..4a473de 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - java-version: [ 1.8, 11, 16 ] + java-version: [ 1.8, 11, 17 ] steps: - uses: actions/checkout@v2 diff --git a/README.md b/README.md index 846122d..e1aa045 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](http://opensource.org/licenses/BSD-3-Clause) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ethauvin_semver-gradle&metric=alert_status)](https://sonarcloud.io/dashboard?id=ethauvin_semver-gradle) [![GitHub CI](https://github.com/ethauvin/semver-gradle/actions/workflows/gradle.yml/badge.svg)](https://github.com/ethauvin/semver-gradle/actions/workflows/gradle.yml) [![CircleCI](https://circleci.com/gh/ethauvin/semver-gradle/tree/master.svg?style=shield)](https://circleci.com/gh/ethauvin/semver-gradle/tree/master) [![Gradle](https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/net/thauvin/erik/gradle/semver/maven-metadata.xml.svg?label=gradle&color=blue)](https://plugins.gradle.org/plugin/net.thauvin.erik.gradle.semver) +[![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) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ethauvin_semver-gradle&metric=alert_status)](https://sonarcloud.io/dashboard?id=ethauvin_semver-gradle) [![GitHub CI](https://github.com/ethauvin/semver-gradle/actions/workflows/gradle.yml/badge.svg)](https://github.com/ethauvin/semver-gradle/actions/workflows/gradle.yml) [![CircleCI](https://circleci.com/gh/ethauvin/semver-gradle/tree/master.svg?style=shield)](https://circleci.com/gh/ethauvin/semver-gradle/tree/master) [![Gradle](https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/net/thauvin/erik/gradle/semver/maven-metadata.xml.svg?label=gradle&color=blue)](https://plugins.gradle.org/plugin/net.thauvin.erik.gradle.semver) # Semantic Version Plugin for Gradle diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 7d98402..a9514a0 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -1,4 +1,4 @@ -image: openjdk:8 +image: maven:3-openjdk-18 pipelines: default: diff --git a/build.gradle.kts b/build.gradle.kts index 60e7c5d..b9da44f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,16 +3,16 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent plugins { - id("com.github.ben-manes.versions") version "0.40.0" - id("com.gradle.plugin-publish") version "0.19.0" - id("io.gitlab.arturbosch.detekt") version "1.19.0" + id("com.github.ben-manes.versions") version "0.42.0" + id("com.gradle.plugin-publish") version "1.0.0" + id("io.gitlab.arturbosch.detekt") version "1.21.0" id("java-gradle-plugin") id("java") id("maven-publish") - id("org.gradle.kotlin.kotlin-dsl") version "2.1.7" - id("org.jetbrains.kotlinx.kover") version "0.4.4" - id("org.sonarqube") version "3.3" - // kotlin("jvm") version "1.4.31" + id("org.gradle.kotlin.kotlin-dsl") version "2.3.3" + id("org.jetbrains.kotlinx.kover") version "0.6.0" + id("org.sonarqube") version "3.4.0.2513" + // kotlin("jvm") version "1.6.21" } version = "1.0.5" @@ -32,7 +32,7 @@ dependencies { implementation(platform(kotlin("bom"))) implementation(kotlin("stdlib")) - //testImplementation(gradleTestKit()) + // testImplementation(gradleTestKit()) testImplementation(kotlin("test")) testImplementation(kotlin("test-junit")) @@ -66,7 +66,7 @@ tasks { } detekt { - //toolVersion = "main-SNAPSHOT" + // toolVersion = "main-SNAPSHOT" baseline = project.rootDir.resolve("detekt-baseline.xml") } @@ -77,7 +77,7 @@ sonarqube { property("sonar.organization", "ethauvin-github") property("sonar.host.url", "https://sonarcloud.io") property("sonar.sourceEncoding", "UTF-8") - property("sonar.coverage.jacoco.xmlReportPaths", "${project.buildDir}/reports/kover/report.xml") + property("sonar.coverage.jacoco.xmlReportPaths", "${project.buildDir}/reports/kover/xml/report.xml") } } @@ -96,8 +96,8 @@ pluginBundle { website = github vcsUrl = github tags = listOf("semver", "semantic", "version", "versioning", "auto-increment", "kotlin", "java") - mavenCoordinates { - groupId = project.group.toString() - artifactId = project.name - } + // mavenCoordinates { + // groupId = project.group.toString() + // artifactId = project.name + // } } diff --git a/detekt-baseline.xml b/detekt-baseline.xml index dffe823..c57e9ed 100644 --- a/detekt-baseline.xml +++ b/detekt-baseline.xml @@ -2,11 +2,11 @@ - MagicNumber:Utils.kt$3 - MagicNumber:Utils.kt$4 - MagicNumber:Utils.kt$5 - NestedBlockDepth:Utils.kt$fun File.loadProperties(): Properties - NestedBlockDepth:Utils.kt$fun parseSemVer(input: String?, version: Version): Boolean - NestedBlockDepth:Utils.kt$fun saveProperties(projectDir: File, config: SemverConfig, version: Version) + MagicNumber:utils.kt$3 + MagicNumber:utils.kt$4 + MagicNumber:utils.kt$5 + NestedBlockDepth:utils.kt$fun File.loadProperties(): Properties + NestedBlockDepth:utils.kt$fun parseSemVer(input: String?, version: Version): Boolean + NestedBlockDepth:utils.kt$fun saveProperties(projectDir: File, config: SemverConfig, version: Version) diff --git a/examples/annotation-processor/java/build.gradle b/examples/annotation-processor/java/build.gradle index 5b6cadd..75750a7 100644 --- a/examples/annotation-processor/java/build.gradle +++ b/examples/annotation-processor/java/build.gradle @@ -2,7 +2,7 @@ plugins { id 'java' id 'application' id 'net.thauvin.erik.gradle.semver' version '1.0.4' - id 'com.github.ben-manes.versions' version '0.39.0' + id 'com.github.ben-manes.versions' version '0.42.0' } // ./gradlew diff --git a/examples/annotation-processor/java/gradle/wrapper/gradle-wrapper.jar b/examples/annotation-processor/java/gradle/wrapper/gradle-wrapper.jar index 7454180..249e583 100644 Binary files a/examples/annotation-processor/java/gradle/wrapper/gradle-wrapper.jar and b/examples/annotation-processor/java/gradle/wrapper/gradle-wrapper.jar differ diff --git a/examples/annotation-processor/java/gradle/wrapper/gradle-wrapper.properties b/examples/annotation-processor/java/gradle/wrapper/gradle-wrapper.properties index 2e6e589..ae04661 100644 --- a/examples/annotation-processor/java/gradle/wrapper/gradle-wrapper.properties +++ b/examples/annotation-processor/java/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/annotation-processor/java/gradlew b/examples/annotation-processor/java/gradlew index 1b6c787..a69d9cb 100755 --- a/examples/annotation-processor/java/gradlew +++ b/examples/annotation-processor/java/gradlew @@ -205,6 +205,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/examples/annotation-processor/java/gradlew.bat b/examples/annotation-processor/java/gradlew.bat index 107acd3..f127cfd 100644 --- a/examples/annotation-processor/java/gradlew.bat +++ b/examples/annotation-processor/java/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/examples/annotation-processor/java/src/generated/java/com/example/GeneratedVersion.java b/examples/annotation-processor/java/src/generated/java/com/example/GeneratedVersion.java index 1620dcb..a56649d 100644 --- a/examples/annotation-processor/java/src/generated/java/com/example/GeneratedVersion.java +++ b/examples/annotation-processor/java/src/generated/java/com/example/GeneratedVersion.java @@ -14,16 +14,16 @@ import java.util.Date; */ public final class GeneratedVersion { public static final String PROJECT = "Java Example"; - public static final Date BUILDDATE = new Date(1620791725025L); + public static final Date BUILDDATE = new Date(1651261557743L); public static final int MAJOR = 2; - public static final int MINOR = 10; + public static final int MINOR = 11; public static final int PATCH = 0; public static final String PRERELEASE = ""; public static final String PRERELEASE_PREFIX = "-"; public static final String BUILDMETA = ""; public static final String BUILDMETA_PREFIX = "+"; public static final String SEPARATOR = "."; - public static final String VERSION = "2.10.0"; + public static final String VERSION = "2.11.0"; /** * Disables the default constructor. diff --git a/examples/annotation-processor/java/version.properties b/examples/annotation-processor/java/version.properties index fc54733..132a3ec 100644 --- a/examples/annotation-processor/java/version.properties +++ b/examples/annotation-processor/java/version.properties @@ -1,9 +1,9 @@ #Generated by the Semver Plugin for Gradle -#Wed Jul 24 21:06:09 PDT 2019 +#Fri Apr 29 12:45:57 PDT 2022 version.buildmeta= version.major=2 -version.minor=10 +version.minor=11 version.patch=0 version.prerelease= version.project=Java Example -version.semver=2.10.0 +version.semver=2.11.0 diff --git a/examples/annotation-processor/kotlin/build.gradle.kts b/examples/annotation-processor/kotlin/build.gradle.kts index bd21920..a8bf0ed 100644 --- a/examples/annotation-processor/kotlin/build.gradle.kts +++ b/examples/annotation-processor/kotlin/build.gradle.kts @@ -1,9 +1,9 @@ plugins { id("application") - id("com.github.ben-manes.versions") version "0.39.0" + id("com.github.ben-manes.versions") version "0.42.0" id("net.thauvin.erik.gradle.semver") version "1.0.4" - kotlin("jvm") version "1.5.30" - kotlin("kapt") version "1.5.30" + kotlin("jvm") version "1.7.20" + kotlin("kapt") version "1.7.20" } // ./gradlew diff --git a/examples/annotation-processor/kotlin/gradle/wrapper/gradle-wrapper.jar b/examples/annotation-processor/kotlin/gradle/wrapper/gradle-wrapper.jar index 7454180..249e583 100644 Binary files a/examples/annotation-processor/kotlin/gradle/wrapper/gradle-wrapper.jar and b/examples/annotation-processor/kotlin/gradle/wrapper/gradle-wrapper.jar differ diff --git a/examples/annotation-processor/kotlin/gradle/wrapper/gradle-wrapper.properties b/examples/annotation-processor/kotlin/gradle/wrapper/gradle-wrapper.properties index 2e6e589..ae04661 100644 --- a/examples/annotation-processor/kotlin/gradle/wrapper/gradle-wrapper.properties +++ b/examples/annotation-processor/kotlin/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/annotation-processor/kotlin/gradlew b/examples/annotation-processor/kotlin/gradlew index 1b6c787..a69d9cb 100755 --- a/examples/annotation-processor/kotlin/gradlew +++ b/examples/annotation-processor/kotlin/gradlew @@ -205,6 +205,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/examples/annotation-processor/kotlin/gradlew.bat b/examples/annotation-processor/kotlin/gradlew.bat index 107acd3..f127cfd 100644 --- a/examples/annotation-processor/kotlin/gradlew.bat +++ b/examples/annotation-processor/kotlin/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/examples/annotation-processor/kotlin/version.properties b/examples/annotation-processor/kotlin/version.properties index 8da5e3a..efea55e 100644 --- a/examples/annotation-processor/kotlin/version.properties +++ b/examples/annotation-processor/kotlin/version.properties @@ -1,9 +1,9 @@ #Generated by the Semver Plugin for Gradle -#Wed Jul 24 21:06:46 PDT 2019 +#Fri Apr 29 12:46:38 PDT 2022 version.buildmeta= version.major=14 -version.minor=3 +version.minor=4 version.patch=0 version.prerelease= version.project=Kotlin Example -version.semver=14.3.0 +version.semver=14.4.0 diff --git a/examples/java/build.gradle b/examples/java/build.gradle index 584e290..b2ba383 100644 --- a/examples/java/build.gradle +++ b/examples/java/build.gradle @@ -2,7 +2,7 @@ plugins { id 'java' id 'application' id 'net.thauvin.erik.gradle.semver' version '1.0.4' - id 'com.github.ben-manes.versions' version '0.40.0' + id 'com.github.ben-manes.versions' version '0.42.0' } // ./gradlew @@ -17,7 +17,7 @@ defaultTasks 'run' mainClassName = 'App' dependencies { - testImplementation platform('org.junit:junit-bom:5.8.0-RC1') + testImplementation platform('org.junit:junit-bom:5.9.1') testImplementation 'org.junit.jupiter:junit-jupiter' } diff --git a/examples/java/gradle/wrapper/gradle-wrapper.properties b/examples/java/gradle/wrapper/gradle-wrapper.properties index 2e6e589..ae04661 100644 --- a/examples/java/gradle/wrapper/gradle-wrapper.properties +++ b/examples/java/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/java/version.properties b/examples/java/version.properties index f5bf6aa..fad358d 100644 --- a/examples/java/version.properties +++ b/examples/java/version.properties @@ -1,8 +1,8 @@ #Generated by the Semver Plugin for Gradle -#Fri Sep 25 17:38:33 PDT 2020 -version.buildmeta=20200925173833 +#Fri Apr 29 12:45:29 PDT 2022 +version.buildmeta=20220429124529 version.major=1 version.minor=0 version.patch=0 version.prerelease= -version.semver=1.0.0+20200925173833 +version.semver=1.0.0+20220429124529 diff --git a/examples/kotlin/build.gradle.kts b/examples/kotlin/build.gradle.kts index 394d3e6..be7d229 100644 --- a/examples/kotlin/build.gradle.kts +++ b/examples/kotlin/build.gradle.kts @@ -5,9 +5,9 @@ import java.time.format.DateTimeFormatter plugins { id("application") - id("com.github.ben-manes.versions") version "0.40.0" + id("com.github.ben-manes.versions") version "0.42.0" id("net.thauvin.erik.gradle.semver") version "1.0.4" - kotlin("jvm") version "1.6.10" + kotlin("jvm") version "1.7.20" } // ./gradlew @@ -20,7 +20,7 @@ defaultTasks(ApplicationPlugin.TASK_RUN_NAME) dependencies { implementation(kotlin("stdlib")) - testImplementation("org.testng:testng:7.4.0") + testImplementation("org.testng:testng:7.6.1") } repositories { diff --git a/examples/kotlin/gradle/wrapper/gradle-wrapper.properties b/examples/kotlin/gradle/wrapper/gradle-wrapper.properties index 2e6e589..ae04661 100644 --- a/examples/kotlin/gradle/wrapper/gradle-wrapper.properties +++ b/examples/kotlin/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/kotlin/version.properties b/examples/kotlin/version.properties index 98e937a..201f83d 100644 --- a/examples/kotlin/version.properties +++ b/examples/kotlin/version.properties @@ -1,8 +1,8 @@ #Generated by the Semver Plugin for Gradle -#Mon Nov 09 21:24:16 PST 2020 -version.buildmeta=20201109212416 +#Fri Apr 29 12:45:44 PDT 2022 +version.buildmeta=20220429124544 version.major=1 version.minor=2 version.patch=4 version.prerelease=beta -version.semver=1.2.4-beta+20201109212416 +version.semver=1.2.4-beta+20220429124544 diff --git a/examples/test/gradle/wrapper/gradle-wrapper.properties b/examples/test/gradle/wrapper/gradle-wrapper.properties index 2e6e589..ae04661 100644 --- a/examples/test/gradle/wrapper/gradle-wrapper.properties +++ b/examples/test/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2e6e589..ae04661 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists