I have this structure in a zip file
classes
|--com: A.class, B.class
|--org: C.class, D.class
|--android: X.class
|--stuff: Stuff.inf, info.txt
I want be able to extract only the folders with .class files: com, org, android. And put them on a jar. So far I have dont this:
task createJar {
//unzip the file
FileTree zip = zipTree('runtime.jar')
FileTree zip2 = zip.matching {
include 'classes/**/*.class'
}
zip2.each { file -> println "doing something with $file" }
//create the jar
jar{
from zip2
destinationDir
file('GradleTests/testResult')
}
}
But I get the jar with the classes folder on it, like: classes/org/apache/http/entity/mime/content/StringBody.class And i want it like: org/apache/http/entity/mime/content/StringBody.class
Any idea how? Thanks!