<!--
  ~ Copyright 2013 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='wrapper_plugin'>
    <title>Wrapper Plugin</title>

    <note>
        <para>
            The wrapper plugin is currently <link linkend="feature_lifecycle">incubating</link>. Please be aware that the DSL and other configuration may change in later Gradle versions.
        </para>
    </note>

    <para>The Gradle wrapper plugin allows the generation of Gradle wrapper files by adding a <apilink class="org.gradle.api.tasks.wrapper.Wrapper"/>
        task, that generates all files needed to run the build using the Gradle Wrapper.
        Details about the Gradle Wrapper can be found in <xref linkend='gradle_wrapper'/>.
    </para>
    <section id="sec:wrapper_plugin_usage">
        <title>Usage</title>
    <para>
        Without modifying the <literal>build.gradle</literal> file, the wrapper plugin can be auto-applied to the root project of the current build by running
        “<literal>gradle wrapper</literal>” from the command line. This applies the plugin if no task named <literal>wrapper</literal> is already defined in the build.
    </para>
    </section>
    <section id="sec:wrapper_plugin_tasks">
        <title>Tasks</title>
    <para>The wrapper plugin adds the following tasks to the project:</para>
            <table>
                <title>Wrapper plugin - tasks</title>
                <thead>
                    <tr>
                        <td>Task name</td>
                        <td>Depends on</td>
                        <td>Type</td>
                        <td>Description</td>
                    </tr>
                </thead>
                <tr>
                    <td>
                        <literal>wrapper</literal>
                    </td>
                    <td>-</td>
                    <td><apilink class="org.gradle.api.tasks.wrapper.Wrapper"/></td>
                    <td>Generates Gradle wrapper files.</td>
                </tr>
            </table>
    </section>
</chapter>
