On 17/02/10 6:39 PM, Peter Ledbrook wrote:
The GroovyCompile task provides option 2 already, so you could just add
'GrailsPlugin.groovy' to the 'compileGroovy' task:

sourceSets.main.groovy.srcDirs 'grails-api/conf', ...
compileGroovy.source 'GrailsPlugin.groovy'
The ".source" seems to override the ".srcDirs" setting, so only the
plugin descriptor class is compiled. If this is a bug, I can package
up the project and attach it to an issue.


No, this is the intended behaviour (for good or bad). Calling compileGroovy.source() explicitly throws away the default. I forgot about this. This one should work:

sourceSets.main.groovy.srcDirs 'grails-api/conf', ...
compileGroovy.source sourceSets.main.groovy
compileGroovy.source 'GrailsPlugin.groovy'

I wonder if discarding the default source is a good idea or not. Perhaps source() should always add to what's there, default or otherwise. You can always discard the source by doing source = ...

Another would be to add the project dir to the main source set and use a
selector closure to ignore everything else under project dir:

groovy {
    srcDirs 'grails-api/conf', ...
    srcDir projectDir
    exclude { FileTreeElement fte ->  fte.file.parentFile == projectDir&&
file.name != 'GrailsPlugin.groovy' }
}
I seem to be getting similar behaviour here. ".srcDir" overrides the
".srcDirs" setting.


srcDir() is just an alias for srcDirs(), which is supposed to add the directory. What does sourceSets.main.groovy.srcDirs contain after this closure has executed?


--
Adam Murdoch
Gradle Developer
http://www.gradle.org


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

   http://xircles.codehaus.org/manage_email


Reply via email to