From 6f490366ee5158efc4bbda1ec258c593b34797c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Mon, 26 Oct 2026 14:34:44 +0100 Subject: [PATCH 1/6] ci: add Java setup step to functional tests workflow --- .github/workflows/functional.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/functional.yml b/.github/workflows/functional.yml index 56257cb..cec0766 100644 --- a/.github/workflows/functional.yml +++ b/.github/workflows/functional.yml @@ -26,6 +26,14 @@ jobs: - uses: actions/checkout@v7 with: ref: ${{ github.event.pull_request.head.sha }} + + - uses: actions/setup-java@v6 + with: + distribution: zulu + java-version: | + ${{ matrix.java }} + 17 + # Gradle will detect the JVM installation from the ubuntu-latest image and use it - run: ./gradlew runFunctionalTests -PjavaVersion=${{ matrix.java }} --stacktrace env: From b9a5ecad762001463650bb890ce6903dca4a5fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Mon, 26 Oct 2026 14:39:59 +0100 Subject: [PATCH 2/6] ci: update Java setup in workflows --- .github/workflows/functional.yml | 1 - .github/workflows/test.yml | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/functional.yml b/.github/workflows/functional.yml index cec0766..97d3fc7 100644 --- a/.github/workflows/functional.yml +++ b/.github/workflows/functional.yml @@ -32,7 +32,6 @@ jobs: distribution: zulu java-version: | ${{ matrix.java }} - 17 # Gradle will detect the JVM installation from the ubuntu-latest image and use it - run: ./gradlew runFunctionalTests -PjavaVersion=${{ matrix.java }} --stacktrace diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ab3a389..82fe356 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,6 +22,11 @@ jobs: steps: - uses: actions/checkout@v7 + - uses: actions/setup-java@v6 + with: + distribution: zulu + java-version: | + ${{ matrix.java }} # Gradle will detect the JVM installation from the ubuntu-latest image and use it # includes execution of unit tests - run: ./gradlew build -PjavaVersion=${{ matrix.java }} --stacktrace @@ -31,6 +36,10 @@ jobs: name: Jitpack build smoke test steps: - uses: actions/checkout@v7 + - uses: actions/setup-java@v6 + with: + distribution: zulu + java-version: 11 - run: ./gradlew clean build -PjavaVersion=11 --stacktrace env: JITPACK: true From 8b36530d0357b538d8f79b1d6768f50c3a1a4d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Mon, 26 Oct 2026 15:01:50 +0100 Subject: [PATCH 3/6] build: update to Gradle 9.8.2 and refactor project to support new Gradle version --- .github/workflows/functional.yml | 2 ++ .github/workflows/test.yml | 9 +++-- build.gradle.kts | 17 ++++++--- examples/examples.gradle.kts | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 44 +++++++++++++++++------- gradlew.bat | 39 ++++++++++++--------- jitpack.yml | 6 ++-- sdk/sdk.gradle.kts | 2 +- 9 files changed, 81 insertions(+), 42 deletions(-) diff --git a/.github/workflows/functional.yml b/.github/workflows/functional.yml index 97d3fc7..146c9ab 100644 --- a/.github/workflows/functional.yml +++ b/.github/workflows/functional.yml @@ -30,8 +30,10 @@ jobs: - uses: actions/setup-java@v6 with: distribution: zulu + # Last version becomes JAVA_HOME and runs Gradle (needs 17+); matrix version is picked up as toolchain java-version: | ${{ matrix.java }} + 21 # Gradle will detect the JVM installation from the ubuntu-latest image and use it - run: ./gradlew runFunctionalTests -PjavaVersion=${{ matrix.java }} --stacktrace diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 82fe356..2f88781 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,8 +25,10 @@ jobs: - uses: actions/setup-java@v6 with: distribution: zulu + # Last version becomes JAVA_HOME and runs Gradle (needs 17+); matrix version is picked up as toolchain java-version: | ${{ matrix.java }} + 21 # Gradle will detect the JVM installation from the ubuntu-latest image and use it # includes execution of unit tests - run: ./gradlew build -PjavaVersion=${{ matrix.java }} --stacktrace @@ -39,10 +41,13 @@ jobs: - uses: actions/setup-java@v6 with: distribution: zulu - java-version: 11 + # 17 runs Gradle, 11 is used as toolchain + java-version: | + 11 + 17 - run: ./gradlew clean build -PjavaVersion=11 --stacktrace env: JITPACK: true - - run: ./gradlew sdk:publishToMavenLocal --stacktrace + - run: ./gradlew sdk:publishToMavenLocal -PjavaVersion=11 --stacktrace env: JITPACK: true diff --git a/build.gradle.kts b/build.gradle.kts index 5d6b70b..d6319a3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,8 +1,9 @@ import java.net.URL +import javax.inject.Inject import java.nio.file.Files import java.nio.file.StandardCopyOption -val projectVersion: String by project +val projectVersion = property("projectVersion") as String allprojects { group = "com.github.fingerprintjs" @@ -58,7 +59,15 @@ tasks.register("downloadGoogleJavaFormat") { } +// Project.exec was removed in Gradle 9; ExecOperations is the supported replacement +interface InjectedExecOps { + @get:Inject + val execOps: ExecOperations +} + fun Project.registerFormatTasks() { + val execOps = objects.newInstance().execOps + // Resolve lazily: files may be deleted/regenerated between configuration and execution // (e.g., openApiGenerate removes and rewrites sources before format runs). fun srcJavaFiles(): List = fileTree("src") { @@ -76,14 +85,14 @@ fun Project.registerFormatTasks() { val inputFiles = srcJavaFiles() // First, fix the imports - exec { + execOps.exec { executable = googleJavaFormatExeFile.get().asFile.toPath().toString() args = listOf("--replace", "--fix-imports-only") + inputFiles } // Second, format the code. This ensures that the removal of unused imports does not // introduce the need to run another formatting pass to pass the formatting checks. - exec { + execOps.exec { executable = googleJavaFormatExeFile.get().asFile.toPath().toString() args = listOf("--replace", "--skip-javadoc-formatting", "--skip-reflowing-long-strings") + inputFiles } @@ -95,7 +104,7 @@ fun Project.registerFormatTasks() { doLast { println("The following source files need to be formatted:") - exec { + execOps.exec { executable = googleJavaFormatExeFile.get().asFile.toPath().toString() args = listOf("--dry-run", "--set-exit-if-changed", "--skip-javadoc-formatting", "--skip-reflowing-long-strings") + srcJavaFiles() } diff --git a/examples/examples.gradle.kts b/examples/examples.gradle.kts index 2227d93..341a3ee 100644 --- a/examples/examples.gradle.kts +++ b/examples/examples.gradle.kts @@ -1,4 +1,4 @@ -val projectVersion: String by project +val projectVersion = property("projectVersion") as String group = "com.fingerprint" version = projectVersion diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 09523c0..2a66ec2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.2-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 005bcde..f5feea6 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +82,12 @@ 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='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +134,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 +201,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" \ @@ -205,6 +217,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/gradlew.bat b/gradlew.bat index 6a68175..9d21a21 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,8 +13,10 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +27,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -33,20 +36,20 @@ set APP_HOME=%DIRNAME% 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=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" +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%" == "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. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +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 goto fail @@ -56,11 +59,11 @@ 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. +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 goto fail @@ -75,13 +78,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/jitpack.yml b/jitpack.yml index 58867d3..f7f1ebf 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1,5 +1,5 @@ jdk: - - openjdk11 + - openjdk17 install: - - ./gradlew clean build - - ./gradlew sdk:publishToMavenLocal + - ./gradlew clean build -PjavaVersion=17 + - ./gradlew sdk:publishToMavenLocal -PjavaVersion=17 diff --git a/sdk/sdk.gradle.kts b/sdk/sdk.gradle.kts index 3cd98f9..19675e6 100644 --- a/sdk/sdk.gradle.kts +++ b/sdk/sdk.gradle.kts @@ -1,5 +1,5 @@ -val projectVersion: String by project +val projectVersion = property("projectVersion") as String group = "com.github.fingerprintjs" version = projectVersion From 0284e9a5e659dab3256ceab48440b76696b7ae54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Mon, 26 Oct 2026 17:50:02 +0100 Subject: [PATCH 4/6] revert: update to Gradle 9.8.2 and refactor project to support new Gradle version --- .github/workflows/functional.yml | 2 -- .github/workflows/test.yml | 9 ++--- build.gradle.kts | 17 +++------ examples/examples.gradle.kts | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 44 +++++++----------------- gradlew.bat | 39 +++++++++------------ jitpack.yml | 6 ++-- sdk/sdk.gradle.kts | 2 +- 9 files changed, 42 insertions(+), 81 deletions(-) diff --git a/.github/workflows/functional.yml b/.github/workflows/functional.yml index 146c9ab..97d3fc7 100644 --- a/.github/workflows/functional.yml +++ b/.github/workflows/functional.yml @@ -30,10 +30,8 @@ jobs: - uses: actions/setup-java@v6 with: distribution: zulu - # Last version becomes JAVA_HOME and runs Gradle (needs 17+); matrix version is picked up as toolchain java-version: | ${{ matrix.java }} - 21 # Gradle will detect the JVM installation from the ubuntu-latest image and use it - run: ./gradlew runFunctionalTests -PjavaVersion=${{ matrix.java }} --stacktrace diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2f88781..82fe356 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,10 +25,8 @@ jobs: - uses: actions/setup-java@v6 with: distribution: zulu - # Last version becomes JAVA_HOME and runs Gradle (needs 17+); matrix version is picked up as toolchain java-version: | ${{ matrix.java }} - 21 # Gradle will detect the JVM installation from the ubuntu-latest image and use it # includes execution of unit tests - run: ./gradlew build -PjavaVersion=${{ matrix.java }} --stacktrace @@ -41,13 +39,10 @@ jobs: - uses: actions/setup-java@v6 with: distribution: zulu - # 17 runs Gradle, 11 is used as toolchain - java-version: | - 11 - 17 + java-version: 11 - run: ./gradlew clean build -PjavaVersion=11 --stacktrace env: JITPACK: true - - run: ./gradlew sdk:publishToMavenLocal -PjavaVersion=11 --stacktrace + - run: ./gradlew sdk:publishToMavenLocal --stacktrace env: JITPACK: true diff --git a/build.gradle.kts b/build.gradle.kts index d6319a3..5d6b70b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,9 +1,8 @@ import java.net.URL -import javax.inject.Inject import java.nio.file.Files import java.nio.file.StandardCopyOption -val projectVersion = property("projectVersion") as String +val projectVersion: String by project allprojects { group = "com.github.fingerprintjs" @@ -59,15 +58,7 @@ tasks.register("downloadGoogleJavaFormat") { } -// Project.exec was removed in Gradle 9; ExecOperations is the supported replacement -interface InjectedExecOps { - @get:Inject - val execOps: ExecOperations -} - fun Project.registerFormatTasks() { - val execOps = objects.newInstance().execOps - // Resolve lazily: files may be deleted/regenerated between configuration and execution // (e.g., openApiGenerate removes and rewrites sources before format runs). fun srcJavaFiles(): List = fileTree("src") { @@ -85,14 +76,14 @@ fun Project.registerFormatTasks() { val inputFiles = srcJavaFiles() // First, fix the imports - execOps.exec { + exec { executable = googleJavaFormatExeFile.get().asFile.toPath().toString() args = listOf("--replace", "--fix-imports-only") + inputFiles } // Second, format the code. This ensures that the removal of unused imports does not // introduce the need to run another formatting pass to pass the formatting checks. - execOps.exec { + exec { executable = googleJavaFormatExeFile.get().asFile.toPath().toString() args = listOf("--replace", "--skip-javadoc-formatting", "--skip-reflowing-long-strings") + inputFiles } @@ -104,7 +95,7 @@ fun Project.registerFormatTasks() { doLast { println("The following source files need to be formatted:") - execOps.exec { + exec { executable = googleJavaFormatExeFile.get().asFile.toPath().toString() args = listOf("--dry-run", "--set-exit-if-changed", "--skip-javadoc-formatting", "--skip-reflowing-long-strings") + srcJavaFiles() } diff --git a/examples/examples.gradle.kts b/examples/examples.gradle.kts index 341a3ee..2227d93 100644 --- a/examples/examples.gradle.kts +++ b/examples/examples.gradle.kts @@ -1,4 +1,4 @@ -val projectVersion = property("projectVersion") as String +val projectVersion: String by project group = "com.fingerprint" version = projectVersion diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2a66ec2..09523c0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index f5feea6..005bcde 100755 --- a/gradlew +++ b/gradlew @@ -15,8 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# SPDX-License-Identifier: Apache-2.0 -# ############################################################################## # @@ -57,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/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/. @@ -82,12 +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 -P "${APP_HOME:-./}" > /dev/null && printf '%s -' "$PWD" ) || 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='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -134,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 @@ -201,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" \ @@ -217,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 9d21a21..6a68175 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,10 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem -@rem SPDX-License-Identifier: Apache-2.0 -@rem -@if "%DEBUG%"=="" @echo off +@if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -27,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% @@ -36,20 +33,20 @@ set APP_HOME=%DIRNAME% 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" +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-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 +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 @@ -59,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 @@ -78,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/jitpack.yml b/jitpack.yml index f7f1ebf..58867d3 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1,5 +1,5 @@ jdk: - - openjdk17 + - openjdk11 install: - - ./gradlew clean build -PjavaVersion=17 - - ./gradlew sdk:publishToMavenLocal -PjavaVersion=17 + - ./gradlew clean build + - ./gradlew sdk:publishToMavenLocal diff --git a/sdk/sdk.gradle.kts b/sdk/sdk.gradle.kts index 19675e6..3cd98f9 100644 --- a/sdk/sdk.gradle.kts +++ b/sdk/sdk.gradle.kts @@ -1,5 +1,5 @@ -val projectVersion = property("projectVersion") as String +val projectVersion: String by project group = "com.github.fingerprintjs" version = projectVersion From aae3a65d45c2717ed4ad26cac463ed2b5cefbe78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Mon, 26 Oct 2026 17:54:44 +0100 Subject: [PATCH 5/6] ci: update workflows to use JDK 17 for Gradle 8 compatibility --- .github/workflows/check-templates-consistency.yml | 3 ++- .github/workflows/functional.yml | 6 +++--- .github/workflows/test.yml | 11 ++++++++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/check-templates-consistency.yml b/.github/workflows/check-templates-consistency.yml index d293383..b3c9f4b 100644 --- a/.github/workflows/check-templates-consistency.yml +++ b/.github/workflows/check-templates-consistency.yml @@ -10,4 +10,5 @@ jobs: check-template-consistency: uses: fingerprintjs/dx-team-toolkit/.github/workflows/check-template-consistency.yml@v1 with: - generate-command: 'bash ./scripts/generate.sh' \ No newline at end of file + # Gradle 8 can't run on the runner's default JDK 25, use the preinstalled JDK 17 + generate-command: 'JAVA_HOME=$JAVA_HOME_17_X64 bash ./scripts/generate.sh' \ No newline at end of file diff --git a/.github/workflows/functional.yml b/.github/workflows/functional.yml index 97d3fc7..423d840 100644 --- a/.github/workflows/functional.yml +++ b/.github/workflows/functional.yml @@ -29,9 +29,9 @@ jobs: - uses: actions/setup-java@v6 with: - distribution: zulu - java-version: | - ${{ matrix.java }} + distribution: temurin + # Gradle 8 can't run on the runner's default JDK 25 + java-version: 17 # Gradle will detect the JVM installation from the ubuntu-latest image and use it - run: ./gradlew runFunctionalTests -PjavaVersion=${{ matrix.java }} --stacktrace diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 82fe356..b690386 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,6 +11,11 @@ jobs: name: Check source code formatting steps: - uses: actions/checkout@v7 + - uses: actions/setup-java@v6 + with: + distribution: temurin + # Gradle 8 can't run on the runner's default JDK 25 + java-version: 17 - run: ./gradlew :sdk:checkFormat :examples:checkFormat --continue test: @@ -24,9 +29,9 @@ jobs: - uses: actions/checkout@v7 - uses: actions/setup-java@v6 with: - distribution: zulu - java-version: | - ${{ matrix.java }} + distribution: temurin + # Gradle 8 can't run on the runner's default JDK 25 + java-version: 17 # Gradle will detect the JVM installation from the ubuntu-latest image and use it # includes execution of unit tests - run: ./gradlew build -PjavaVersion=${{ matrix.java }} --stacktrace From 59af804671249f650febad843bdbd97f523999ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Mon, 26 Oct 2026 20:01:51 +0100 Subject: [PATCH 6/6] ci: use temurin distribution Co-authored-by: Dan McNulty <212590662+mcnulty-fp@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b690386..60f4258 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,7 +43,7 @@ jobs: - uses: actions/checkout@v7 - uses: actions/setup-java@v6 with: - distribution: zulu + distribution: temurin java-version: 11 - run: ./gradlew clean build -PjavaVersion=11 --stacktrace env: