Skip to content

Instantly share code, notes, and snippets.

@jccartwright
Created July 20, 2015 13:59
Show Gist options
  • Save jccartwright/7791a57fc08495e14400 to your computer and use it in GitHub Desktop.
Save jccartwright/7791a57fc08495e14400 to your computer and use it in GitHub Desktop.
Gradle copy task
repositories {
mavenCentral()
}
configurations {
dijits
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.3.6'
dijits 'commons-io:commons-io:2.4'
}
task first { task ->
println "inside task ${task.name}..."
doFirst {
println "inside doFirst..."
}
doLast {
println "inside doLast..."
}
}
task unzip(type: Copy) {
from { // use of closure defers evaluation until execution time
configurations.dijits.collect { zipTree(it) }
}
into "$buildDir/dijits"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment