diff --git a/common.gradle b/common.gradle index 8d5f113..423762f 100644 --- a/common.gradle +++ b/common.gradle @@ -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 @@ -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