Created
November 10, 2011 13:59
-
-
Save koizuss/1354906 to your computer and use it in GitHub Desktop.
gradle antでftp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repositories { | |
mavenCentral() | |
} | |
configurations { | |
ftpAntTask | |
} | |
dependencies { | |
ftpAntTask("org.apache.ant:ant-commons-net:1.8.2") { | |
module("commons-net:commons-net:1.4.1") { | |
dependencies "oro:oro:2.0.8:jar" | |
} | |
} | |
} | |
task 'ftp-get' << { | |
ant { | |
taskdef(name: 'ftp', | |
classname: 'org.apache.tools.ant.taskdefs.optional.net.FTP', | |
classpath: configurations.ftpAntTask.asPath) | |
ftp(action: 'get', server: 'ftpserver', userid: 'ftpuser', password: 'ftppassword', verbose: true, depends: true, binary: true) { | |
fileset(dir: 'src'){ | |
include(name: '**/*') | |
} | |
} | |
} | |
} | |
// http://gradle.org/current/docs/userguide/organizing_build_logic.html | |
// http://www.jajakarta.org/ant/ant-1.5/docs/ant-1.5/j/docs/manual/OptionalTasks/ftp.html |
how to exclude some directory from ftp uploading?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In case anyone is having trouble getting this working, you can use the ant native
get
task and achieve something in a much simpler way. No extra dependencies, works out of the box: