Skip to content

Commit

Permalink
version fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Jul 21, 2024
1 parent 1bec646 commit 64ca73c
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,24 +88,26 @@ if (System.getenv("BUILD_RELEASE") != "true") {
modVersionSuffix += buildNumber != null ? ('+build.' + buildNumber) : '-SNAPSHOT'
artifactVersionSuffix = '-SNAPSHOT' // A non-release artifact is always a SNAPSHOT artifact
}
String finalModVersion = project.mod_version + modVersionSuffix
String fullModVersion = project.mod_version + modVersionSuffix
String fullProjectVersion, fullArtifactVersion

// Example version values:
// project.mod_version 1.0.3 (the base mod version)
// finalModVersion 1.0.3+build.88 (the actual mod version to use in the mod)
// fullProjectVersion v1.0.3-mc1.15.2+build.88 (in build output jar name)
// fullArtifactVersion 1.0.3-mc1.15.2-SNAPSHOT (maven artifact version)
// project.mod_version 1.0.3 (the base mod version)
// modVersionSuffix +build.88 (use github action build number if possible)
// artifactVersionSuffix -SNAPSHOT
// fullModVersion 1.0.3+build.88 (the actual mod version to use in the mod)
// fullProjectVersion v1.0.3-mc1.15.2+build.88 (in build output jar name)
// fullArtifactVersion 1.0.3-mc1.15.2-SNAPSHOT (maven artifact version)

group = project.maven_group
if (System.getenv("JITPACK") == "true") {
// move mc version into archivesBaseName, so jitpack will be able to organize archives from multiple subprojects correctly
base.archivesName = project.archives_base_name + '-mc' + project.minecraft_version
fullProjectVersion = 'v' + finalModVersion
fullProjectVersion = 'v' + project.mod_version + modVersionSuffix
fullArtifactVersion = artifactVersion + artifactVersionSuffix
} else {
base.archivesName = project.archives_base_name
fullProjectVersion = 'v' + finalModVersion + '-mc' + project.minecraft_version
fullProjectVersion = 'v' + project.mod_version + '-mc' + project.minecraft_version + modVersionSuffix
fullArtifactVersion = artifactVersion + '-mc' + project.minecraft_version + artifactVersionSuffix
}
version = fullProjectVersion
Expand All @@ -115,14 +117,14 @@ version = fullProjectVersion
processResources {
inputs.property "id", project.mod_id
inputs.property "name", project.mod_name
inputs.property "version", finalModVersion
inputs.property "version", fullModVersion
inputs.property "minecraft_dependency", project.minecraft_dependency

filesMatching("fabric.mod.json") {
def valueMap = [
"id": project.mod_id,
"name": project.mod_name,
"version": finalModVersion,
"version": fullModVersion,
"minecraft_dependency": project.minecraft_dependency,
]
expand valueMap
Expand Down

0 comments on commit 64ca73c

Please sign in to comment.