From 63653bdccef49d77a309e5e5bcf6f94ac1855ee4 Mon Sep 17 00:00:00 2001 From: alpha Date: Tue, 27 Feb 2024 17:50:12 -0600 Subject: [PATCH] Update porting lib and build script --- build.gradle | 42 ++++++++++++------------ gradle.properties | 7 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- src/main/resources/META-INF/mods.toml | 29 ---------------- src/main/resources/fabric.mod.json | 24 ++++++++++++-- 5 files changed, 47 insertions(+), 57 deletions(-) delete mode 100644 src/main/resources/META-INF/mods.toml diff --git a/build.gradle b/build.gradle index f2c12395f..df2eb17c3 100644 --- a/build.gradle +++ b/build.gradle @@ -8,9 +8,8 @@ //file:noinspection GroovyAssignabilityCheck plugins { - id 'fabric-loom' version '1.0-SNAPSHOT' + id 'fabric-loom' version '1.5-SNAPSHOT' id 'maven-publish' - id 'io.github.juuxel.loom-vineflower' version '1.+' id 'org.quiltmc.quilt-mappings-on-loom' version '4.+' } @@ -98,10 +97,21 @@ loom { assemble.dependsOn runDatagen processResources { - inputs.property "version", project.version + Map properties = [ + "version": version, + "minecraft_version": minecraft_version, + "loader_version": loader_version, + "fabric_version": fabric_version, + "reach_entity_attributes_version": reach_entity_attributes_version + ] + for (String module in port_lib_modules.split(",")) + properties.put("port_lib_${module}_version".toString(), port_lib_version) + properties.put("port_lib_tags_version", "3.0") // the weird one + + properties.forEach((k, v) -> inputs.property(k, v)) filesMatching("fabric.mod.json") { - expand "version": project.version + expand properties } } @@ -117,7 +127,12 @@ dependencies { modImplementation("net.fabricmc:fabric-loader:${project.loader_version}") modImplementation("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}") - modImplementation("io.github.fabricators_of_create.Porting-Lib:Porting-Lib:${project.port_lib_version}+1.20-entity-refactor") + for (String module in port_lib_modules.split(",")) { + modApi("io.github.fabricators_of_create.Porting-Lib:$module:$port_lib_version+$minecraft_version") + } + modApi("com.jamieswhiteshirt:reach-entity-attributes:$reach_entity_attributes_version") + api("com.electronwill.night-config:toml:3.6.6") + api("com.electronwill.night-config:core:3.6.6") // compile against the REI API but do not include it at runtime modCompileOnly("me.shedaniel:RoughlyEnoughItems-api-fabric:${project.rei_version}") @@ -163,21 +178,6 @@ task buildOrPublish { } } -def modsTomlSpec = copySpec { - from(sourceSets.main.resources) { - include 'META-INF/mods.toml' - expand 'version': artifact_version, - 'loader_version': loader_version, - 'minecraft_range': minecraft_range - } -} - -// need to copy into each build directory, unfortunately does not seem easy to do this automatically -def buildPaths = [ - "$rootDir/out/production/resources", // IDEA - "$rootDir/bin", // Eclipse -] - jar { manifest { attributes([ @@ -194,7 +194,7 @@ jar { task sourcesJar(type: Jar) { from sourceSets.main.allJava - classifier = 'sources' + archiveClassifier = 'sources' } tasks.withType(JavaCompile).configureEach { diff --git a/gradle.properties b/gradle.properties index a76930c54..6c8db2640 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ minecraft_version=1.20.1 minecraft_range=[1.18.2,1.20) # check these on https://fabricmc.net/versions.html -loader_version=0.14.22 +loader_version=0.15.7 fabric_version=0.90.7+1.20.1 parchment_version=2021.12.19 @@ -20,11 +20,12 @@ jei_version=15.2.0.23 # https://www.curseforge.com/minecraft/mc-mods/architectury-api architectury_version=9.1.12 # https://github.com/JamiesWhiteShirt/reach-entity-attributes/releases -reach_entity_attributes_version = 2.3.0 +reach_entity_attributes_version = 2.4.0 # https://github.com/Ladysnake/Satin/releases satin_version = 1.11.0 modmenu_version=7.2.1 cca_version=5.2.2 -port_lib_version = 2.1.1151 +port_lib_version = 2.2.1-beta +port_lib_modules = accessors,attributes,base,core,common,config,entity,extensions,models,model_loader,networking,tags,transfer,fluids,lazy_registration,loot,utility star_version = 1.5.1 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e750102e0..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-7.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml deleted file mode 100644 index 71fc9c86f..000000000 --- a/src/main/resources/META-INF/mods.toml +++ /dev/null @@ -1,29 +0,0 @@ -modLoader="javafml" -loaderVersion="${loader_range}" -issueTrackerURL="https://github.com/SlimeKnights/Mantle/issues" -logoFile="Mantle.png" -license="MIT" - -[[mods]] - modId="mantle" - version="${version}" - displayName="Mantle" - authors="Slime Knights" - description=''' -Shared code for Slime Knights mods and others. - ''' - displayURL="https://minecraft.curseforge.com/projects/mantle" - -[[dependencies.mantle]] - modId="forge" - mandatory=true - versionRange="${forge_range}" - ordering="NONE" - side="BOTH" - -[[dependencies.mantle]] - modId="minecraft" - mandatory=true - versionRange="${minecraft_range}" - ordering="NONE" - side="BOTH" diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 5cc99ce64..8525d33e5 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -47,8 +47,26 @@ ] }, "depends": { - "fabricloader": ">=0.12.12", - "fabric": ">=0.44.0", - "minecraft": ">=1.19.4" + "minecraft": ">=${minecraft_version}", + "fabric": ">=${fabric_version}", + "fabricloader": ">=${loader_version}", + "porting_lib_accessors": ">=${port_lib_accessors_version}", + "porting_lib_attributes": ">=${port_lib_attributes_version}", + "porting_lib_base": ">=${port_lib_base_version}", + "porting_lib_core": ">=${port_lib_core_version}", + "porting_lib_config": ">=${port_lib_config_version}", + "porting_lib_common": ">=${port_lib_common_version}", + "porting_lib_entity": ">=${port_lib_entity_version}", + "porting_lib_extensions": ">=${port_lib_extensions_version}", + "porting_lib_transfer": ">=${port_lib_transfer_version}", + "porting_lib_fluids": ">=${port_lib_fluids_version}", + "porting_lib_lazy_registration": ">=${port_lib_lazy_registration_version}", + "porting_lib_loot": ">=${port_lib_loot_version}", + "porting_lib_utility": ">=${port_lib_utility_version}", + "porting_lib_models": ">=${port_lib_models_version}", + "porting_lib_model_loader": ">=${port_lib_model_loader_version}", + "porting_lib_networking": ">=${port_lib_common_version}", + "porting_lib_tags": ">=${port_lib_tags_version}", + "reach-entity-attributes": ">=${reach_entity_attributes_version}" } }