Hi,
I've checked in the first pass at introducing source sets. There's still
a ways to go. Here's what we have so far:
To define a source set:
source {
integrationTest
}
For source set 'nnn', default values are:
- java src dirs: [$projectDir/src/nnn/java]
- resource dirs: [$projectDir/src/nnn/resources]
- compile classpath: configurations.compile
- runtime classpath: configurations.runtime
- classes dir: $buildDir/classes/nnn
When a source set 'nnn' is added, the following tasks are added:
- compileNnn
- processNnnResources
The Java plugin adds 2 source sets by default, so that we keep the
behaviour we used to have:
- main
- test
You can configure a source set in the same ways you configure other
domain objects:
source {
main {
java {
srcDirs = ['src/java/main']
include 'org/gradle/**'
}
resources {
srcDir 'src/resources/main'
...
}
}
source.main.java.srcDirs = ['src/java/main']
Some more examples at
http://docs.codehaus.org/display/GRADLE/Gradle+0.8+Breaking+Changes
The 'source' property is a SourceSetContainer instance. Each source set
is a SourceSet.
Some issues, things to do, questions:
- Only works for java source and resources so far. I will add groovy and
scala source.
- Eclipse plugin and code quality plugins don't do anything when a
source set is added. They should understand source sets.
- The includes and excludes defined on the source set are only used by
the checkstyle and codenarc tasks so far. They need to be wired up for
all tasks which understand source.
- The compile and processResources tasks of the main source set don't
follow the naming scheme we use for the other source sets. Should we
rename them to compileMain and processMainResources?
- Should we automatically add a jar, javadoc, groovydoc, etc, task for
each source set? Or a rule, where jarNnn adds a synthetic Jar task which
jars up the classes from the source set?
- Should we automatically add compile and runtime configurations for
each source set? That is, when source set nnn is added, should we add
configuations nnnCompile and nnnRuntime (if they don't exist)?
Adam
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email