Skip to content

Commit c27d537

Browse files
committed
build: consider version suffix
1 parent d7eeeae commit c27d537

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

build.gradle.kts

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ val backend = gradle.includedBuilds.last()
2222

2323
val versionFromBackend by lazy {
2424
val versions = Properties().apply { load(backend.projectDir.resolve("gradle.properties").inputStream()) }
25-
arrayOf("year", "minor", "patch").map { versions["socha.version.$it"].toString().toInt() }.joinToString(".")
25+
val suffix = property("socha.version.suffix").toString().takeUnless { it.isBlank() }?.let { "-$it" }.orEmpty()
26+
arrayOf("year", "minor", "patch").map { versions["socha.version.$it"].toString().toInt() }.joinToString(".") + suffix
2627
}
2728

2829
group = "sc.gui"
2930
version = try {
3031
Runtime.getRuntime().exec(arrayOf("git", "describe", "--tags"))
31-
.inputStream.reader().readText().trim().ifEmpty { null }
32+
.inputStream.reader().readText().trim().ifEmpty { null }
3233
} catch(e: java.io.IOException) {
3334
println(e)
3435
} ?: "${versionFromBackend}-${System.getenv("GITHUB_SHA")?.takeUnless { it.isEmpty() } ?: "custom"}"
@@ -88,25 +89,35 @@ tasks {
8889

8990
javafx {
9091
version = "17.0.15"
91-
val mods = mutableListOf("javafx.base", "javafx.controls", "javafx.fxml",
92-
"javafx.web", "javafx.media", "javafx.swing") // included because of tornadofx already
92+
val mods = mutableListOf(
93+
"javafx.base", "javafx.controls", "javafx.fxml",
94+
"javafx.web", "javafx.media", "javafx.swing"
95+
) // included because of tornadofx already
9396
// if(debug) mods.addAll(listOf("javafx.swing"))
9497
modules = mods
9598
}
9699

97100
shadowJar {
98101
destinationDirectory.set(buildDir)
99-
archiveClassifier.set("${OperatingSystem.current().familyName.replace(" ", "")}-${System.getProperty("os.arch")}")
102+
archiveClassifier.set(
103+
"${
104+
OperatingSystem.current().familyName.replace(
105+
" ",
106+
""
107+
)
108+
}-${System.getProperty("os.arch")}"
109+
)
100110
manifest {
101111
attributes(
102-
"Add-Opens" to arrayOf(
103-
"javafx.controls/javafx.scene.control.skin",
104-
"javafx.controls/javafx.scene.control",
105-
"javafx.graphics/javafx.scene",
106-
// For accessing InputMap used in RangeSliderBehavior
107-
"javafx.controls/com.sun.javafx.scene.control.inputmap",
108-
// Expose list internals for xstream conversion: https://github.com/x-stream/xstream/issues/253
109-
"java.base/java.util").joinToString(" ")
112+
"Add-Opens" to arrayOf(
113+
"javafx.controls/javafx.scene.control.skin",
114+
"javafx.controls/javafx.scene.control",
115+
"javafx.graphics/javafx.scene",
116+
// For accessing InputMap used in RangeSliderBehavior
117+
"javafx.controls/com.sun.javafx.scene.control.inputmap",
118+
// Expose list internals for xstream conversion: https://github.com/x-stream/xstream/issues/253
119+
"java.base/java.util"
120+
).joinToString(" ")
110121
)
111122
}
112123
}

0 commit comments

Comments
 (0)