On 15/09/2010, at 12:52 AM, Philip Crotwell wrote:
> Hi
>
> Are source sets tied to the java plugin?
They are at the moment. The java-base plugin adds the sourceSets property, and
the java plugin adds a main and a test source set. But they also add a bunch of
other stuff which you would not want in a non-java project (compile tasks,
test, jar, etc).
>
> I am working on a very small plugin to do some relaxNG preprocessing.
> This might not be used in a java project, but I would like to use the
> source set concept for accessing the input files. For example, the
> default location for the input main rng file might be in
> project.sourceDir/main/relax. I might also want to do something like:
>
> apply plugin:MyRelaxPlugin
>
> sourceSets {
> main {
> relax {
> srcDir 'src/relax'
> }
> }
> }
>
> and then be able to use sourceSets.main.relax within the tasks in my plugin.
>
> I know that the groovy and scala plugins get source sets for free
> because they also use the java plugin internally. But is it possible
> to do something like:
> project.getPlugins().apply(SourceSetsPlugin.class);'
> in a non-java plugin? It seems like the concept of a sourceSet is
> generic to any type of "build", and is not tied to java.
I agree. We plan to separate the source set concept out of the java plugin so
that you can use source sets in a project which has no java, or which even has
no jvm-based source code.
--
Adam Murdoch
Gradle Developer
http://www.gradle.org
CTO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz