diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e6e7e52..2e4721f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,58 +6,20 @@ name: Run build and tests on: push: branches: - - '*' + - '**' pull_request: branches: [ master ] jobs: build: + permissions: + checks: write + pull-requests: write + contents: read environment: CIRelease runs-on: ubuntu-latest - steps: - - name: Set up JDK 8 - uses: actions/setup-java@v4 - with: - java-version: 8 - distribution: temurin - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - run: git fetch --all --tags - - - name: Create .gradle dir - run: mkdir -p $HOME/.gradle - - name: Install gpg secret key - env: - SIGNINGFILE: ${{ secrets.SIGNINGFILE }} - run: | - cat <(echo -e "${{ secrets.SIGNINGFILE }}") | gpg --batch --import - gpg --list-secret-keys --keyid-format LONG - - name: Export gpg file - env: - SIGNINGKEYID: ${{ secrets.SIGNINGKEYID }} - SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }} - run: | - gpg --batch --passphrase="$SIGNINGPASSWORD" --pinentry-mode loopback --export-secret-keys $SIGNINGKEYID > $HOME/.gradle/secrets.gpg - - name: Create gradle sproperties - env: - APIKEY: ${{ secrets.APIKEY }} - APISECRET: ${{ secrets.APISECRET }} - SIGNINGKEYID: ${{ secrets.SIGNINGKEYID }} - SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }} - SONATYPEPASSWORD: ${{ secrets.SONATYPEPASSWORD }} - SONATYPEUSER: ${{ secrets.SONATYPEUSER }} - run: echo -e "gradle.publish.key=$APIKEY\ngradle.publish.secret=$APISECRET\nsigning.keyId=$SIGNINGKEYID\nsigning.password=$SIGNINGPASSWORD\nsigning.secretKeyRingFile=$HOME/.gradle/secrets.gpg\nsonatypeUsername=$SONATYPEUSER\nsonatypePassword=$SONATYPEPASSWORD" > $HOME/.gradle/gradle.properties - - name: Build and test with Gradle - env: - JAVA_OPTS: "-Xmx1024M -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=512M" - GRADLE_OPTS: "-Dorg.gradle.daemon=true" - run: ./gradlew test build :publishIntershopMvnPublicationToMavenRepository -s --scan - - name: Publish Unit Test Results - uses: EnricoMi/publish-unit-test-result-action/linux@v2 - if: always() - with: - files: build/test-results/**/*.xml - - name: Post Build - run: rm -f $HOME/.gradle/gradle.properties && rm -f $HOME/.docker/config.json + - name: Setup + uses: IntershopCommunicationsAG/.github/actions/gradle-plugin-setup@v1.0 + - name: Build + uses: IntershopCommunicationsAG/.github/actions/gradle-plugin-build@v1.0 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 40823f9..4c4a77c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,57 +6,26 @@ name: Run release build from tag on: push: tags: - - '*' + - '**' jobs: - release: + build: + permissions: + checks: write + pull-requests: write + contents: read environment: CIRelease runs-on: ubuntu-latest - steps: - - name: Set up JDK - uses: actions/setup-java@v4 - with: - java-version: 8 - distribution: temurin - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - run: git fetch --all --tag - - name: Create .gradle dir - run: mkdir -p $HOME/.gradle - - id: install-secret-key - name: Install gpg secret key - env: - SIGNINGFILE: ${{ secrets.SIGNINGFILE }} - run: | - cat <(echo -e "${{ secrets.SIGNINGFILE }}") | gpg --batch --import - gpg --list-secret-keys --keyid-format LONG - - id: export-gpg-file - name: Export gpg file - env: - SIGNINGKEYID: ${{ secrets.SIGNINGKEYID }} - SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }} - run: | - gpg --batch --passphrase="$SIGNINGPASSWORD" --pinentry-mode loopback --export-secret-keys $SIGNINGKEYID > $HOME/.gradle/secrets.gpg - - name: Create gradle sproperties - env: - APIKEY: ${{ secrets.APIKEY }} - APISECRET: ${{ secrets.APISECRET }} - SIGNINGKEYID: ${{ secrets.SIGNINGKEYID }} - SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }} - SONATYPEPASSWORD: ${{ secrets.SONATYPEPASSWORD }} - SONATYPEUSER: ${{ secrets.SONATYPEUSER }} - run: echo -e "gradle.publish.key=$APIKEY\ngradle.publish.secret=$APISECRET\nsigning.keyId=$SIGNINGKEYID\nsigning.password=$SIGNINGPASSWORD\nsigning.secretKeyRingFile=$HOME/.gradle/secrets.gpg\nsonatypeUsername=$SONATYPEUSER\nsonatypePassword=$SONATYPEPASSWORD" > $HOME/.gradle/gradle.properties - - name: Run gradle release - env: - JAVA_OPTS: "-Xmx1024M -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=512M" - GRADLE_OPTS: "-Dorg.gradle.daemon=true" - run: ./gradlew -PrunOnCI=true test build :publishIntershopMvnPublicationToMavenRepository :publishPlugins -s --scan - - name: Publish Unit Test Results - uses: EnricoMi/publish-unit-test-result-action/linux@v2 - if: always() + - name: Setup + uses: IntershopCommunicationsAG/.github/actions/gradle-plugin-setup@v1.0 + - name: Release + uses: IntershopCommunicationsAG/.github/actions/gradle-plugin-release@v1.0 with: - files: build/test-results/**/*.xml - - name: Post Build - run: rm -f $HOME/.gradle/gradle.properties + signing-file: ${{ secrets.SIGNINGFILE }} + signing-key-id: ${{ secrets.SIGNINGKEYID }} + signing-password: ${{ secrets.SIGNINGPASSWORD }} + api-key: ${{ secrets.APIKEY }} + api-secret: ${{ secrets.APISECRET }} + sonatype-user: ${{ secrets.SONATYPEUSER }} + sonatype-password: ${{ secrets.SONATYPEPASSWORD }} diff --git a/README.asciidoc b/README.asciidoc index 160d918..cd68ed9 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -1,9 +1,9 @@ = GitFlow Version Plugin -:latestRevision: 1.10.0 +:latestRevision: 2.0.0 :toc: :icons: font -NOTE: This plugins requires Gradle 6 and later. +NOTE: This plugins requires Gradle 8.5 and later. == Summary This plugin calculates the version from the Git repository. The plugin assumes that the used workflow follows the GitFlow principle. See https://infos.seibert-media.net/display/Productivity/Git-Workflows+-+Der+Gitflow-Workflow (DE) or https://datasift.github.io/gitflow/IntroducingGitFlow.html (EN). @@ -29,22 +29,23 @@ version to "local". === Properties [cols="20%,15%,15%,50%", width="95%", options="header"] |=== -|Property | Type | Default value | Description -|*defaultVersion* | String | 1.0.0 | This is the default version if no other information is available -|*mainBranch* | String | master | Name of the main branch, used for release version -|*developBranch* | String | develop | Name of the developer branch, used for integration -|*hotfixPrefix* | String | hotfix | Prefix for hotfix branches, used for bug fix development -|*featurePrefix* | String | feature | Prefix for feature branches, used for feature development -|*releasePrefix* | String | release | Prefix for release branches, used for release preparation -|*supportPrefix* | String | support | Prefix for support branches -|*versionPrefix* | String | version | Prefix for version tags -|*separator* | String | / | Separator for branches and tags -|*versionType* | String | three | Type of the version - *three* digits or *four* digits version number. Possible values are `three` or `four` -|*versionService* | String | (read only) | Service for version calculation -|*version* | String | (read only) | This is the calculated version -|*previousVersion* | String | (read only) | This is the calculated previous version on the branch -|*branchName* | String | (read only) | This is the current branch name -|*fullbranch* | Boolean | false | If this is true, the branch name is used as a part of the version +|Property | Type | Default value | Description +|*defaultVersion* | String | 1.0.0 | This is the default version if no other information is available +|*mainBranch* | String | master | Name of the main branch, used for release version +|*developBranch* | String | develop | Name of the developer branch, used for integration +|*majorBranch* | String | major | Name of the major-version branch, used for next major version development +|*hotfixPrefix* | String | hotfix | Prefix for hotfix branches, used for bug fix development +|*featurePrefix* | String | feature | Prefix for feature branches, used for feature development +|*releasePrefix* | String | release | Prefix for release branches, used for release preparation +|*supportPrefix* | String | support | Prefix for support branches +|*versionPrefix* | String | version | Prefix for version tags +|*separator* | String | / | Separator for branches and tags +|*versionType* | String | three | Type of the version - *three* digits or *four* digits version number. Possible values are `three` or `four` +|*versionService* | String | (read only) | Service for version calculation +|*version* | String | (read only) | This is the calculated version +|*previousVersion* | String | (read only) | This is the calculated previous version on the branch +|*branchName* | String | (read only) | This is the current branch name +|*fullbranch* | Boolean | false | If this is true, the branch name is used as a part of the version |=== ++++ @@ -137,6 +138,10 @@ The version is always -SNAPSHOT. The branch is a feature bran | createChangLog | CreateChangLog | Creates a changelog for the current working copy, starting with the previous version or with the first commit if there is no previous version |=== +== Contribute + +See link:https://github.com/IntershopCommunicationsAG/.github/blob/main/CONTRIBUTE.asciidoc[here] for details. + == License Copyright 2014-2020 Intershop Communications. diff --git a/build.gradle.kts b/build.gradle.kts index dcfe505..451d019 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,13 +14,12 @@ * limitations under the License. */ import org.asciidoctor.gradle.jvm.AsciidoctorTask -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { // project plugins `java-gradle-plugin` groovy - kotlin("jvm") version "1.7.10" + kotlin("jvm") version "1.9.21" // test coverage jacoco @@ -38,67 +37,66 @@ plugins { id("org.asciidoctor.jvm.convert") version "3.3.2" // documentation - id("org.jetbrains.dokka") version "1.7.10" - - // code analysis for kotlin - id("io.gitlab.arturbosch.detekt") version "1.21.0" + id("org.jetbrains.dokka") version "1.9.10" // plugin for publishing to Gradle Portal - - id("com.gradle.plugin-publish") version "1.2.0" + id("com.gradle.plugin-publish") version "1.2.1" } // release configuration group = "com.intershop.gradle.version" description = "Gradle SCM version plugin - SCM based version handling for Gradle" -version = "1.10.3" +// apply gradle property 'projectVersion' to project.version, default to 'LOCAL' +val projectVersion : String? by project +version = projectVersion ?: "LOCAL" - -val sonatypeUsername: String by project +val sonatypeUsername: String? by project val sonatypePassword: String? by project repositories { mavenCentral() + mavenLocal() } +val pluginUrl = "https://github.com/IntershopCommunicationsAG/${project.name}" gradlePlugin { + website = pluginUrl + vcsUrl = pluginUrl plugins { - create("gitflowVersionPlugin") { + create(project.name) { id = "com.intershop.gradle.version.gitflow" implementationClass = "com.intershop.gradle.gitflow.GitFlowVersionPlugin" displayName = project.name description = project.description + tags = listOf("intershop", "version", "release") } } } -pluginBundle { - website = "https://github.com/IntershopCommunicationsAG/${project.name}" - vcsUrl = "https://github.com/IntershopCommunicationsAG/${project.name}" - tags = listOf("intershop", "version", "release") +java { + withJavadocJar() + withSourcesJar() + toolchain { + languageVersion = JavaLanguageVersion.of(17) + } } // set correct project status if (project.version.toString().endsWith("-SNAPSHOT")) { - status = "snapshot'" -} - -detekt { - source = files("src/main/kotlin") - config = files("config/detekt/detekt.yml") + status = "snapshot" } tasks { withType().configureEach { maxParallelForks = 1 - systemProperty("intershop.gradle.versions", "7.5.1") + systemProperty("intershop.gradle.versions", "8.5") useJUnitPlatform() } register("copyAsciiDoc") { includeEmptyDirs = false - val outputDir = file("$buildDir/tmp/asciidoctorSrc") + val outputDir = project.layout.buildDirectory.dir("tmp/asciidoctorSrc") val inputFiles = fileTree(mapOf("dir" to rootDir, "include" to listOf("**/*.asciidoc"), "exclude" to listOf("build/**"))) @@ -107,7 +105,7 @@ tasks { outputs.dir(outputDir) doFirst { - outputDir.mkdir() + outputDir.get().asFile.mkdir() } from(inputFiles) @@ -117,7 +115,7 @@ tasks { withType { dependsOn("copyAsciiDoc") - setSourceDir(file("$buildDir/tmp/asciidoctorSrc")) + setSourceDir(project.layout.buildDirectory.dir("tmp/asciidoctorSrc")) sources(delegateClosureOf { include("README.asciidoc") }) @@ -145,21 +143,19 @@ tasks { xml.required.set(true) html.required.set(true) - html.outputLocation.set(File(project.buildDir, "jacocoHtml")) + html.outputLocation.set(project.layout.buildDirectory.dir("jacocoHtml")) } val jacocoTestReport by tasks jacocoTestReport.dependsOn("test") } - getByName("jar").dependsOn("asciidoctor") - - withType { - kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8.toString() + jar.configure { + dependsOn("asciidoctor") } dokkaJavadoc.configure { - outputDirectory.set(buildDir.resolve("dokka")) + outputDirectory.set(project.layout.buildDirectory.dir("dokka")) } withType { @@ -186,18 +182,18 @@ publishing { from(components["java"]) - artifact(File(buildDir, "docs/asciidoc/html5/README.html")) { + artifact(project.layout.buildDirectory.file("docs/asciidoc/html5/README.html")) { classifier = "reference" } - artifact(File(buildDir, "docs/asciidoc/docbook/README.xml")) { + artifact(project.layout.buildDirectory.file("docs/asciidoc/docbook/README.xml")) { classifier = "docbook" } pom { name.set(project.name) description.set(project.description) - url.set("https://github.com/IntershopCommunicationsAG/${project.name}") + url.set(pluginUrl) licenses { license { name.set("The Apache License, Version 2.0") @@ -219,7 +215,7 @@ publishing { scm { connection.set("git@github.com:IntershopCommunicationsAG/${project.name}.git") developerConnection.set("git@github.com:IntershopCommunicationsAG/${project.name}.git") - url.set("https://github.com/IntershopCommunicationsAG/${project.name}") + url.set(pluginUrl) } } } @@ -244,21 +240,18 @@ signing { dependencies { implementation("com.intershop.gradle.version:extended-version:3.1.0") implementation(gradleKotlinDsl()) - implementation(kotlin("stdlib-jdk8")) //jgit - implementation("org.eclipse.jgit:org.eclipse.jgit:5.13.0.202109080827-r") { + implementation("org.eclipse.jgit:org.eclipse.jgit:6.8.0.202311291450-r") { exclude(group = "org.apache.httpcomponents", module = "httpclient") exclude(group = "org.slf4j", module = "slf4j-api") } - testRuntimeOnly("org.apache.httpcomponents:httpclient:4.5.13") - testRuntimeOnly("org.slf4j:slf4j-api:1.7.25") - - testImplementation("com.github.stefanbirkner:system-rules:1.19.0" ) + testRuntimeOnly("org.apache.httpcomponents:httpclient:4.5.14") + testRuntimeOnly("org.slf4j:slf4j-api:2.0.9") - testImplementation("com.intershop.gradle.test:test-gradle-plugin:4.1.1") + testImplementation("com.intershop.gradle.test:test-gradle-plugin:5.0.1") testImplementation(gradleTestKit()) - testImplementation("commons-io:commons-io:2.7") + testImplementation("commons-io:commons-io:2.15.1") } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 249e583..d64cd49 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 ae04661..1af9e09 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index a69d9cb..1aa94a4 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/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/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,13 +80,11 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# 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"' +# 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 # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +131,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + 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. 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 @@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# 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. + +# 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. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index f127cfd..6689b85 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,91 +1,92 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -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 - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -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 - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -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! -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 - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +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% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +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 + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +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 + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +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! +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 + +:omega diff --git a/src/main/kotlin/com/intershop/gradle/gitflow/extension/VersionExtension.kt b/src/main/kotlin/com/intershop/gradle/gitflow/extension/VersionExtension.kt index d6ec9ca..8b4a238 100644 --- a/src/main/kotlin/com/intershop/gradle/gitflow/extension/VersionExtension.kt +++ b/src/main/kotlin/com/intershop/gradle/gitflow/extension/VersionExtension.kt @@ -267,7 +267,7 @@ open class VersionExtension @Inject constructor(project: Project, val localVersion: Provider = providerFactory.gradleProperty("localVersion") - versionService.localOnly = localVersion.getOrElse("false").lowercase(Locale.getDefault()) == "true" + versionService.localOnly = localVersion.getOrElse("false").lowercase(Locale.getDefault()).trim() == "true" versionService.isMergeBuild = getValueFor("MERGE_BUILD", "mergeBuild", "false") diff --git a/src/main/kotlin/com/intershop/gradle/gitflow/utils/GitVersionService.kt b/src/main/kotlin/com/intershop/gradle/gitflow/utils/GitVersionService.kt index 338d1a6..71e9ece 100644 --- a/src/main/kotlin/com/intershop/gradle/gitflow/utils/GitVersionService.kt +++ b/src/main/kotlin/com/intershop/gradle/gitflow/utils/GitVersionService.kt @@ -17,7 +17,6 @@ package com.intershop.gradle.gitflow.utils import com.intershop.release.version.Version import com.intershop.release.version.VersionType -import com.sun.xml.internal.ws.policy.sourcemodel.wspolicy.NamespaceVersion.getLatestVersion import org.eclipse.jgit.api.Git import org.eclipse.jgit.api.errors.JGitInternalException import org.eclipse.jgit.lib.Constants