To anyone who lands on this post via a Internet search, there's now a more
elegant solution as described at the bottom of this page:
http://www.gradle.org/docs/current/userguide/organizing_build_logic.html

Here's an example:

configurations { antssh }
dependencies { 
    antssh group: 'com.jcraft', name: 'jsch', version: '0.1.51'
    antssh group: 'org.apache.ant', name: 'ant-jsch', version: '1.9.3'
}

task ftp << {
    ant {
        taskdef(name: 'scp',
                classname: 'org.apache.tools.ant.taskdefs.optional.ssh.Scp',
                classpath: configurations.antssh.asPath)
        scp(localFile: "myfile.war", remoteTofile: "user@server:myfile.war",
keyfile: "mykeyfile", trust: true, verbose: true, sftp: true)
    }
}



--
View this message in context: 
http://gradle.1045684.n5.nabble.com/optional-task-in-ant-build-xml-tp1434718p5712598.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