Created
October 24, 2013 12:54
-
-
Save orangeclover/7136711 to your computer and use it in GitHub Desktop.
Gradleでタスクから別のタスクを呼び出す
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
def zipFile ='' | |
task downloadZip(type: MyDownload) { | |
sourceUrl = 'https://dl.dropboxusercontent.com/u/645223/gradle/quickstart.zip' | |
target = file("${temporaryDir}/quickstart.zip") | |
zipFile = target | |
} | |
class MyDownload extends DefaultTask { | |
@Input | |
String sourceUrl | |
@OutputFile | |
File target | |
@TaskAction | |
void download() { | |
ant.get(src: sourceUrl, dest: target) | |
} | |
} | |
task unzip(type: Copy) { | |
def outputDir = file("build") | |
from zipTree(zipFile) | |
into outputDir | |
} | |
task deploy { | |
tasks.downloadZip.execute() | |
tasks.unzip.execute() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment