この構造はzipファイルに含まれています
classes
|--com: A.class, B.class
|--org: C.class, D.class
|--android: X.class
|--stuff: Stuff.inf, info.txt
.class ファイルを含むフォルダーのみを抽出できるようにしたい: com、org、android。そしてそれらを瓶に入れます。これまでのところ、私はこれを行ってきました:
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')
}
}
しかし、次のように、classes フォルダーを含む jar を取得しますclasses/org/apache/http/entity/mime/content/StringBody.class
。org/apache/http/entity/mime/content/StringBody.class
方法はありますか?ありがとう!