diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 743b298..4a473de 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -8,6 +8,7 @@ jobs: env: GRADLE_OPTS: "-Dorg.gradle.jvmargs=-XX:MaxMetaspaceSize=512m" + SONAR_JDK: "11" strategy: matrix: @@ -26,6 +27,14 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew + - name: Cache SonarCloud packages + if: matrix.java-version == env.SONAR_JDK + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Gradle packages uses: actions/cache@v2 with: @@ -39,6 +48,13 @@ jobs: - name: Test with Gradle run: ./gradlew build check --stacktrace + - name: SonarCloud + if: success() && matrix.java-version == env.SONAR_JDK + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: ./gradlew sonarqube + - name: Cleanup Gradle Cache run: | rm -f ~/.gradle/caches/modules-2/modules-2.lock diff --git a/.gitignore b/.gitignore index 0742f86..13a066e 100644 --- a/.gitignore +++ b/.gitignore @@ -64,6 +64,7 @@ dist/ ehthumbs.db fabric.properties gen/ +gradle.properties hs_err_pid* kobaltBuild kobaltw*-test diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1a3e8b4..f30e74b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: gradle:8-jdk11 +image: gradle:7-jdk11 variables: GRADLE_OPTS: "-Dorg.gradle.daemon=false" diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml deleted file mode 100644 index f8467b4..0000000 --- a/.idea/kotlinc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 1b14d69..d38657d 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -13,9 +13,6 @@ - - diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..797acea --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index e5d5256..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)](https://opensource.org/licenses/BSD-3-Clause) [![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/build.gradle.kts b/build.gradle.kts index 69e953b..b9da44f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,14 +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.51.0" - id("com.gradle.plugin-publish") version "1.2.1" - id("io.gitlab.arturbosch.detekt") version "1.23.5" + 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 "4.2.1" - kotlin("jvm") version "1.9.20" + 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" @@ -46,7 +48,8 @@ tasks { withType { kotlinOptions { jvmTarget = java.targetCompatibility.toString() - apiVersion = "1.6" + // Gradle 4.6 + apiVersion = "1.2" } } @@ -56,6 +59,10 @@ tasks { events = setOf(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED) } } + + "sonarqube" { + dependsOn(koverReport) + } } detekt { @@ -63,17 +70,34 @@ detekt { baseline = project.rootDir.resolve("detekt-baseline.xml") } -gradlePlugin { - website.set(github) - vcsUrl.set(github) +sonarqube { + properties { + property("sonar.projectName", "semver-gradle") + property("sonar.projectKey", "ethauvin_semver-gradle") + 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/xml/report.xml") + } +} +gradlePlugin { plugins { create(project.name) { id = packageName displayName = "SemVer Plugin" description = "Semantic Version Plugin for Gradle" - tags.set(listOf("semver", "semantic", "version", "versioning", "auto-increment", "kotlin", "java")) implementationClass = "$packageName.SemverPlugin" } } } + +pluginBundle { + website = github + vcsUrl = github + tags = listOf("semver", "semantic", "version", "versioning", "auto-increment", "kotlin", "java") + // mavenCoordinates { + // groupId = project.group.toString() + // artifactId = project.name + // } +} diff --git a/examples/annotation-processor/java/build.gradle b/examples/annotation-processor/java/build.gradle index bc80f5a..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.51.0' + id 'com.github.ben-manes.versions' version '0.42.0' } // ./gradlew @@ -14,7 +14,7 @@ mainClassName = 'com.example.Example' defaultTasks 'run' -def semverProcessor = 'net.thauvin.erik:semver:1.2.1' +def semverProcessor = 'net.thauvin.erik:semver:1.2.0' dependencies { annotationProcessor semverProcessor diff --git a/examples/annotation-processor/java/gradle/wrapper/gradle-wrapper.jar b/examples/annotation-processor/java/gradle/wrapper/gradle-wrapper.jar index d64cd49..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 a80b22c..ae04661 100644 --- a/examples/annotation-processor/java/gradle/wrapper/gradle-wrapper.properties +++ b/examples/annotation-processor/java/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip -networkTimeout=10000 -validateDistributionUrl=true +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 1aa94a4..a69d9cb 100755 --- a/examples/annotation-processor/java/gradlew +++ b/examples/annotation-processor/java/gradlew @@ -55,7 +55,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/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,11 +80,13 @@ do esac done -# This is normally unused -# shellcheck disable=SC2034 +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" 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 + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -131,29 +133,22 @@ location of your Java installation." fi else JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." - fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -198,15 +193,11 @@ if "$cygwin" || "$msys" ; then done fi - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be -# treated as '${Hostname}' itself on the command line. +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/examples/annotation-processor/java/gradlew.bat b/examples/annotation-processor/java/gradlew.bat index 25da30d..f127cfd 100644 --- a/examples/annotation-processor/java/gradlew.bat +++ b/examples/annotation-processor/java/gradlew.bat @@ -26,7 +26,6 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -43,11 +42,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. goto fail @@ -57,11 +56,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. goto fail 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 f0c4a7f..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 @@ -1,34 +1,34 @@ /* -* This file is automatically generated. -* Do not modify! -- ALL CHANGES WILL BE ERASED! -*/ - + * This file is automatically generated. + * Do not modify! -- ALL CHANGES WILL BE ERASED! + */ + package com.example; import java.util.Date; /** -* Provides semantic version information. -* -* @author Semantic Version Annotation Processor -*/ + * Provides semantic version information. + * + * @author Semantic Version Annotation Processor + */ public final class GeneratedVersion { -public static final String PROJECT = "Java Example"; -public static final Date BUILDDATE = new Date(1707709694421L); -public static final int MAJOR = 2; -public static final int MINOR = 12; -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.12.0"; + public static final String PROJECT = "Java Example"; + public static final Date BUILDDATE = new Date(1651261557743L); + public static final int MAJOR = 2; + 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.11.0"; -/** -* Disables the default constructor. -*/ -private GeneratedVersion() { -throw new UnsupportedOperationException("Illegal constructor call."); -} + /** + * Disables the default constructor. + */ + private GeneratedVersion() { + throw new UnsupportedOperationException("Illegal constructor call."); + } } diff --git a/examples/annotation-processor/java/version.properties b/examples/annotation-processor/java/version.properties index df2238d..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 -#Sun Feb 11 19:56:02 PST 2024 +#Fri Apr 29 12:45:57 PDT 2022 version.buildmeta= version.major=2 -version.minor=13 +version.minor=11 version.patch=0 version.prerelease= version.project=Java Example -version.semver=2.13.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 642ef77..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.51.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.7.22" - kotlin("kapt") version "1.7.22" + kotlin("jvm") version "1.7.20" + kotlin("kapt") version "1.7.20" } // ./gradlew @@ -13,7 +13,7 @@ plugins { defaultTasks(ApplicationPlugin.TASK_RUN_NAME) -var semverProcessor = "net.thauvin.erik:semver:1.2.1" +var semverProcessor = "net.thauvin.erik:semver:1.2.0" dependencies { kapt(semverProcessor) diff --git a/examples/annotation-processor/kotlin/gradle/wrapper/gradle-wrapper.jar b/examples/annotation-processor/kotlin/gradle/wrapper/gradle-wrapper.jar index d64cd49..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 a80b22c..ae04661 100644 --- a/examples/annotation-processor/kotlin/gradle/wrapper/gradle-wrapper.properties +++ b/examples/annotation-processor/kotlin/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip -networkTimeout=10000 -validateDistributionUrl=true +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 1aa94a4..a69d9cb 100755 --- a/examples/annotation-processor/kotlin/gradlew +++ b/examples/annotation-processor/kotlin/gradlew @@ -55,7 +55,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/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,11 +80,13 @@ do esac done -# This is normally unused -# shellcheck disable=SC2034 +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" 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 + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -131,29 +133,22 @@ location of your Java installation." fi else JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." - fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -198,15 +193,11 @@ if "$cygwin" || "$msys" ; then done fi - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be -# treated as '${Hostname}' itself on the command line. +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/examples/annotation-processor/kotlin/gradlew.bat b/examples/annotation-processor/kotlin/gradlew.bat index 25da30d..f127cfd 100644 --- a/examples/annotation-processor/kotlin/gradlew.bat +++ b/examples/annotation-processor/kotlin/gradlew.bat @@ -26,7 +26,6 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -43,11 +42,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. goto fail @@ -57,11 +56,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. goto fail diff --git a/examples/annotation-processor/kotlin/version.properties b/examples/annotation-processor/kotlin/version.properties index 9380cb2..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 -#Sun Feb 11 19:56:22 PST 2024 +#Fri Apr 29 12:46:38 PDT 2022 version.buildmeta= version.major=14 -version.minor=6 +version.minor=4 version.patch=0 version.prerelease= version.project=Kotlin Example -version.semver=14.6.0 +version.semver=14.4.0 diff --git a/examples/java/build.gradle b/examples/java/build.gradle index 0557940..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.51.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.10.2') + testImplementation platform('org.junit:junit-bom:5.9.1') testImplementation 'org.junit.jupiter:junit-jupiter' } diff --git a/examples/java/gradle/wrapper/gradle-wrapper.jar b/examples/java/gradle/wrapper/gradle-wrapper.jar index d64cd49..7454180 100644 Binary files a/examples/java/gradle/wrapper/gradle-wrapper.jar and b/examples/java/gradle/wrapper/gradle-wrapper.jar differ diff --git a/examples/java/gradle/wrapper/gradle-wrapper.properties b/examples/java/gradle/wrapper/gradle-wrapper.properties index a80b22c..ae04661 100644 --- a/examples/java/gradle/wrapper/gradle-wrapper.properties +++ b/examples/java/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip -networkTimeout=10000 -validateDistributionUrl=true +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/java/gradlew b/examples/java/gradlew index 1aa94a4..1b6c787 100755 --- a/examples/java/gradlew +++ b/examples/java/gradlew @@ -55,7 +55,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/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,11 +80,13 @@ do esac done -# This is normally unused -# shellcheck disable=SC2034 +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" 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 + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -131,29 +133,22 @@ location of your Java installation." fi else JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." - fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -198,15 +193,11 @@ if "$cygwin" || "$msys" ; then done fi - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be -# treated as '${Hostname}' itself on the command line. +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ @@ -214,12 +205,6 @@ 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/java/gradlew.bat b/examples/java/gradlew.bat index 25da30d..107acd3 100644 --- a/examples/java/gradlew.bat +++ b/examples/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,8 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused +if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -41,13 +40,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +if "%ERRORLEVEL%" == "0" goto execute -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. goto fail @@ -57,11 +56,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. goto fail @@ -76,15 +75,13 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +if "%ERRORLEVEL%"=="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! -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% +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/examples/java/version.properties b/examples/java/version.properties index 5485951..fad358d 100644 --- a/examples/java/version.properties +++ b/examples/java/version.properties @@ -1,8 +1,8 @@ #Generated by the Semver Plugin for Gradle -#Sun Feb 11 19:55:34 PST 2024 -version.buildmeta=20240211195534 +#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+20240211195534 +version.semver=1.0.0+20220429124529 diff --git a/examples/kotlin/build.gradle.kts b/examples/kotlin/build.gradle.kts index b2c6d5e..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.51.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.7.22" + 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.9.0") + testImplementation("org.testng:testng:7.6.1") } repositories { diff --git a/examples/kotlin/gradle/wrapper/gradle-wrapper.jar b/examples/kotlin/gradle/wrapper/gradle-wrapper.jar index d64cd49..7454180 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 a80b22c..ae04661 100644 --- a/examples/kotlin/gradle/wrapper/gradle-wrapper.properties +++ b/examples/kotlin/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip -networkTimeout=10000 -validateDistributionUrl=true +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/kotlin/gradlew b/examples/kotlin/gradlew index 1aa94a4..1b6c787 100755 --- a/examples/kotlin/gradlew +++ b/examples/kotlin/gradlew @@ -55,7 +55,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/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,11 +80,13 @@ do esac done -# This is normally unused -# shellcheck disable=SC2034 +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" 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 + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -131,29 +133,22 @@ location of your Java installation." fi else JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." - fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -198,15 +193,11 @@ if "$cygwin" || "$msys" ; then done fi - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be -# treated as '${Hostname}' itself on the command line. +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ @@ -214,12 +205,6 @@ 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/kotlin/gradlew.bat b/examples/kotlin/gradlew.bat index 25da30d..107acd3 100644 --- a/examples/kotlin/gradlew.bat +++ b/examples/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,8 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused +if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -41,13 +40,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +if "%ERRORLEVEL%" == "0" goto execute -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. goto fail @@ -57,11 +56,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. goto fail @@ -76,15 +75,13 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +if "%ERRORLEVEL%"=="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! -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% +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/examples/kotlin/version.properties b/examples/kotlin/version.properties index 4f963f9..201f83d 100644 --- a/examples/kotlin/version.properties +++ b/examples/kotlin/version.properties @@ -1,8 +1,8 @@ #Generated by the Semver Plugin for Gradle -#Sun Feb 11 19:55:46 PST 2024 -version.buildmeta=20240211195546 +#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+20240211195546 +version.semver=1.2.4-beta+20220429124544 diff --git a/examples/test/build.gradle b/examples/test/build.gradle index e5905ff..1e80a19 100644 --- a/examples/test/build.gradle +++ b/examples/test/build.gradle @@ -1,9 +1,18 @@ -plugins { - id 'java' - id 'application' - id("net.thauvin.erik.gradle.semver") version "1.0.4" +buildscript { + repositories { + mavenLocal() + mavenCentral() + } + dependencies { + classpath 'net.thauvin.erik.gradle:semver:1.0.5' + } } +apply plugin: 'java' +apply plugin: 'application' +apply plugin: 'net.thauvin.erik.gradle.semver' + + defaultTasks 'run' mainClassName = 'App' diff --git a/examples/test/gradle/wrapper/gradle-wrapper.jar b/examples/test/gradle/wrapper/gradle-wrapper.jar index d64cd49..7454180 100644 Binary files a/examples/test/gradle/wrapper/gradle-wrapper.jar and b/examples/test/gradle/wrapper/gradle-wrapper.jar differ diff --git a/examples/test/gradle/wrapper/gradle-wrapper.properties b/examples/test/gradle/wrapper/gradle-wrapper.properties index a80b22c..ae04661 100644 --- a/examples/test/gradle/wrapper/gradle-wrapper.properties +++ b/examples/test/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip -networkTimeout=10000 -validateDistributionUrl=true +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/test/gradlew b/examples/test/gradlew index 1aa94a4..1b6c787 100755 --- a/examples/test/gradlew +++ b/examples/test/gradlew @@ -55,7 +55,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/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,11 +80,13 @@ do esac done -# This is normally unused -# shellcheck disable=SC2034 +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" 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 + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -131,29 +133,22 @@ location of your Java installation." fi else JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." - fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -198,15 +193,11 @@ if "$cygwin" || "$msys" ; then done fi - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be -# treated as '${Hostname}' itself on the command line. +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ @@ -214,12 +205,6 @@ 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/test/gradlew.bat b/examples/test/gradlew.bat index 25da30d..107acd3 100644 --- a/examples/test/gradlew.bat +++ b/examples/test/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,8 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused +if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -41,13 +40,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +if "%ERRORLEVEL%" == "0" goto execute -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. goto fail @@ -57,11 +56,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. goto fail @@ -76,15 +75,13 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +if "%ERRORLEVEL%"=="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! -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% +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d64cd49..7454180 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a80b22c..ae04661 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip -networkTimeout=10000 -validateDistributionUrl=true +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 1aa94a4..1b6c787 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,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/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,11 +80,13 @@ do esac done -# This is normally unused -# shellcheck disable=SC2034 +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" 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 + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -131,29 +133,22 @@ location of your Java installation." fi else JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." - fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -198,15 +193,11 @@ if "$cygwin" || "$msys" ; then done fi - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be -# treated as '${Hostname}' itself on the command line. +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ @@ -214,12 +205,6 @@ 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/gradlew.bat b/gradlew.bat index 25da30d..107acd3 100644 --- a/gradlew.bat +++ b/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,8 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused +if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -41,13 +40,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +if "%ERRORLEVEL%" == "0" goto execute -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. goto fail @@ -57,11 +56,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. goto fail @@ -76,15 +75,13 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +if "%ERRORLEVEL%"=="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! -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% +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/preflightcheck.sh b/preflightcheck.sh index 1770f06..6de355e 100755 --- a/preflightcheck.sh +++ b/preflightcheck.sh @@ -15,7 +15,7 @@ declare -a examples=( # e.g: empty or javadoc, etc. gradle_doc="" # e.g. empty or sonarqube -gradle_sonar="" +gradle_sonar="sonarqube" # gradle options for examples gradle_opts="--console=plain --no-build-cache --no-daemon" # maven arguments for examples diff --git a/src/main/kotlin/net/thauvin/erik/gradle/semver/SemverIncrementTask.kt b/src/main/kotlin/net/thauvin/erik/gradle/semver/SemverIncrementTask.kt index 17b1997..6866ae6 100644 --- a/src/main/kotlin/net/thauvin/erik/gradle/semver/SemverIncrementTask.kt +++ b/src/main/kotlin/net/thauvin/erik/gradle/semver/SemverIncrementTask.kt @@ -35,7 +35,6 @@ package net.thauvin.erik.gradle.semver import org.gradle.api.DefaultTask import org.gradle.api.tasks.CacheableTask import org.gradle.api.tasks.TaskAction -import java.util.Locale import javax.inject.Inject @CacheableTask @@ -46,13 +45,7 @@ open class SemverIncrementTask @Inject constructor( ) : DefaultTask() { init { group = "version" - description = - "Increments ${ - type.replaceFirstChar { - if (it.isLowerCase()) it.titlecase(Locale.getDefault()) - else it.toString() - } - } version number." + description = "Increments ${type.capitalize()} version number." } @Suppress("unused") diff --git a/updatewrappers.sh b/updatewrappers.sh index 10c69e1..e98cca5 100755 --- a/updatewrappers.sh +++ b/updatewrappers.sh @@ -1,16 +1,18 @@ #!/bin/bash + # -# Version: 1.0.3 +# Version: 1.0.2 # # set the examples directories declare -a dirs=( - "${PWD##*/}" - "examples/java" - "examples/kotlin" - "examples/annotation-processor/java" - "examples/annotation-processor/kotlin") + "${PWD##*/}" + "examples/java" + "examples/kotlin" + "examples/annotation-processor/java" + "examples/annotation-processor/kotlin") +java8=true ### @@ -20,25 +22,42 @@ green=$(tput setaf 2) red=$(tput setaf 1) std=$(tput sgr0) +if [ "$java8" = true ] +then + export JAVA_HOME="$JAVA8_HOME" + export PATH="$(cygpath "$JAVA_HOME")/bin:$PATH" +fi + +kVer=$(kobaltw --version | awk '{print substr($2, 1, length($2)-1)}') updateWrappers() { - curVer="$(gradle --version | awk '/Gradle/ {print $2}')" - if [ -d gradle ]; then - if [ "$curVer" != "$(./gradlew --version | awk '/Gradle/ {print $2}')" ]; then - gradle -q --console=plain wrapper - echo -e " $(./gradlew --version | awk '/Gradle/') ${green}UPDATED${std}" - else - echo -e " Gradle $curVer UP-TO-DATE" - fi - fi + curVer="$(gradle --version | awk '/Gradle/ {print $2}')" + if [ -d gradle ]; then + if [ "$curVer" != "$(./gradlew --version | awk '/Gradle/ {print $2}')" ]; then + gradle -q --console=plain wrapper + echo -e " $(./gradlew --version | awk '/Gradle/') ${green}UPDATED${std}" + else + echo -e " Gradle $curVer UP-TO-DATE" + fi + fi + if [ -d kobalt ]; then + kw=$(cut -d "=" -f 2 kobalt/wrapper/kobalt-wrapper.properties) + if [ "$kw" = "$kVer" ] + then + echo -e " Kobalt $kw UP-TO-DATE" + else + echo -e "kobalt.version=$kVer" > kobalt/wrapper/kobalt-wrapper.properties + echo -e " Kobalt $kVer ${green}UPDATED${std}" + fi + fi } echo -e "Updating wrappers..." for d in "${!dirs[@]}"; do - if [ "$d" -ne 0 ]; then - cd "${dirs[d]}" || exit 1 - fi - echo -e " ${cyan}${dirs[d]}${std}" - updateWrappers - cd "$pwd" + if [ "$d" -ne 0 ]; then + cd "${dirs[d]}" || exit 1 + fi + echo -e " ${cyan}${dirs[d]}${std}" + updateWrappers + cd "$pwd" done