Skip to content

Commit 33afa1a

Browse files
committed
simplify system detection
1 parent ce59278 commit 33afa1a

1 file changed

Lines changed: 13 additions & 15 deletions

File tree

_tui/build.gradle.kts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,25 @@ gitProperties {
3838
}
3939

4040
graalvmNative {
41-
val platform = run {
42-
val name = System.getProperty("os.name").lowercase()
43-
val arch = System.getProperty("os.arch").lowercase()
44-
val system = when {
45-
"linux" in name -> "linux"
46-
"mac" in name -> "macos"
47-
"windows" in name -> "windows"
48-
else -> name
49-
}
50-
"$system-$arch"
51-
}
52-
agent {
53-
enabled.set(false) //TODO add to run?
41+
val name = System.getProperty("os.name").lowercase()
42+
val arch = System.getProperty("os.arch").lowercase()
43+
val type = when {
44+
"linux" in name -> "linux"
45+
"mac" in name -> "macos"
46+
"windows" in name -> "windows"
47+
else -> name
5448
}
5549
binaries {
5650
named("main") {
57-
imageName.set("${rootProject.name}-$platform")
51+
imageName.set("${rootProject.name}-$type-$arch")
5852
useFatJar.set(false)
59-
if ("windows" in platform) buildArgs.add("-H:+AddAllCharsets") //windows-1252 missing
53+
if (type == "windows")
54+
buildArgs.add("-H:+AddAllCharsets") //UnsupportedCharsetException: Cp1252
6055
}
6156
}
57+
agent {
58+
enabled.set(false) //TODO add to run?
59+
}
6260
}
6361

6462
tasks.nativeCompile {

0 commit comments

Comments
 (0)