Skip to content

Commit 88c5bf5

Browse files
committed
Merge pull request #91 from dbarfield/master
[BUG] fix break in gradle dist on windows
2 parents e5d6bcd + dc6548d commit 88c5bf5

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

Diff for: build.gradle

+3-13
Original file line numberDiff line numberDiff line change
@@ -177,32 +177,22 @@ task dist(type: Sync) {
177177
* list, throws an exception.
178178
*/
179179
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.
184180
FileTree tree = zipTree(zipFileName)
185-
boolean found = tree.find { File file ->
181+
tree.visit { FileVisitDetails details ->
186182
def foundFiles = []
187183
toCheck.each {
188-
if (file.getPath().endsWith(it)) {
184+
if (details.getPath().equals(it)) {
189185
foundFiles << it
190186
}
191187
}
192188
foundFiles.each {
193189
toCheck.remove(it)
194190
}
195-
if (toCheck) {
196-
return false
197-
}
198-
// toCheck is empty, so all files were found
199-
return true;
200191
}
201192

202-
if (!found) {
193+
if (toCheck) {
203194
throw new GradleException("Couldn't find files '${toCheck}' in the zip file '${zipFileName}'")
204195
}
205-
206196
}
207197

208198
task globalTestReport(type: TestReport) {

0 commit comments

Comments
 (0)