Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save artem-zinnatullin/4c250e04636e25797165 to your computer and use it in GitHub Desktop.
Save artem-zinnatullin/4c250e04636e25797165 to your computer and use it in GitHub Desktop.
Prevent Gradle Workers from taking focus! #DevelopersLikeComfort
// You can place it in the root build.gradle
allprojects {
tasks.withType(JavaForkOptions) {
// Forked processes like GradleWorkerMain for tests won't steal focus!
jvmArgs '-Djava.awt.headless=true'
}
}
@artem-zinnatullin
Copy link
Author

Another Mac OS specific flag -Dapple.awt.UIElement=true

@edenman
Copy link

edenman commented Jun 28, 2016

for whatever reason, the jvmArgs thing stopped working for me recently. I had to add this to my .bashrc: export JAVA_TOOL_OPTIONS='-Djava.awt.headless=true'

@artem-zinnatullin
Copy link
Author

Uh, same for me, thanks for receipt @edenman

@twixthehero
Copy link

if you use Gradle Kotlin DSL: gradle/kotlin-dsl-samples#439 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment