diff --git a/.github/workflows/BuildTest.yml b/.github/workflows/BuildTest.yml index eb8b1f6a9..309c7d546 100644 --- a/.github/workflows/BuildTest.yml +++ b/.github/workflows/BuildTest.yml @@ -39,26 +39,30 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v6.0.0 with: fetch-tags: true fetch-depth: 0 - name: Set up JDK 21 - uses: actions/setup-java@v4.7.1 + uses: actions/setup-java@v5.0.0 with: java-version: '21' distribution: 'temurin' + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v5 + - name: Get branch name id: branch-names - uses: tj-actions/branch-names@v9 + uses: tj-actions/branch-names@v9.0.2 - name: Fix Gradle permission run: chmod +x ./gradlew - name: Setup Forge env - run: ./gradlew setup -Prun_number=${{ github.run_number }} + run: ./gradlew setup -Prun_number=${{ github.run_number }} --info --stacktrace + - name: Stop Gradle daemon run: ./gradlew --stop @@ -69,7 +73,7 @@ jobs: run: echo "CLEANROOM_VERSION=$(cat version.txt)" >> $GITHUB_ENV - name: setup python - uses: actions/setup-python@v5.6.0 + uses: actions/setup-python@v6.1.0 with: python-version: '3.13' @@ -85,19 +89,19 @@ jobs: run: cp script/MMC-Builder/build/CleanroomMMC.zip ./projects/cleanroom/build/libs/Cleanroom-MMC-instance-${{ env.CLEANROOM_VERSION }}.zip - name: Upload Universal Jar - uses: actions/upload-artifact@v4.6.2 + uses: actions/upload-artifact@v5.0.0 with: name: universal-jar-${{ env.CLEANROOM_VERSION }} path: projects/cleanroom/build/libs/*-universal.jar - name: Upload Installer Jar - uses: actions/upload-artifact@v4.6.2 + uses: actions/upload-artifact@v5.0.0 with: name: installer-jar-${{ env.CLEANROOM_VERSION }} path: projects/cleanroom/build/libs/*-installer.jar - name: Upload MMC pack zip - uses: actions/upload-artifact@v4.6.2 + uses: actions/upload-artifact@v5.0.0 with: name: mmc-pack-zip-${{ env.CLEANROOM_VERSION }} path: projects/cleanroom/build/libs/*.zip diff --git a/.github/workflows/Publish.yml b/.github/workflows/Publish.yml index eabdb94a7..c85f4147b 100644 --- a/.github/workflows/Publish.yml +++ b/.github/workflows/Publish.yml @@ -10,16 +10,19 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v6.0.0 with: fetch-tags: true fetch-depth: 0 - name: Set up JDK 21 - uses: actions/setup-java@v4.7.1 + uses: actions/setup-java@v5.0.0 with: java-version: '21' distribution: 'temurin' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v5 - name: Fix Gradle permission run: chmod +x ./gradlew diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 9740aab57..2dd8960c8 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -12,16 +12,19 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v6.0.0 with: fetch-tags: true fetch-depth: 0 - name: Set up JDK 21 - uses: actions/setup-java@v4.7.1 + uses: actions/setup-java@v5.0.0 with: java-version: '21' distribution: 'temurin' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v5 - name: Fix Gradle permission run: chmod +x ./gradlew @@ -42,7 +45,7 @@ jobs: run: ./gradlew --stop - name: setup python - uses: actions/setup-python@v5.6.0 + uses: actions/setup-python@v6.1.0 with: python-version: '3.13' @@ -65,7 +68,7 @@ jobs: rm projects/cleanroom/build/libs/cleanroom-${{ env.CLEANROOM_VERSION }}-userdev.jar rm projects/cleanroom/build/libs/cleanroom-${{ env.CLEANROOM_VERSION }}-userdev-temp.jar - - uses: ncipollo/release-action@v1.14.0 + - uses: ncipollo/release-action@v1.20.0 with: artifacts: "projects/cleanroom/build/libs/*" generateReleaseNotes: true diff --git a/build.gradle b/build.gradle index 2f1340086..e5681cf48 100644 --- a/build.gradle +++ b/build.gradle @@ -1,18 +1,17 @@ buildscript { repositories { mavenLocal() - mavenCentral() - maven { - name "MinecraftForge" - url "https://maven.minecraftforge.net/" - } maven { - name "Outlands" - url "https://maven.outlands.top/releases/" + name = "Outlands" + url = 'https://maven.outlands.top/releases/' } + mavenCentral() } dependencies { - classpath "net.minecraftforge.gradle:ForgeGradle:6.0.+" + classpath 'top.outlands.gradle:ForgeGradle:6.0.+' + classpath('top.outlands:artifactural:3.0.1') { + transitive = false + } } } diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 6bc173dda..cd2d67e08 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -3,6 +3,6 @@ repositories { } dependencies { - implementation 'org.ow2.asm:asm:9.8' - implementation 'org.ow2.asm:asm-tree:9.8' + implementation 'org.ow2.asm:asm:9.9' + implementation 'org.ow2.asm:asm-tree:9.9' } diff --git a/buildSrc/src/main/groovy/com/cleanroommc/gradle/helpers/tasks/Util.groovy b/buildSrc/src/main/groovy/com/cleanroommc/gradle/helpers/tasks/Util.groovy index d32f54e28..a07267687 100644 --- a/buildSrc/src/main/groovy/com/cleanroommc/gradle/helpers/tasks/Util.groovy +++ b/buildSrc/src/main/groovy/com/cleanroommc/gradle/helpers/tasks/Util.groovy @@ -197,9 +197,9 @@ class Util { new Date().iso8601() } - static def sha1(file) { + static def sha1(File file) { MessageDigest md = MessageDigest.getInstance('SHA-1') - file.eachByte 4096, { bytes, size -> + file.eachByte 4096, {byte[] bytes, int size -> md.update(bytes, 0, size) } return md.digest().collect {String.format "%02x", it}.join() diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 41d9927a4..f8e1ee312 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 3ae1e2f12..23449a2b5 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-8.14.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 1b6c78733..adff685a0 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 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. @@ -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,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 -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -114,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -133,22 +132,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 @@ -165,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -193,18 +198,27 @@ 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, 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" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" +# 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 107acd32c..e509b2dd8 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,89 +1,93 @@ -@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%" == "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%"=="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 - -: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 +@rem SPDX-License-Identifier: Apache-2.0 +@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. 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 + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +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 + +goto fail + +:execute +@rem Setup the command line + + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%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 + +: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/projects/cleanroom/build.gradle b/projects/cleanroom/build.gradle index 72c21ad23..ea5253332 100644 --- a/projects/cleanroom/build.gradle +++ b/projects/cleanroom/build.gradle @@ -26,7 +26,7 @@ def spec_version = details.lastTag evaluationDependsOn(':minecraft') apply plugin: 'java-library' apply plugin: 'maven-publish' -apply plugin: 'net.minecraftforge.gradle.patcher' +apply plugin: 'top.outlands.gradle.patcher' // = 'net.minecraftforge' group = 'com.cleanroommc' @@ -594,7 +594,7 @@ tasks.register('checkSAS') { tasks.register('launcherJson') { dependsOn universalJar inputs.file { - universalJar.archivePath + universalJar.archiveFile } ext { output = file('build/version.json') @@ -641,8 +641,8 @@ tasks.register('launcherJson') { path: "${project.group.replace('.', '/')}/${project.name}/${project.version}/${project.name}-${project.version}.jar", // Do not include the URL so that the installer/launcher won't grab it. This is also why we don't have the universal classifier url : '', - sha1: Util.sha1(universalJar.archivePath), - size: universalJar.archivePath.length() + sha1: Util.sha1(universalJar.archiveFile.get().asFile), + size: universalJar.archiveFile.get().asFile.length() ] ] ] @@ -666,7 +666,7 @@ tasks.register('installerJson') { output = file('build/install_profile.json') installer_tools = "net.minecraftforge:installertools:$props.installer_tools_version" } - inputs.file universalJar.archivePath + inputs.file universalJar.archiveFile inputs.file genClientBinPatches.toolJar inputs.file launcherJson.output outputs.file output @@ -679,8 +679,8 @@ tasks.register('installerJson') { path: "${project.group.replace('.', '/')}/${project.name}/${project.version}/${project.name}-${project.version}.jar", // Do not include the URL so that the installer/launcher won't grab it. This is also why we don't have the universal classifier url : '', - sha1: Util.sha1(universalJar.archivePath), - size: universalJar.archivePath.length() + sha1: Util.sha1(universalJar.archiveFile.get().asFile), + size: universalJar.archiveFile.get().asFile.length() ] ] ] diff --git a/projects/mcp/build.gradle b/projects/mcp/build.gradle index 6d340349a..97efcd5fe 100644 --- a/projects/mcp/build.gradle +++ b/projects/mcp/build.gradle @@ -1,19 +1,13 @@ def props = project.properties -def details = versionDetails() -def spec_version = details.lastTag -apply plugin: 'net.minecraftforge.gradle.mcp' +apply plugin: 'top.outlands.gradle.mcp' repositories { maven { name "outlandsReleases" url "https://maven.outlands.top/releases" } - maven { - name 'MinecraftForge' - url 'https://maven.minecraftforge.net/' - } } mcp { diff --git a/projects/minecraft/build.gradle b/projects/minecraft/build.gradle index eddd94776..2560567e3 100644 --- a/projects/minecraft/build.gradle +++ b/projects/minecraft/build.gradle @@ -1,24 +1,17 @@ import com.cleanroommc.gradle.helpers.ProjectConstants def props = project.properties -def details = versionDetails() -def spec_version = details.lastTag evaluationDependsOn(':mcp') -apply plugin: 'eclipse' -apply plugin: 'net.minecraftforge.gradle.patcher' +apply plugin: 'top.outlands.gradle.patcher' repositories { mavenLocal() - mavenCentral() maven { name "outlandsReleases" url "https://maven.outlands.top/releases" } - maven { - name 'MinecraftForge' - url 'https://maven.minecraftforge.net/' - } + mavenCentral() } dependencies {