Java Reference
In-Depth Information
:compileJava
:compileGroovy UP-TO-DATE
:processResources UP-TO-DATE
:classes
:jar
:assemble
:compileTestJava
:compileTestGroovy
:processTestResources UP-TO-DATE
:testClasses
:test
:check
:build
BUILD SUCCESSFUL
Both the compileGroovy and compileTestGroovy tasks are new, but everything
else proceeds normally. The classes are compiled, the tests run, and the HTML test report
is produced.
That's the basic structure of a Gradle build file when dealing with Java, Groovy, or mixed
Java/Groovy projects. Similar files are shown throughout this topic. To illustrate some in-
teresting Gradle features I'll now consider several use cases that often come up in practice.
5.6.2. Interesting configurations
Gradle builds are used throughout this topic. I'll bring up lots of different options when
discussing specific examples in context, but here I can discuss a few interesting ideas.
Custom source sets
First, one of the running themes in this topic is that separating Groovy source code from
Java source code is rather artificial. What if you wanted to use the same source folder for
both, as an Eclipse project might do? Here's an easy customized project layout to do so:
sourceSets {
main {
java { srcDirs = [] }
groovy { srcDir 'src' }
}
test {
java { srcDirs = [] }
groovy { srcDir 'src' }
Search WWH ::




Custom Search