<commit_before><!--
  ~ Copyright 2009 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="tutorial_groovy_projects">
    <title>Groovy Quickstart</title>

    <para>To build a Groovy project, you use the <firstterm>Groovy plugin</firstterm>. This plugin extends the Java
        plugin to add Groovy compilation capabilities to your project. Your project can contain Groovy source code,
        Java source code, or a mix of the two. In every other respect, a Groovy project is identical to a Java project,
        which we have already seen in <xref linkend="tutorial_java_projects"/>.
    </para>

    <section>
        <title>A basic Groovy project</title>

        <para>Let's look at an example. To use the Groovy plugin, add the following to your build file:</para>
        <sample id="groovyQuickstart" dir="groovy/quickstart" includeLocation="true" title="Groovy plugin">
            <sourcefile file="build.gradle" snippet="use-plugin"/>
        </sample>
        <para>This will also apply the Java plugin to the project, if it has not already been applied. The Groovy plugin
            extends the <literal>compile</literal> task to look for source files in directory
            <filename>src/main/groovy</filename>, and the <literal>compileTest</literal> task to look for test source
            files in directory <filename>src/test/groovy</filename>. The compile tasks use joint compilation for these
            directories, which means they can contain a mixture of java and groovy source files.
        </para>
        <para>To use the groovy compilation tasks, you must also declare the Groovy version to use and where to find the
            Groovy libraries. You do this by adding a dependency to the <literal>groovy</literal> configuration.
            The <literal>compile</literal> configuration inherits this dependency, so the groovy libraries will
            be included in classpath when compiling Groovy and Java source.  For our sample, we will use Groovy 1.7.10
            from the public Maven repository:</para>
        <sample id="groovyQuickstart" dir="groovy/quickstart" title="Dependency on Groovy 1.7.10">
            <sourcefile file="build.gradle" snippet="groovy-dependency"/>
        </sample>
        <para>Here is our complete build file:</para>
        <sample id="groovyQuickstart" dir="groovy/quickstart" title="Groovy example - complete build file">
            <sourcefile file="build.gradle"/>
        </sample>
        <para>Running <userinput>gradle build</userinput> will compile, test and JAR your project.</para>
    </section>

    <section>
        <title>Summary</title>
        <para>This chapter describes a very simple Groovy project. Usually, a real project will require more than this.
            Because a Groovy project <emphasis>is</emphasis> a Java project, whatever you can do with a Java project,
            you can also do with a Groovy project.
        </para>
        <para>
            You can find out more about the Groovy plugin in <xref linkend="groovy_plugin"/>, and you can find more
            sample Groovy projects in the <filename>samples/groovy</filename> directory in the Gradle distribution.
        </para>
    </section>

</chapter><commit_msg>Doc: Bring groovy versions back into alignment<commit_after><!--
  ~ Copyright 2009 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="tutorial_groovy_projects">
    <title>Groovy Quickstart</title>

    <para>To build a Groovy project, you use the <firstterm>Groovy plugin</firstterm>. This plugin extends the Java
        plugin to add Groovy compilation capabilities to your project. Your project can contain Groovy source code,
        Java source code, or a mix of the two. In every other respect, a Groovy project is identical to a Java project,
        which we have already seen in <xref linkend="tutorial_java_projects"/>.
    </para>

    <section>
        <title>A basic Groovy project</title>

        <para>Let's look at an example. To use the Groovy plugin, add the following to your build file:</para>
        <sample id="groovyQuickstart" dir="groovy/quickstart" includeLocation="true" title="Groovy plugin">
            <sourcefile file="build.gradle" snippet="use-plugin"/>
        </sample>
        <para>This will also apply the Java plugin to the project, if it has not already been applied. The Groovy plugin
            extends the <literal>compile</literal> task to look for source files in directory
            <filename>src/main/groovy</filename>, and the <literal>compileTest</literal> task to look for test source
            files in directory <filename>src/test/groovy</filename>. The compile tasks use joint compilation for these
            directories, which means they can contain a mixture of java and groovy source files.
        </para>
        <para>To use the groovy compilation tasks, you must also declare the Groovy version to use and where to find the
            Groovy libraries. You do this by adding a dependency to the <literal>groovy</literal> configuration.
            The <literal>compile</literal> configuration inherits this dependency, so the groovy libraries will
            be included in classpath when compiling Groovy and Java source.  For our sample, we will use Groovy 2.0.5
            from the public Maven repository:</para>
        <sample id="groovyQuickstart" dir="groovy/quickstart" title="Dependency on Groovy 2.0.5">
            <sourcefile file="build.gradle" snippet="groovy-dependency"/>
        </sample>
        <para>Here is our complete build file:</para>
        <sample id="groovyQuickstart" dir="groovy/quickstart" title="Groovy example - complete build file">
            <sourcefile file="build.gradle"/>
        </sample>
        <para>Running <userinput>gradle build</userinput> will compile, test and JAR your project.</para>
    </section>

    <section>
        <title>Summary</title>
        <para>This chapter describes a very simple Groovy project. Usually, a real project will require more than this.
            Because a Groovy project <emphasis>is</emphasis> a Java project, whatever you can do with a Java project,
            you can also do with a Groovy project.
        </para>
        <para>
            You can find out more about the Groovy plugin in <xref linkend="groovy_plugin"/>, and you can find more
            sample Groovy projects in the <filename>samples/groovy</filename> directory in the Gradle distribution.
        </para>
    </section>

</chapter>
{'fraction_non_alphanumeric': 0.08040266701529612, 'fraction_numerical': 0.003922081317819323, 'mean_word_length': 3.028436018957346, 'pattern_counts': {'":': 0, '<': 123, '<?xml version=': 0, '>': 123, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, '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': '4665872', 'n_tokens_mistral': 2039, 'n_tokens_neox': 1903, 'n_words': 873}