Skip to content

Instantly share code, notes, and snippets.

@kaeawc
Last active August 29, 2015 14:15
Show Gist options
  • Save kaeawc/1c2ef8a433b51352fa95 to your computer and use it in GitHub Desktop.
Save kaeawc/1c2ef8a433b51352fa95 to your computer and use it in GitHub Desktop.
Download a git repository as a Gradle task
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "de.undercouch:gradle-download-task:1.0"
}
}
apply plugin: "download-task"
def github(owner, repo, libName, rev, libFolder) {
def zipFile = file("${owner}-${repo}-${branch}.zip")
download {
src "https://github.com/${owner}/${repo}/archive/${branch}.zip"
dest zipFile
}
def librariesFolder = file("./")
copy {
from zipTree(zipFile)
into librariesFolder
}
delete zipFile
}
github("kaeawc","that-other-project","master")
dependencies {
compile project(':that-other-project')
compile fileTree(dir: 'libs', include: '*.jar')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment