Gradle System Properties: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Internal=
=Internal=
* [[Gradle_Runtime_and_Project_Configuration#Overview|Gradle Runtime and Project Configuration]]
* [[Gradle Properties - Runtime and Project Configuration#Overview|Gradle Properties - Runtime and Project Configuration]]
=Overview=
=Overview=


System properties are provided with the -D command-line option.
System properties can be provided with the -D [[Gradle_Command_Line#-D.3Cproperty-name.3E.3D.3Cproperty-value.3E_System_Properties|command-line options]], loaded from ~/.gradle/gradle.properties or from the project's gradle.properties. <font color=darkgray>Explain precedence.</font>
 
=Properties=
==<tt>org.gradle.console</tt>==
Sets console output coloring and verbosity.
==<tt>org.gradle.daemon</tt>==
==<tt>org.gradle.debug</tt>==
Starts Gradle in debug mode with the JVM listening on port 5005. Used together with [[Gradle_Command_Line#--no-daemon|--no-daemon]]. For more details see: {{Internal|Gradle_Operations#External_Gradle_Process|Gradle Operations &#124; Debug a Gradle Build &#124; External Gradle Process}}
 
==<tt>org.gradle.java.home</tt>==
Specifies the Java home for the Gradle build process.
==<tt>org.gradle.jvmargs</tt>==
Specifies the JVM arguments for the Gradle build process.
<font color=darkgray>TODO: https://docs.gradle.org/current/userguide/build_environment.html#sec:configuring_jvm_memory</font>
===Attaching a Debugger to a Gradle Daemon===
A [[Gradle_Daemon#Overview|Gradle daemon]] can be started in debug mode, so an IDE can attach and debug a build, by specifying JVM debug flags which ensure the JVM starts in suspend mode, as follows:
<syntaxhighlight lang='groovy'>
org.gradle.jvmargs="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=10001"
</syntaxhighlight>
Note that once a Gradle daemon starts in debug mode, it remains in debug mode so the IDE can attach to it and debug successive builds without restarting the daemon. More details about Gradle debugging are available in: {{Internal|Gradle_Operations#External_Gradle_Process|Gradle Operations &#124; Debug a Gradle Build &#124; External Gradle Process}}
==<tt>org.gradle.logging.level</tt>==
{{External|https://docs.gradle.org/current/userguide/logging.html#sec:choosing_a_log_level}}
==<tt>org.gradle.warning.mode</tt>==
==<tt>org.gradle.parallel</tt>==
Parallel mode configuration.
==<tt>org.gradle.workers.max</tt>==
Parallel mode configuration.

Latest revision as of 01:39, 28 March 2021

Internal

Overview

System properties can be provided with the -D command-line options, loaded from ~/.gradle/gradle.properties or from the project's gradle.properties. Explain precedence.

Properties

org.gradle.console

Sets console output coloring and verbosity.

org.gradle.daemon

org.gradle.debug

Starts Gradle in debug mode with the JVM listening on port 5005. Used together with --no-daemon. For more details see:

Gradle Operations | Debug a Gradle Build | External Gradle Process

org.gradle.java.home

Specifies the Java home for the Gradle build process.

org.gradle.jvmargs

Specifies the JVM arguments for the Gradle build process. TODO: https://docs.gradle.org/current/userguide/build_environment.html#sec:configuring_jvm_memory

Attaching a Debugger to a Gradle Daemon

A Gradle daemon can be started in debug mode, so an IDE can attach and debug a build, by specifying JVM debug flags which ensure the JVM starts in suspend mode, as follows:

org.gradle.jvmargs="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=10001"

Note that once a Gradle daemon starts in debug mode, it remains in debug mode so the IDE can attach to it and debug successive builds without restarting the daemon. More details about Gradle debugging are available in:

Gradle Operations | Debug a Gradle Build | External Gradle Process

org.gradle.logging.level

https://docs.gradle.org/current/userguide/logging.html#sec:choosing_a_log_level

org.gradle.warning.mode

org.gradle.parallel

Parallel mode configuration.

org.gradle.workers.max

Parallel mode configuration.