@@ -5,6 +5,7 @@ val relocationPrefix: String by project
55val mcVersion: String by project
66val groupId = findProperty(" group" ) as String
77val javaVersion: String by project
8+ val snapshot = (findProperty(" snapshot" ) as String ).toBooleanStrict()
89// endregion
910
1011plugins {
@@ -18,7 +19,11 @@ plugins {
1819}
1920
2021group = groupId
21- version = " $mcVersion -1.1.9"
22+ version = buildString {
23+ append(mcVersion)
24+ append(" -1.1.9" )
25+ if (snapshot) append(" -SNAPSHOT" )
26+ }
2227
2328repositories {
2429 mavenCentral()
@@ -108,7 +113,7 @@ val generateConstants by tasks.registering {
108113 inputs.property(" libs.versions.commandapi" , libs.versions.commandapi.get().toString())
109114 inputs.property(" libs.versions.placeholder.api" , libs.versions.placeholder.api.get().toString())
110115 inputs.property(" libs.versions.luckperms" , libs.versions.luckperms.get().toString())
111- inputs.property(" version" , rootProject.findProperty(" version" ) as String )
116+ inputs.property(" version" , rootProject.findProperty(" version" ) as String + if (snapshot) " -SNAPSHOT " else " " )
112117 outputs.dir(constantsOutputDir)
113118
114119 doLast {
@@ -132,7 +137,7 @@ val generateConstants by tasks.registering {
132137 | const val PLACEHOLDER_API_VERSION = "${libs.versions.placeholder.api.get()} "
133138 | const val LUCKPERMS_VERSION = "${libs.versions.luckperms.get()} "
134139 |
135- | const val SURF_API_FULL_VERSION = "${rootProject.findProperty(" version" ) as String } "
140+ | const val SURF_API_FULL_VERSION = "${rootProject.findProperty(" version" ) as String + if (snapshot) " -SNAPSHOT " else " " } "
136141 |}
137142 """ .trimMargin()
138143
0 commit comments