Skip to content

Commit aaf1337

Browse files
committed
chore: jvm arguments changes to support all operating systems
1 parent 1240f96 commit aaf1337

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

build.gradle.kts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import gg.jte.*
22
import org.gradle.api.tasks.testing.logging.*
3+
import org.gradle.internal.os.OperatingSystem
34
import org.jetbrains.dokka.gradle.*
45
import org.jetbrains.kotlin.config.*
56
import org.jetbrains.kotlin.gradle.tasks.*
@@ -42,7 +43,7 @@ val appMainClass: String by project
4243
application {
4344
mainClass.set(appMainClass)
4445

45-
val tmp = "/tmp/" // "${System.getProperty("java.io.tmpdir")}${File.pathSeparator}"
46+
val tmp = if (OperatingSystem.current().isWindows) "c:/TEMP" else "/tmp"
4647
applicationDefaultJvmArgs += listOf(
4748
"--show-version",
4849
"--enable-preview",
@@ -51,12 +52,12 @@ application {
5152
"-Xmx128M",
5253
"-XX:+PrintCommandLineFlags",
5354
"-XX:+UseZGC",
54-
"-Xlog:gc*:${tmp}$name-gc.log",
55-
"-XX:StartFlightRecording:filename=${tmp}$name.jfr,settings=default.jfc,name=$name,maxsize=100m,dumponexit=true",
55+
"-Xlog:gc*:\"$tmp/$name-gc-%p-%t.log\":time,uptime,level,tid,tags:filecount=5,filesize=10m",
56+
"-XX:StartFlightRecording:filename=$tmp/$name.jfr,settings=default.jfc,name=$name,maxsize=100m,dumponexit=true",
5657
"-XX:FlightRecorderOptions:stackdepth=128",
5758
"-XX:+HeapDumpOnOutOfMemoryError",
58-
"-XX:HeapDumpPath=${tmp}$name.hprof",
59-
"-XX:ErrorFile=${tmp}java-error-$name-%p.log",
59+
"-XX:HeapDumpPath=$tmp/$name-%p.hprof",
60+
"-XX:ErrorFile=$tmp/$name-hs-err-%p.log",
6061
"-Dfile.encoding=UTF-8",
6162
"-Djava.awt.headless=true",
6263
"-Djdk.attach.allowAttachSelf=true",

0 commit comments

Comments
 (0)