On 09/11/2010 12:18, chris wrote:
Any way I can get some re-use here?
Not sure if that's the best way (I am a Gradle beginner) but it might be
a case for the task generation I saw (and wondered about the usefulness)
in the Getting Started page.
Something like:
def makeWarTask(id) {
task "war$id"(type: War, dependsOn: packaging) {
if (id == 1) bn = 'first' else bn = 'second'
baseName = "$bn-$baseName"
webInf {
from fileTree("$webAppDir/WEB-INF-$id")
}
into ('WEB-INF/classes') {
from rootProject.file('build-gradle')
}
into ('WEB-INF/classes') {
from fileTree(sourceSets.main.classesDir)
include('com/foo/web/**/*')
}
}
}
2.times {
n -> makeWarTask(n)
}
Might need some adjustments, as I know nothing about Groovy beside what
I learned with Gradle...
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email