Hello, everybody!

ATM, to get a set of roots of all the source directories of a project
(proj) I do the following:

    def allDirs = []

    SourceSet mainSrcSet =
proj.convention.plugins['java']?.sourceSets?."${SourceSet.MAIN_SOURCE_SET_NAME}"
    SourceSet testSrcSet =
proj.convention.plugins['java']?.sourceSets?."${SourceSet.TEST_SOURCE_SET_NAME}"

    mainSrcSet?.java?.srcDirs?.each { allDirs << it }
    mainSrcSet?.resources?.srcDirs?.each { allDirs << it }
    testSrcSet?.java?.srcDirs?.each { allDirs << it }
    testSrcSet?.resources?.srcDirs?.each { allDirs << it }

This has an obvious flaw if project is groovy there will be a missing
source root. Is there a simple way to collect the source roots
independently of what plugin was applied? Something like this:

proj.srcDirs?.each { allDirs << it }
proj.testSrcDirs?.each { allDirs << it }

?

Cheers,
Alex.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to