File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -177,32 +177,22 @@ task dist(type: Sync) {
177177 * list, throws an exception.
178178 */
179179boolean 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
208198task globalTestReport (type : TestReport ) {
You can’t perform that action at this time.
0 commit comments