Java Reference
In-Depth Information
Listing 5.19. Inputs/outputs example from the
incrementalBuilds
Gradle sample
The
srcFile
and
destDir
properties of the script are assigned to the
ext
map, which
puts them in the project but avoids any potential conflict with existing
Project
proper-
ties. The
inputs
and
outputs
properties can be assigned to either files or directories
(in other words, the word
file
is interpreted as a
java.io.File
). If both properties
are the same as during the previous run, the code inside the
doLast
block is skipped.
Ant integration
One of the nice features of Gradle is that it includes an instance of
groovy.ant.AntBuilder
as part of the build. That means that anything that can be
done with Ant can be handled inside a Gradle build. That has a couple of consequences.
First, if you already have an Ant build file, you can invoke its tasks inside a Gradle build.
You can even make the Gradle tasks dependent on the Ant tasks.
contains a single task called
hello
:
12
See userguide/ant/dependsOnAntTarget in the distribution.
<project>
<target name="hello">
<echo>Hello, from Ant</echo>