Hi,

Anybody know if its possible to copy a task's config to be used in another
task?
For example, I have a project with 2 war tasks, and I don't want to repeat
myself with the same block of config for each. I configured the first one
(as the default war task) as something like:


war 
{
    baseName = "first-$baseName"
    into ('WEB-INF/classes') {
        from rootProject.file('build-gradle')
    }
    into ('WEB-INF/classes') {
        from fileTree(sourceSets.main.classesDir)
        include('com/foo/web/**/*')
    }
    webInf {
        from fileTree("$webAppDir/WEB-INF-1")
    }
}
war.dependsOn(rootProject.propertiesMerge)


Then I want another war task with pretty much the same setup but with a
different webInf & baseName:


task warSecond(type: War, dependsOn: rootProject.propertiesMerge) {
    baseName = "second-$baseName"
    webInf {
        from fileTree("$webAppDir/WEB-INF-2")
    }
    
    // do I have to reproduce the config for the default war task...?
}
warSecond.dependsOn(rootProject.propertiesMerge)


Any way I can get some re-use here?

Thanks!
Chris.
-- 
View this message in context: 
http://gradle.1045684.n5.nabble.com/Using-the-configuration-of-one-task-for-another-tp3256624p3256624.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


Reply via email to