From 4577788c4b7ffcf08b2de1546e3ca3d400c1ad07 Mon Sep 17 00:00:00 2001 From: TropheusJ Date: Sun, 24 Mar 2024 10:53:38 -0400 Subject: [PATCH] gradle cleanup and fixes --- build.gradle | 91 +++++++++++------------- gradle.properties | 4 +- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle | 2 - 4 files changed, 45 insertions(+), 54 deletions(-) diff --git a/build.gradle b/build.gradle index 163b134ed..08290112e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,7 @@ //file:noinspection GroovyAssignabilityCheck //file:noinspection GroovyAccessibility plugins { - id "fabric-loom" version "1.1.+" - id "io.github.juuxel.loom-quiltflower" version "1.+" // Quiltflower, a better decompiler - id "org.quiltmc.quilt-mappings-on-loom" version "4.2.0" // Quilt Mappings, for parameters and javadoc. Also hashed mojmap. -// id "io.github.p03w.machete" version "1.+" // automatic jar compressing on build + id "fabric-loom" version "1.5.+" id "org.ajoberstar.grgit" version "4.1.1" id "maven-publish" } @@ -29,31 +26,24 @@ if (grgit != null) { repositories { mavenLocal() - maven { url = "https://hephaestus.dev/release" } - maven { url = "https://api.modrinth.com/maven" } - maven { url = "https://maven.bai.lol" } - maven { url = "https://maven.terraformersmc.com/releases/" } - maven { url = "https://maven.parchmentmc.org" } - maven { url = "https://maven.shedaniel.me/" } - maven { url = "https://mvn.devos.one/releases/" } - maven { url = "https://mvn.devos.one/snapshots/" } - maven { url = "https://maven.wispforest.io" } - maven { url = "https://cursemaven.com" } + maven { url = "https://maven.quiltmc.org/repository/release" } // Quilt Mappings + maven { url = "https://maven.parchmentmc.org" } // Parchment + maven { url = "https://mvn.devos.one/snapshots/" } // Serialization Hooks, ForgeTags + maven { url = "https://maven.terraformersmc.com/releases/" } // Mod Menu + maven { url = "https://api.modrinth.com/maven" } // all mods pulled from Modrinth +// maven { url = "https://hephaestus.dev/release" } // Myron maven { url = "https://jitpack.io" content { - includeGroup("com.github.Chocohead") - includeGroup("com.github.LlamaLad7") - includeGroup("com.github.llamalad7.mixinextras") + includeGroup("com.github.Chocohead") // FabricASM + includeGroup("com.github.LlamaLad7") // old Mixin Extras, for Serialization Hooks } } } configurations.configureEach { - resolutionStrategy.eachDependency { - if (requested.module.name == "fabric-loader") { - useVersion(loader_version) - } + resolutionStrategy { + force("net.fabricmc:fabric-loader:$loader_version") } } @@ -61,7 +51,8 @@ dependencies { // dev environment minecraft("com.mojang:minecraft:${project.minecraft_version}") mappings(loom.layered { - it.addLayer(quiltMappings.mappings("org.quiltmc:quilt-mappings:${project.minecraft_version}+build.${project.qm_version}:v2")) + // disabled, hashed is somehow leaking through. +// it.mappings("org.quiltmc:quilt-mappings:$minecraft_version+build.$qm_version:intermediary-v2") it.parchment("org.parchmentmc.data:parchment-${project.minecraft_version}:${project.parchment_version}@zip") it.officialMojangMappings { nameSyntheticMembers = false } }) @@ -79,8 +70,6 @@ dependencies { modImplementation("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}") modImplementation(include("io.github.tropheusj:serialization-hooks:${project.serialization_hooks_version}")) modApi(include("me.alphamode:ForgeTags:${project.forge_tags_version}")) - api(include("com.github.llamalad7.mixinextras:mixinextras-fabric:0.2.0-beta.6")) - annotationProcessor(include("com.github.llamalad7.mixinextras:mixinextras-fabric:0.2.0-beta.6")) modApi(include("com.github.Chocohead:Fabric-ASM:v2.3")) } @@ -88,38 +77,42 @@ dependencies { loom { accessWidenerPath = file("src/main/resources/porting_lib.accesswidener") - sourceSets { - main { - resources { - srcDir("src/generated/resources") - exclude("src/generated/resources/.cache") - } - } - } - - runs { - datagen { - client() - - name "Data Generation" - vmArg "-Dfabric-api.datagen" - vmArg "-Dfabric-api.datagen.output-dir=${file("src/generated/resources")}" - vmArg "-Dfabric-api.datagen.modid=porting_lib" - // from ae2 - - runDir "build/datagen" - } - } + runs { + datagen { + client() + + name "Data Generation" + vmArg "-Dfabric-api.datagen" + vmArg "-Dfabric-api.datagen.output-dir=${file("src/generated/resources")}" + vmArg "-Dfabric-api.datagen.modid=porting_lib" + // from ae2 + + runDir "build/datagen" + } + + configureEach { + vmArg("-Dmixin.debug.export=true") + } + } +} + +sourceSets { + main { + resources { + srcDir("src/generated/resources") + exclude("src/generated/resources/.cache") + } + } } -task buildOrPublish { +tasks.register("buildOrPublish") { group = "build" String mavenUser = System.getenv().MAVEN_USER if (mavenUser != null && !mavenUser.isEmpty()) { - dependsOn(tasks.getByName("publish")) + dependsOn(tasks.named("publish")) println "prepared for publish" } else { - dependsOn(tasks.getByName("build")) + dependsOn(tasks.named("build")) println "prepared for build" } } diff --git a/gradle.properties b/gradle.properties index 38d1e0a41..6eb4eda3b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ mod_version = 1.2.-beta # https://fabricmc.net/develop minecraft_version = 1.18.2 -loader_version = 0.15.6 +loader_version = 0.15.7 fabric_version = 0.77.0+1.18.2 serialization_hooks_version = 0.3.23 @@ -15,7 +15,7 @@ forge_tags_version = 2.1 # Mappings # https://lambdaurora.dev/tools/import_quilt.html -qm_version = 24 +qm_version = 26 # https://parchmentmc.org/docs/getting-started parchment_version = 2022.11.06 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e1bef7e87..17655d0ef 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle b/settings.gradle index 656e0ed53..d03a89d14 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,8 +1,6 @@ pluginManagement { repositories { maven { url = "https://maven.fabricmc.net/" } - maven { url = "https://server.bbkr.space/artifactory/libs-release/" } - maven { url = "https://maven.quiltmc.org/repository/release" } mavenCentral() gradlePluginPortal() }