I have a task in which I am executing a command. And I need to change which parameters are passed to the command depending on whether I do ./gradlew --debug myTask
or ./gradlew myTask
.
I thought that it would be as simple as doing: project.logger.isEnabled(LogLevel.DEBUG)
, but this returns false even when --debug
is passed to Gradle.
-=-=-=-=-=-=-=-=-=-
It seems that you are both correct. I was making an invalid assumption that the main Gradle process would pass its debug flag information to the tooling API, which turned out to be incorrect. The issue was that I needed to pass an additional --debug
flag to the tooling API process.