From eb983112ebb914b1f7f6b6f669fde9e27c36b20e Mon Sep 17 00:00:00 2001 From: arcade_kappa Date: Sat, 30 Nov 2024 17:38:28 +0800 Subject: [PATCH] Update gradle, mixinbooter & its deps, plugins, add azul option --- .github/workflows/deploy.yml | 10 +++++----- build.gradle | 18 +++++++++++------- gradle.properties | 5 ++++- gradle/scripts/dependencies.gradle | 1 + gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle | 2 +- 6 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e037b80..caff21b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Grant Execute Permission for gradlew run: chmod +x gradlew @@ -29,7 +29,7 @@ jobs: all: true - name: Setup Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '17' distribution: 'zulu' @@ -37,7 +37,7 @@ jobs: - name: Publish to Maven if: steps.properties.outputs.publish_to_maven == 'true' && steps.properties.outputs.publish_to_local_maven == 'true' - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle-build-action@v3 with: arguments: | publish @@ -46,7 +46,7 @@ jobs: - name: Publish to CurseForge if: steps.properties.outputs.publish_to_curseforge == 'true' - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle-build-action@v3 env: CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} with: @@ -54,7 +54,7 @@ jobs: - name: Publish to Modrinth if: steps.properties.outputs.publish_to_modrinth == 'true' - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle-build-action@v3 env: MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} with: diff --git a/build.gradle b/build.gradle index 5354a2f..308ddba 100644 --- a/build.gradle +++ b/build.gradle @@ -9,11 +9,11 @@ plugins { id 'java' id 'java-library' id 'maven-publish' - id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.7' + id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.9' id 'com.gtnewhorizons.retrofuturagradle' version '1.4.1' id 'com.matthewprenger.cursegradle' version '1.4.0' apply false id 'com.modrinth.minotaur' version '2.+' apply false - id 'org.jetbrains.changelog' version '2.2.0' + id 'org.jetbrains.changelog' version '2.2.1' } apply from: 'gradle/scripts/helpers.gradle' @@ -53,8 +53,10 @@ tasks.decompressDecompiledSources.enabled !propertyBool('change_minecraft_source java { toolchain { languageVersion.set(JavaLanguageVersion.of(propertyBool('use_modern_java_syntax') ? 16 : 8)) - // Azul covers the most platforms for Java 8 toolchains, crucially including MacOS arm64 - vendor.set(JvmVendorSpec.AZUL) + if (propertyBool('use_azul_jmv')) { + // Azul covers the most platforms for Java 8 toolchains, crucially including MacOS arm64 + vendor.set(JvmVendorSpec.AZUL) + } } if (propertyBool('generate_sources_jar')) { withSourcesJar() @@ -134,8 +136,8 @@ dependencies { transitive = false } annotationProcessor 'org.ow2.asm:asm-debug-all:5.2' - annotationProcessor 'com.google.guava:guava:24.1.1-jre' - annotationProcessor 'com.google.code.gson:gson:2.8.6' + annotationProcessor 'com.google.guava:guava:32.1.2-jre' + annotationProcessor 'com.google.code.gson:gson:2.8.9' annotationProcessor (mixin) { transitive = false } @@ -298,7 +300,9 @@ tasks.withType(JavaCompile).configureEach { options.release.set(8) javaCompiler.set(javaToolchains.compilerFor { languageVersion.set(JavaLanguageVersion.of(16)) - vendor.set(JvmVendorSpec.AZUL) + if (propertyBool('use_azul_jmv')) { + vendor.set(JvmVendorSpec.AZUL) + } }) } } diff --git a/gradle.properties b/gradle.properties index 861338a..6d6c331 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,9 @@ # Gradle Properties org.gradle.jvmargs = -Xmx3G +# Force AZUL JVM (Will automatically download one if not present) +use_azul_jmv = true + # Source Options # Use Modern Java(9+) Syntax (Courtesy of Jabel) use_modern_java_syntax = false @@ -98,7 +101,7 @@ access_transformer_locations = ${mod_id}_at.cfg # Wiki: https://github.com/SpongePowered/Mixin/wiki + https://github.com/CleanroomMC/MixinBooter/ + https://cleanroommc.com/wiki/forge-mod-development/mixin/preface # Only use mixins once you understand the underlying structure use_mixins = false -mixin_booter_version = 9.1 +mixin_booter_version = 10.2 # A configuration defines a mixin set, and you may have as many mixin sets as you require for your application. # Each config can only have one and only one package root. # Generate missing configs, obtain from mixin_configs and generate file base on name convention: "mixins.config_name.json" diff --git a/gradle/scripts/dependencies.gradle b/gradle/scripts/dependencies.gradle index 14ee488..49aa450 100644 --- a/gradle/scripts/dependencies.gradle +++ b/gradle/scripts/dependencies.gradle @@ -54,6 +54,7 @@ dependencies { // runtimeOnly = runtime dependency // compileOnly = compile time dependency // annotationProcessor = annotation processing dependencies + // embed = bundled dependencies (no shadow involved so no relocation) // Transitive dependencies: // (Dependencies that your dependency depends on) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5c40527..4eaec46 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.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle b/settings.gradle index 2c64da6..13bf891 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,7 +17,7 @@ pluginManagement { plugins { // Automatic toolchain provisioning - id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' } // Due to an IntelliJ bug, this has to be done