Skip to content

Instantly share code, notes, and snippets.

@hakanai
Created May 28, 2019 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hakanai/16888087c40ff559127ecaccbd18a661 to your computer and use it in GitHub Desktop.
Save hakanai/16888087c40ff559127ecaccbd18a661 to your computer and use it in GitHub Desktop.
Reusing file sets in Gradle builds
def commonCrap = copySpec {
from('dir1') {
include '**/*.jar'
}
from('dir2') {
include '**/*.dll'
}
}
task copy1(type: Copy) {
into "${buildDir}/copy1"
with commonCrap
}
task copy2(type: Copy) {
into "${buildDir}/copy2"
with commonCrap
}
task zip3(type: Zip) {
archiveFile = "${buildDir}/blah.zip"
with commonCrap
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment