Gradle Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 38: Line 38:
===Gradle runs in IntelliJ===
===Gradle runs in IntelliJ===
Edit configurations → + → Gradle
Edit configurations → + → Gradle
==Debug a Test Executed with Gradle==
<syntaxhighlight lang='bash'>
gradle test --debug-jvm
</syntaxhighlight>
Gradle will suspend execution right before running tests and wait for debugger connection on port 5005.
<font color=darkgray>
TODO:
* For selecting specific tests for execution, see https://docs.gradle.org/current/userguide/java_testing.html#simple_name_pattern
* Reconcile with [[Testing_with_Gradle_Java_Plugin#Debugging_a_Gradle_Test]]
</font>


==Gradle Daemon Operations==
==Gradle Daemon Operations==

Revision as of 01:42, 28 March 2021

Internal

Installation

Gradle Installation

Command Line

Gradle Command Line

Operations

Debug a Gradle Build

https://docs.gradle.org/current/userguide/troubleshooting.html#sec:troubleshooting_build_logic

External Gradle Process

Gradle Process Instrumentation

Use -Dorg.gradle.debug=true. Experimented with Gradle 6.8.3.

./gradlew -Dorg.gradle.debug=true --no-daemon <task-to-debug>

Even if --no-daemon was specified, Gradle will issue a message similar to:

To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/6.8.3/userguide/gradle_daemon.html#sec:disabling_the_daemon.
> Starting Daemon

and will stop there waiting for the debugger to attach. The JVM will listen on 5005.

If you need to use a Gradle daemon, the daemon JVM can also be instrumented to start in debug mode:

Gradle System Properties | org.gradle.jvmargs | Attaching a Debugger to a Gradle Daemon

IDE Configuration

https://medium.com/dan-on-coding/debugging-gradle-source-code-in-intellij-e1224bec9b6e

TODO: IntelliJ Gradle Support | Configuring Gradle Sources

Gradle runs in IntelliJ

Edit configurations → + → Gradle

Debug a Test Executed with Gradle

gradle test --debug-jvm

Gradle will suspend execution right before running tests and wait for debugger connection on port 5005.

TODO:

Gradle Daemon Operations

Gradle Daemon Operations

TODEPLETE

Operations TODEPLETE