diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b4ad77..c30378b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1 @@ -- Add `ClientPlayLifecycleEvents`. +- Change dependency logic (closes #8) diff --git a/fabric/build.gradle b/fabric/build.gradle index f7cef2a..600ae88 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -42,7 +42,7 @@ if (System.getenv("CURSEFORGE_API_KEY") != null && System.getenv("MODRINTH_API_K displayName = "V${project.version} (Fabric ${project.minecraft_version})" changelog = rootProject.file("CHANGELOG.md").text releaseType = project.version.contains("beta") ? "beta" : "release" - gameVersions = [project.minecraft_version, *project.additional_minecraft_versions.split(",")] + gameVersions = [project.minecraft_version, *(project.additional_minecraft_versions == "" ? [] : project.additional_minecraft_versions.split(","))] gameLoaders = ["fabric", "quilt"] mainPublication tasks.remapJar @@ -95,17 +95,18 @@ publishing { } processResources { + def substitutions = [ + "version" : project.version, + "minecraft_version" : project.minimum_minecraft_version, + "fabric_api_version" : project.minimum_fabric_api_version, + "architectury_version": project.minimum_architectury_api_version + ] + filesMatching("fabric.mod.json") { - expand "version": project.version, - "minecraft_version": project.minimum_minecraft_version, - "fabric_api_version": libs.versions.fabric.api.get(), - "architectury_version": libs.versions.architectury.get() + expand substitutions } - inputs.property "version", project.version - inputs.property "minecraft_version", project.minimum_minecraft_version - inputs.property "fabric_api_version", libs.versions.fabric.api.get() - inputs.property "architectury_version", libs.versions.architectury.get() + substitutions.each { inputs.property it.key, it.value } } shadowJar { diff --git a/gradle.properties b/gradle.properties index e21f8d1..0d413d3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,14 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false org.gradle.parallel=true -version=1.2.1+1.21.3 +version=1.2.1-build.2+1.21.3 minecraft_version=1.21.3 + additional_minecraft_versions=1.21.2 minimum_minecraft_version=1.21.2 +minimum_architectury_api_version=14.0.4 +minimum_fabric_api_version=0.104.0+1.21.2 + branch=main group=io.github.jamalam360 mod_name=JamLib diff --git a/libs.versions.toml b/libs.versions.toml index b9f18f7..36560a5 100644 --- a/libs.versions.toml +++ b/libs.versions.toml @@ -1,6 +1,6 @@ [versions] # https://modrinth.com/mod/architectury-api/versions -architectury = "14.0.3" +architectury = "14.0.4" # https://parchmentmc.org/docs/getting-started parchment-minecraft = "1.21" diff --git a/neoforge/build.gradle b/neoforge/build.gradle index 68c58e0..a45edbb 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -48,7 +48,7 @@ if (System.getenv("CURSEFORGE_API_KEY") != null && System.getenv("MODRINTH_API_K displayName = "V${project.version} (NeoForge ${project.minecraft_version})" changelog = rootProject.file("CHANGELOG.md").text releaseType = project.version.contains("beta") ? "beta" : "release" - gameVersions = [project.minecraft_version, *project.additional_minecraft_versions.split(",")] + gameVersions = [project.minecraft_version, *(project.additional_minecraft_versions == "" ? [] : project.additional_minecraft_versions.split(","))] gameLoaders = ["neoforge"] mainPublication tasks.remapJar @@ -96,13 +96,18 @@ publishing { } processResources { - filesMatching("neoforge.mods.toml") { - expand "minecraft_version": project.minimum_minecraft_version, - "architectury_version": libs.versions.architectury.get() + def substitutions = [ + "version" : project.version, + "minecraft_version" : project.minimum_minecraft_version, + "neoforge_version" : project.minimum_minecraft_version.substring(2), + "architectury_version": project.minimum_architectury_api_version + ] + + filesMatching("META-INF/neoforge.mods.toml") { + expand substitutions } - inputs.property "minecraft_version", project.minimum_minecraft_version - inputs.property "architectury_version", libs.versions.architectury.get() + substitutions.each { inputs.property it.key, it.value } } shadowJar { diff --git a/neoforge/src/main/resources/META-INF/neoforge.mods.toml b/neoforge/src/main/resources/META-INF/neoforge.mods.toml index 1019f4f..6f06682 100644 --- a/neoforge/src/main/resources/META-INF/neoforge.mods.toml +++ b/neoforge/src/main/resources/META-INF/neoforge.mods.toml @@ -5,7 +5,7 @@ issueTrackerURL = "https://github.com/JamCoreModding/jamlib/issues" [[mods]] modId = "jamlib" -version = "${file.jarVersion}" +version = "${version}" displayName = "JamLib" displayURL = "https://github.com/JamCoreModding/jamlib" logoFile = "icon.png" @@ -15,7 +15,7 @@ description = '''The platform-agnostic library used in all of JamCore's mods''' [[dependencies.jamlib]] modId = "neoforge" type = "required" -versionRange = "[21,)" +versionRange = "[${neoforge_version},)" ordering = "NONE" side = "BOTH"