Skip to content

Instantly share code, notes, and snippets.

@madmas
Created October 29, 2015 04:09
Show Gist options
  • Save madmas/94069b45079a02804f3a to your computer and use it in GitHub Desktop.
Save madmas/94069b45079a02804f3a to your computer and use it in GitHub Desktop.
build.gradle with vfs-gradle-plugin to upload to webdav
buildscript {
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
dependencies {
classpath 'org.ysb33r.gradle:vfs-gradle-plugin:1.0-betaM'
classpath 'commons-net:commons-net:3.+' // If you want to use ftp
classpath 'commons-httpclient:commons-httpclient:3.1' // If you want http/https
classpath 'com.jcraft:jsch:0.1.48' // If you want sftp
classpath 'org.apache.jackrabbit:jackrabbit-webdav:2.11.1'
}
}
apply plugin : 'org.ysb33r.vfs'
apply plugin: 'java'
apply plugin: 'application'
mainClassName = 'de.mynethome.vfsSample.Application'
// Create a VFS task
task copyReadme << {
vfs {
cp 'https://raw.github.com/ysb33r/groovy-vfs/master/README.md', new File("${buildDir}/tmp/README.md")
}
}
task uploadDistZip << {
// build/distributions/gradleVfsSample.zip
vfs {
cp new File("${buildDir}/distributions/gradleVfsSample.zip"), "webdav://markus:password@myhost/owncloud/remote.php/webdav/UploadExperiment/"
}
}
uploadDistZip.dependsOn distZip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment