Is is possible to call a task in Gradle with different parameters?  I've got
a zip task which I'd like to call several times.  The project below defines
a single zip task which uses a properties file to apply filters during the
zip.  I need to create 4 zip files like this (the only differences are the
zip names and the properties file used to filter with).  Is it possible to
do this with one task and call it four times with different parameters?

project(':jboss') {
   
    Properties jboss4LiveProps = new Properties()
    jboss4LiveProps.load(new
FileInputStream("$projectDir/property-files/jboss4-live.properties"))
                 
    dependsOn(':otherProject')
    
    filesToDeploy = dir('files_to_deploy')

    task zipIt(type: Zip, dependsOn: filesToDeploy) {    
        baseName = 'jboss-4.0.2-live'          
        destinationDir = file("files_to_deploy")                             
        from ('jboss-4.0.2-master') {
            include "**/*.xml", "**/*.bat", "**/*.sh", "**/*properties"         
   
            filter(ReplaceTokens, tokens: jboss4LiveProps)
            into 'jboss-4.0.2-live'
        }
        from .....
           
    }
    
    task build(dependsOn: 'zipIt')
        
}
-- 
View this message in context: 
http://gradle.1045684.n5.nabble.com/calling-task-multiple-times-with-different-parameters-tp3290970p3290970.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