6

Inside my Gradle-script I want to check if the tests are started in debug mode by Intellij Idea.

I've already tried the following:

How can I find out if Intellij started the tests in debug mode?

It could be something like detecting if --debug-jvm isset, but as of now, I cannot find the process which starts the tasks. (I've tried something like ps aux | grep test which got me no results)

jmattheis
  • 10,494
  • 11
  • 46
  • 58
  • I solved this by adding a VM option `-Didea` to Gradle configuration in IntelliJ (Build, Execution, Deployment -> Build Tools -> Gradle -> Gradle VM options). Then in Gradle script, there is a condition `boolean idea2017 = System.getProperty('idea') != null` – Václav Kužel Apr 17 '18 at 16:01
  • 2
    @VáclavKužel yeah with this it would be possible to check if gradle was executed from intellij but not if tests were executed in debug mode. – jmattheis Apr 18 '18 at 09:11

0 Answers0