Skip to content

Commit

Permalink
fix: change dependency logic (closes #8)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamalam360 committed Dec 13, 2024
1 parent dc26d21 commit 94e0a58
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- Add `ClientPlayLifecycleEvents`.
- Change dependency logic (closes #8)
19 changes: 10 additions & 9 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 5 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
17 changes: 11 additions & 6 deletions neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions neoforge/src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"

Expand Down

0 comments on commit 94e0a58

Please sign in to comment.