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 996df87 commit 5eca6a8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- Fix issue with not being able to launch on 1.21.
Fix dependency logic
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
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ org.gradle.daemon=false
org.gradle.parallel=true
version=1.2.2+1.21.1
minecraft_version=1.21.1

additional_minecraft_versions=1.21
minimum_minecraft_version=1.21
minimum_architectury_api_version=13.0.6
minimum_fabric_api_version=0.102.0+1.21

branch=1.21.1
group=io.github.jamalam360
mod_name=JamLib
Expand Down
19 changes: 10 additions & 9 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,17 +96,18 @@ publishing {
}

processResources {
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 "version": project.version,
"minecraft_version": project.minimum_minecraft_version,
"neoforge_version": libs.versions.neoforge.get(),
"architectury_version": libs.versions.architectury.get()
expand substitutions
}

inputs.property "version", project.version
inputs.property "minecraft_version", project.minimum_minecraft_version
inputs.property "neoforge_version", libs.versions.neoforge.get()
inputs.property "architectury_version", libs.versions.architectury.get()
substitutions.each { inputs.property it.key, it.value }
}

shadowJar {
Expand Down

0 comments on commit 5eca6a8

Please sign in to comment.