File tree 1 file changed +3
-13
lines changed
1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -177,32 +177,22 @@ task dist(type: Sync) {
177
177
* list, throws an exception.
178
178
*/
179
179
boolean checkZipContents (zipFileName , toCheck ) {
180
- // When you create a zip tree, the jar gets unpacked. So the paths 'inside' the jar
181
- // end up looking a bit like this:
182
- // /tmp/expandedArchives/larsServerPackage.jar_1vjjzyok4kl5hstxnvin6rjqx/wlp/usr/servers/larsServer/LICENSE
183
- // so the matching logic is a bit ick.
184
180
FileTree tree = zipTree(zipFileName)
185
- boolean found = tree. find { File file ->
181
+ tree. visit { FileVisitDetails details ->
186
182
def foundFiles = []
187
183
toCheck. each {
188
- if (file . getPath(). endsWith (it)) {
184
+ if (details . getPath(). equals (it)) {
189
185
foundFiles << it
190
186
}
191
187
}
192
188
foundFiles. each {
193
189
toCheck. remove(it)
194
190
}
195
- if (toCheck) {
196
- return false
197
- }
198
- // toCheck is empty, so all files were found
199
- return true ;
200
191
}
201
192
202
- if (! found ) {
193
+ if (toCheck ) {
203
194
throw new GradleException (" Couldn't find files '${ toCheck} ' in the zip file '${ zipFileName} '" )
204
195
}
205
-
206
196
}
207
197
208
198
task globalTestReport (type : TestReport ) {
You can’t perform that action at this time.
0 commit comments