You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 19, 2020. It is now read-only.
// Prevent forked processes from stealing focus (on MacOS at least)
tasks.withType(JavaForkOptions) {
// should improve memory on a 64bit JVM
jvmArgs "-XX:+UseCompressedOops"
// should avoid GradleWorkerMain to steal focus
jvmArgs "-Djava.awt.headless=true"
jvmArgs "-Dapple.awt.UIElement=true"
}
This fails to work in Kotlin DSL, build.gradle.kts:
// Prevent forked processes from stealing focus (on MacOS at least)
tasks.withType<JavaForkOptions> {
// should improve memory on a 64bit JVM
jvmArgs "-XX:+UseCompressedOops"
// should avoid GradleWorkerMain to steal focus
jvmArgs "-Djava.awt.headless=true"
jvmArgs "-Dapple.awt.UIElement=true"
}
Since JavaForkOptions does not extend *Task, it will not work.
The text was updated successfully, but these errors were encountered:
tasks is a container of Task elements, it's withType() method only accept Task subtypes.
Your snippet works in Groovy as it is quite lax on type checking.
This should do using the Kotlin DSL:
tasks.all {
when(this) {
isJavaForkOptions-> {
// should improve memory on a 64bit JVM
jvmArgs("-XX:+UseCompressedOops")
// should avoid GradleWorkerMain to steal focus
jvmArgs("-Djava.awt.headless=true")
jvmArgs("-Dapple.awt.UIElement=true")
}
}
}
This works in Groovy DSL,
build.gradle
:This fails to work in Kotlin DSL,
build.gradle.kts
:Since
JavaForkOptions
does not extend*Task
, it will not work.The text was updated successfully, but these errors were encountered: