]> git.seodisparate.com - TurnBasedMinecraftMod/commitdiff
Apply build.gradle changes for reprod. builds
authorStephen Seo <seo.disparate@gmail.com>
Thu, 8 Jun 2023 12:31:55 +0000 (21:31 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Thu, 8 Jun 2023 12:31:55 +0000 (21:31 +0900)
Updated gradle wrapper to 8.1.1.
Updated ForgeGradle to "6.0.+".
Updated "shadow" to "8.1.1".

build.gradle
gradle/wrapper/gradle-wrapper.jar
gradle/wrapper/gradle-wrapper.properties
gradlew
gradlew.bat

index 7a9984e4bc0984589767cafa463042384400f67c..594c1b0cd8a088d6ed9fee04d8c6cfa0529da78c 100644 (file)
@@ -6,8 +6,8 @@ buildscript {
         gradlePluginPortal()
     }
     dependencies {
-        classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
-        classpath 'gradle.plugin.com.github.johnrengelman:shadow:7.1.2'
+        classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '6.0.+', changing: true
+        classpath 'com.github.johnrengelman:shadow:8.1.1'
     }
 }
 apply plugin: 'net.minecraftforge.gradle'
@@ -180,7 +180,8 @@ jar {
             "Implementation-Title": project.name,
             "Implementation-Version": "${version}",
             "Implementation-Vendor" :"TurnBasedMinecraftMod_BK",
-            "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
+            // Do not place timestamp for the sake of reproducible builds
+//            "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
 //            "ContainedDeps": "javamp3-1.0.3.jar"
         ])
     }
@@ -200,6 +201,12 @@ reobf {
     shadowJar {} // reobfuscate the shadowed jar
 }
 
+// Reproducible Builds
+tasks.withType(AbstractArchiveTask).configureEach {
+    preserveFileTimestamps = false
+    reproducibleFileOrder = true
+}
+
 // Example configuration to allow publishing using the maven-publish task
 // we define a custom artifact that is sourced from the reobfJar output task
 // and then declare that to be published
index 7454180f2ae8848c63b8b4dea2cb829da983f2fa..c1962a79e29d3e0ab67b14947c167a862655af9b 100644 (file)
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
index 41dfb87909a877d96c3af4adccce4c7a301b55a2..37aef8d3f0c9fffa920a8290320a6c78095e1591 100644 (file)
@@ -1,5 +1,6 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
+networkTimeout=10000
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index c53aefaa5fc898b78c7265ea99a3bdc09349a7d0..aeb74cbb43e3931a2455a838345c3f6b8131aaa2 100755 (executable)
--- a/gradlew
+++ b/gradlew
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright © 2015-2021 the original authors.
+# Copyright Â© 2015-2021 the original authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 #       Busybox and similar reduced shells will NOT work, because this script
 #       requires all of these POSIX shell features:
 #         * functions;
-#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
-#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;
-#         * compound commands having a testable exit status, especially «case»;
-#         * various built-in commands including «command», «set», and «ulimit».
+#         * expansions Â«$var», Â«${var}», Â«${var:-default}», Â«${var+SET}»,
+#           Â«${var#prefix}», Â«${var%suffix}», and Â«$( cmd )»;
+#         * compound commands having a testable exit status, especially Â«case»;
+#         * various built-in commands including Â«command», Â«set», and Â«ulimit».
 #
 #   Important for patching:
 #
@@ -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,10 @@ 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"'
+APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
 
 # Use the maximum available, or set MAX_FD != -1 to use that value.
 MAX_FD=maximum
@@ -143,12 +140,16 @@ fi
 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=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=SC3045
         ulimit -n "$MAX_FD" ||
             warn "Could not set maximum file descriptor limit to $MAX_FD"
     esac
@@ -193,6 +194,10 @@ 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, and $GRADLE_OPTS can contain fragments of
 #     shell script including quotes and variable substitutions, so put them in
@@ -205,6 +210,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.
index ac1b06f93825db68fb0c0b5150917f340eaa5d02..6689b85beecde676054c39c2408085f41e6be6dc 100644 (file)
@@ -14,7 +14,7 @@
 @rem limitations under the License.\r
 @rem\r
 \r
-@if "%DEBUG%" == "" @echo off\r
+@if "%DEBUG%"=="" @echo off\r
 @rem ##########################################################################\r
 @rem\r
 @rem  Gradle startup script for Windows\r
@@ -25,7 +25,8 @@
 if "%OS%"=="Windows_NT" setlocal\r
 \r
 set DIRNAME=%~dp0\r
-if "%DIRNAME%" == "" set DIRNAME=.\r
+if "%DIRNAME%"=="" set DIRNAME=.\r
+@rem This is normally unused\r
 set APP_BASE_NAME=%~n0\r
 set APP_HOME=%DIRNAME%\r
 \r
@@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
 \r
 set JAVA_EXE=java.exe\r
 %JAVA_EXE% -version >NUL 2>&1\r
-if "%ERRORLEVEL%" == "0" goto execute\r
+if %ERRORLEVEL% equ 0 goto execute\r
 \r
 echo.\r
 echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r
@@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
 \r
 :end\r
 @rem End local scope for the variables with windows NT shell\r
-if "%ERRORLEVEL%"=="0" goto mainEnd\r
+if %ERRORLEVEL% equ 0 goto mainEnd\r
 \r
 :fail\r
 rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r
 rem the _cmd.exe /c_ return code!\r
-if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1\r
-exit /b 1\r
+set EXIT_CODE=%ERRORLEVEL%\r
+if %EXIT_CODE% equ 0 set EXIT_CODE=1\r
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%\r
+exit /b %EXIT_CODE%\r
 \r
 :mainEnd\r
 if "%OS%"=="Windows_NT" endlocal\r