I am sometimes running into obscure problems with Gradle. Sometimes it helps if i am reading the source files or adding println statements to figure out what i can do and what the state is.
But i would really like to just place a breakpoint and list the internal state of variables. is that possible using Android Studio or IntelliJ ?
I would also love to ctrl-click to the DSL keywords so i can get some context.
Just placing a breakpoint and clicking "debug" from the list of gradle tasks does not work, it just runs the tasks without stopping.
The top-level build.gradle file, located in the root project directory, defines dependencies that apply to all modules in your project. By default, the top-level build file uses the plugins block to define the Gradle dependencies that are common to all modules in the project.
You can't debug Gradle files. We may someday implement this, as it would obviously be a great thing, but it's a long ways off. We're in the process of adding more intelligence about syntax highlighting and analysis of build files. Well, actually, JetBrains is adding it to IntelliJ and we're picking it up. This will get better over the coming weeks and months.
$ export GRADLE_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
$ ./gradlew someTask -Dorg.gradle.daemon=false #!important, disable daemon mode
$ unset GRADLE_OPTS
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With