Hello!
I`m still not getting how gradle works. What I need is to control behaviour
of modules in my multi project build from root project. For start I need to
override default resources folder "resourceDirNames". The problem is that
gradle is processing my scripts in absolutely wrong module.
I have two modules - app with artifactType=jar and web-main with
artifactType=war. My build.gradle script:
subprojects {
usePlugin('java')
...
if (project.artifactType.equals('jar') ||
project.artifactType.equals('ejb')) {
usePlugin('java')
project.processResources.doFirst {
println "I'm $project.name"
println "type: $project.artifactType"
println project.resourceDirs
project.resourceDirNames = new LinkedList()
project.resourceDirNames.add "/main/resources/default"
println project.resourceDirs
}
}
}
I`m using command:
gradle -C=off app:test
What I get is:
:app:compile
:app:compileTests
:app:processResources
I'm web-main
type: war
[C:\work\perf\SCM\Build\Ant\Project\Release_2_0_1\MDL\web-main\src\main\resource
s]
[C:\work\perf\SCM\Build\Ant\Project\Release_2_0_1\MDL\web-main\src\main\resource
s\default]
:app:processTestResources
:app:test
BUILD SUCCESSFUL
Total time: 8.36 secs
As I see the app project is building but its using properties from web-main,
which should be ignored in this case at all. In app/build/classes there are
wrong resources too of course.
--
View this message in context:
http://www.nabble.com/Override-resources-folder-tp25489224p25489224.html
Sent from the gradle-user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email