<commit_before><!--
  ~ Copyright 2011 the original author or authors.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<chapter id='gradle_daemon'>
    <title>The Gradle Daemon</title>
    <section id='what_is_the_daemon'>
        <title>What is the Gradle Daemon?</title>
        <para>From Wikipedia…</para>
        <blockquote>
            A daemon is a computer program that runs as a background process,
            rather than being under the direct control of an interactive user.
        </blockquote>
        <para>
            The Gradle Daemon is a background process that does the heavy lifting of running builds, then stays alive between builds waiting for the next build.
            This allows data and code that is likely to be required in the next build to be kept in memory, ready to go.
            This <emphasis>dramatically</emphasis> improves the performance of subsequent builds.
            Enabling the Gradle Daemon is an extremely cheap way to decrease build times.
        </para>
        <para>
            <emphasis>It is strongly recommended that the Gradle Daemon be enabled on all developer machines</emphasis>.
            It is recommend to <emphasis>not enable</emphasis> the Daemon for Continuous Integration and build server environments (see <xref linkend="when_should_i_not_use_the_gradle_daemon"/>).
        </para>
        <para>
            Gradle manages the Daemon automatically.
            If the build environment is configured to leverage the Daemon, Gradle will automatically start a Daemon process if none are available, or use any existing <emphasis>compatible</emphasis> daemons that are not currently busy.
            If a Daemon process has not been used for 3 hours, it will terminate itself.
            Once a development environment is configured to use the Daemon, it is typically transparent and able to be forgotten about.
        </para>
    </section>
    <section>
        <title>Management and configuration</title>
        <section>
            <title>How do I enable the Gradle Daemon?</title>
            <para>
                There are two recommended ways to enable the Daemon persistently for an environment:
            </para>
            <itemizedlist>
            <listitem>
                <para>Via environment variables - add the flag <literal>-Dorg.gradle.daemon=true</literal> to the <literal>GRADLE_OPTS</literal> environment variable</para>
                <para>Via properties file - add <literal>org.gradle.daemon=true</literal> to the <literal>«GRADLE_USER_HOME»/gradle.properties</literal> file</para>
            </listitem>
            </itemizedlist>
            <note>
                <para>
                    Note, <literal>«GRADLE_USER_HOME»</literal> defaults to <literal>«USER_HOME»/.gradle</literal>, where <literal>«USER_HOME»</literal> is the home directory of the current user.
                    This location can be configured via the <literal>-g</literal> and <literal>--gradle-user-home</literal> command line switches,
                    as well as by the <literal>GRADLE_USER_HOME</literal> environment variable and <literal>org.gradle.user.home</literal> JVM system property.
                </para>
            </note>
            <para>
                Both approaches have the same effect.
                Which one to use is up to personal preference.
                Most Gradle users choose the second option and add the entry to the user <literal>gradle.properties</literal> file.
            </para>
            <para>
                On Windows, this command will enable the Daemon for the current user:
                <programlisting>
                    (if not exist "%HOMEPATH%/.gradle" mkdir "%HOMEPATH%/.gradle") &amp;&amp; (echo org.gradle.daemon=true >> "%HOMEPATH%/.gradle/gradle.properties")
                </programlisting>
                On UNIX-like operating systems, the following Bash shell command will enable the Daemon for the current user:
                <programlisting>
                    touch ~/.gradle/gradle.properties &amp;&amp; echo "org.gradle.daemon=true" >> ~/.gradle/gradle.properties
                </programlisting>
                Once the Daemon is enabled for a build environment in this way, all builds will implicitly use a Daemon.
            </para>
            <para>
                The <literal>--daemon</literal> and <literal>--no-daemon</literal> command line switches enable and disable usage of the Daemon for individual build invocations when using the Gradle command line interface.
                Typically, it is more convenient to enable the Daemon for an environment (e.g. a user account) so that all builds use the Daemon without requiring to remember to supply the <literal>--daemon</literal> switch.
            </para>
        </section>
        <section>
            <title>How do I disable the Gradle Daemon?</title><commit_msg>Update gradleDaemon.xml<commit_after><!--
  ~ Copyright 2011 the original author or authors.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<chapter id='gradle_daemon'>
    <title>The Gradle Daemon</title>
    <section id='what_is_the_daemon'>
        <title>What is the Gradle Daemon?</title>
        <para>From Wikipedia…</para>
        <blockquote>
            A daemon is a computer program that runs as a background process,
            rather than being under the direct control of an interactive user.
        </blockquote>
        <para>
            The Gradle Daemon is a background process that does the heavy lifting of running builds, then stays alive between builds waiting for the next build.
            This allows data and code that is likely to be required in the next build to be kept in memory, ready to go.
            This <emphasis>dramatically</emphasis> improves the performance of subsequent builds.
            Enabling the Gradle Daemon is an extremely cheap way to decrease build times.
        </para>
        <para>
            <emphasis>It is strongly recommended that the Gradle Daemon be enabled on all developer machines</emphasis>.
            It is recommend to <emphasis>not enable</emphasis> the Daemon for Continuous Integration and build server environments (see <xref linkend="when_should_i_not_use_the_gradle_daemon"/>).
        </para>
        <para>
            Gradle manages the Daemon automatically.
            If the build environment is configured to leverage the Daemon, Gradle will automatically start a Daemon process if none are available, or use any existing <emphasis>compatible</emphasis> daemons that are not currently busy.
            If a Daemon process has not been used for 3 hours, it will terminate itself.
            Once a development environment is configured to use the Daemon, it is typically transparent and able to be forgotten about.
        </para>
    </section>
    <section>
        <title>Management and configuration</title>
        <section>
            <title>How do I enable the Gradle Daemon?</title>
            <para>
                There are two recommended ways to enable the Daemon persistently for an environment:
            </para>
            <itemizedlist>
            <listitem>
                <para>Via environment variables - add the flag <literal>-Dorg.gradle.daemon=true</literal> to the <literal>GRADLE_OPTS</literal> environment variable</para>
                <para>Via properties file - add <literal>org.gradle.daemon=true</literal> to the <literal>«GRADLE_USER_HOME»/gradle.properties</literal> file</para>
            </listitem>
            </itemizedlist>
            <note>
                <para>
                    Note, <literal>«GRADLE_USER_HOME»</literal> defaults to <literal>«USER_HOME»/.gradle</literal>, where <literal>«USER_HOME»</literal> is the home directory of the current user.
                    This location can be configured via the <literal>-g</literal> and <literal>--gradle-user-home</literal> command line switches,
                    as well as by the <literal>GRADLE_USER_HOME</literal> environment variable and <literal>org.gradle.user.home</literal> JVM system property.
                </para>
            </note>
            <para>
                Both approaches have the same effect.
                Which one to use is up to personal preference.
                Most Gradle users choose the second option and add the entry to the user <literal>gradle.properties</literal> file.
            </para>
            <para>
                On Windows, this command will enable the Daemon for the current user:
                <programlisting>
                    (if not exist "%USERPROFILE%/.gradle" mkdir "%USERPROFILE%/.gradle") &amp;&amp; (echo org.gradle.daemon=true >> "%USERPROFILE%/.gradle/gradle.properties")
                </programlisting>
                On UNIX-like operating systems, the following Bash shell command will enable the Daemon for the current user:
                <programlisting>
                    touch ~/.gradle/gradle.properties &amp;&amp; echo "org.gradle.daemon=true" >> ~/.gradle/gradle.properties
                </programlisting>
                Once the Daemon is enabled for a build environment in this way, all builds will implicitly use a Daemon.
            </para>
            <para>
                The <literal>--daemon</literal> and <literal>--no-daemon</literal> command line switches enable and disable usage of the Daemon for individual build invocations when using the Gradle command line interface.
                Typically, it is more convenient to enable the Daemon for an environment (e.g. a user account) so that all builds use the Daemon without requiring to remember to supply the <literal>--daemon</literal> switch.
            </para>
        </section>
        <section>
            <title>How do I disable the Gradle Daemon?</title>
{'fraction_non_alphanumeric': 0.07688078438559516, 'fraction_numerical': 0.0016494089617886923, 'mean_word_length': 2.4309965419679345, 'pattern_counts': {'":': 0, '<': 185, '<?xml version=': 0, '>': 193, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '250702', 'n_tokens_mistral': 2759, 'n_tokens_neox': 2618, 'n_words': 1178}