@@ -12,7 +12,7 @@ buildscript {
1212
1313plugins {
1414 id ' signing'
15- id ' fabric-loom' version ' 1.5 -SNAPSHOT'
15+ id ' fabric-loom' version ' 1.10 -SNAPSHOT'
1616 id ' maven-publish'
1717 id ' io.github.juuxel.loom-quiltflower' version ' 1.10.0'
1818}
@@ -22,11 +22,11 @@ crowdintranslate.crowdinProjectName = 'sodium-extra'
2222crowdintranslate. minecraftProjectName = ' sodium-extra'
2323crowdintranslate. verbose = false
2424
25- sourceCompatibility = JavaVersion . VERSION_17
26- targetCompatibility = JavaVersion . VERSION_17
25+ sourceCompatibility = JavaVersion . VERSION_21
26+ targetCompatibility = JavaVersion . VERSION_21
2727
2828archivesBaseName = project. archives_base_name
29- version = " ${ project.mod_version }${ getVersionType(project.version_type, project.revision) } +mc ${ project.minecraft_version } - ${ getVersionMetadata() } "
29+ version = createVersionString()
3030group = project. maven_group
3131
3232loom {
@@ -71,9 +71,6 @@ dependencies {
7171 // Currently using altrisi/CaffeineConfig until it is officially available through CaffeineMC's maven repository
7272 // Todo: Use https://github.com/CaffeineMC/mixin-config when available
7373 include(modImplementation(" net.caffeinemc:CaffeineConfig:1.3.0+1.17" ))
74- include(modImplementation(" de.guntram.mcmod:crowdin-translate:${ project.crowdin_translate} " ))
75-
76- // modRuntimeOnly "maven.modrinth:lazydfu:0.1.3"
7774}
7875
7976processResources {
@@ -90,7 +87,7 @@ build {
9087
9188tasks. withType(JavaCompile ). configureEach {
9289 // Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
93- it. options. release = 17
90+ it. options. release = 21
9491}
9592
9693java {
@@ -134,22 +131,28 @@ publishing {
134131 }
135132}
136133
137- static def getVersionMetadata () {
138- def build_id = System . getenv(" GITHUB_RUN_NUMBER" )
134+ def createVersionString () {
135+ def builder = new StringBuilder ()
136+
137+ def isReleaseBuild = project. hasProperty(" build.release" )
138+ def buildId = System . getenv(" GITHUB_RUN_NUMBER" )
139139
140- // CI builds only
141- if (build_id != null ) {
142- return " build.${ build_id} "
140+ if (isReleaseBuild) {
141+ builder. append(mod_version)
142+ } else {
143+ builder. append(mod_version. split(' -' )[0 ])
144+ builder. append(" -snapshot" )
143145 }
144- // No tracking information could be found about the build
145- return " unknown"
146- }
147146
148- static def getVersionType (String version_type , String revision ) {
149- version_type = version_type. trim(). toLowerCase()
150- revision = revision. trim(). toLowerCase()
151- if (version_type != " release" ) {
152- return " -${ version_type}${ revision} "
147+ builder. append(" +mc" ). append(minecraft_version)
148+
149+ if (! isReleaseBuild) {
150+ if (buildId != null ) {
151+ builder. append(" -build.${ buildId} " )
152+ } else {
153+ builder. append(" -local" )
154+ }
153155 }
154- return " "
155- }
156+
157+ return builder. toString()
158+ }
0 commit comments