java - How can unpack ZIPs using Gradle and add it to the sourceSets? -
i'm migrating play framework project use gradle. have few play modules zipped. while i've migrated of dependency management gradle, i'm bit stuck zip dependencies. have folder called mods
in turn contains artifact directories containing zip.
mods/ └── play-mockito/ └── mockito-1.0.zip
i'd iterate each of directories in mods
folder , unpack zip in folder directory so:
unpacked-mods/ └── play-mockito/ └── main.java ├── test.java └── anotherclass.java
once unpacked i'd add unpacked directory recursively sourcesets. i'm bit lost gradle , sure how accomplish this.
got far:
task modulate << { def tree = filetree('mods') { include '*/*.zip' } tree.each {file file -> def module = file.path.split('/')[-2] println "unpacking " + module copy { ziptree(file) 'modules/' + module } } } compilejava.dependson(modulate)
Comments
Post a Comment