Skip to content

Commit

Permalink
Update porting lib and build script
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaMode committed Feb 27, 2024
1 parent 6737393 commit 63653bd
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 57 deletions.
42 changes: 21 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.+'
}

Expand Down Expand Up @@ -98,10 +97,21 @@ loom {
assemble.dependsOn runDatagen

processResources {
inputs.property "version", project.version
Map<String, Object> 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
}
}

Expand All @@ -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}")
Expand Down Expand Up @@ -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([
Expand All @@ -194,7 +194,7 @@ jar {

task sourcesJar(type: Jar) {
from sourceSets.main.allJava
classifier = 'sources'
archiveClassifier = 'sources'
}

tasks.withType(JavaCompile).configureEach {
Expand Down
7 changes: 4 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
29 changes: 0 additions & 29 deletions src/main/resources/META-INF/mods.toml

This file was deleted.

24 changes: 21 additions & 3 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
}

0 comments on commit 63653bd

Please sign in to comment.