Skip to content

Commit 8a129eb

Browse files
More string templating
1 parent 5d6a813 commit 8a129eb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,28 @@ apply plugin: 'com.palantir.git-version' // Declared in buildSrc/build.gradle
2323

2424
import com.cleanroommc.gradle.helpers.ProjectConstants
2525
import com.cleanroommc.gradle.helpers.tasks.Util
26+
import com.palantir.gradle.gitversion.VersionDetails
2627

2728

2829
def props = project.properties
2930
def sysProps = System.getProperties()
30-
def details = versionDetails()
31+
VersionDetails details = versionDetails()
3132

3233
group = 'com.cleanroommc'
3334

3435
if (project.hasProperty("release")) {
3536
version = details.lastTag
3637
} else if (!project.hasProperty("run_number")) {
37-
version = details.lastTag + "+build." + details.commitDistance
38+
version = "${details.lastTag}+build.${details.commitDistance}"
3839
} else {
39-
version = details.lastTag + "+build." + details.commitDistance + ".run." + props.run_number
40+
version = "${details.lastTag}+build.${details.commitDistance}.run.${props.run_number}"
4041
}
4142

4243
def version_txt = new File(project.projectDir, "version.txt")
4344
version_txt.write(version.toString())
4445

4546
println "Setting up Cleanroom $version"
46-
if (project.hasProperty("run_number")) println("On GitHub runs #" + props.run_number)
47+
if (project.hasProperty('run_number')) println("On GitHub runs #${props.run_number}")
4748
println "Java: ${ -> sysProps['java.version']} | JVM: ${ -> sysProps['java.vm.version']} | Vendor: ${ -> sysProps['java.vendor']} | Architecture: ${ -> sysProps['os.arch']}"
4849

4950
// Initialize buildSrc

0 commit comments

Comments
 (0)