John Murph wrote:
On Tue, Sep 22, 2009 at 5:48 PM, Adam Murdoch <[email protected] <mailto:[email protected]>> wrote:

<snip>

    I prefer source over src. The problem with source is that it
    clashes with the source property on project. You'd have to do
    something like

    compileJava {
        source project.source.main.java
    }

    But then, given that the above is the default, maybe we don't care.


    Adam


I don't mind if the default is a bit confusing, so I would go with source without a better reason. However, another possibility is to name the property on project 'sourceset'. This matches the name of the concept in the docs, and reads fine as well.

This is a good idea. I've renamed project.source to project.sourceSets

compileJava {
    source project.sourceset.main.java
}

Every time I read project.source, I have to mentally translate it to "the project's source set". If you rename this, then source as the name of the method is not really confusing. The above means that to compile java it should use the source located in my project's main source set. The .java ending is noise, however, as I already said compileJava. Could we do away with that? Maybe the compileJava task could know that it needs java source?


I think this also a good idea. We could add some kind of source set awareness to various tasks, so that, for example, the Test task knows that it should use the classes out of sourceSet.classesDir, and the classpath out of sourceSet.runtimeClasspath. Or the Compile task knows that it should use the source out of sourceSet.java and the classpath out of sourceSet.compileClasspath.


Adam

Reply via email to