@@ -159,7 +159,8 @@ public class GenerationTest {
159
159
assert reports. html. enabled
160
160
assert reports. html. destination. toString() == project. buildDir. absolutePath + " /reports/jacoco/${ flavor}${ buildType.capitalize()} "
161
161
162
- assert classDirectories. dir == project. file(" build/intermediates/classes/${ flavor} /${ buildType} " )
162
+ assert classDirectories. dir == project. file(" build/" )
163
+ assert contentEquals(classDirectories. includes, [" **/intermediates/classes/${ flavor} /${ buildType} /**" . toString()])
163
164
164
165
assert taskDependsOn(task, " test${ flavor.capitalize()}${ buildType.capitalize()} UnitTest" )
165
166
assert taskDependsOn(project. tasks. findByName(' check' ), " jacocoTestReport${ flavor.capitalize()}${ buildType.capitalize()} " )
@@ -198,7 +199,8 @@ public class GenerationTest {
198
199
assert reports. html. enabled
199
200
assert reports. html. destination. toString() == project. buildDir. absolutePath + ' /reports/jacoco/debug'
200
201
201
- assert classDirectories. dir == project. file(' build/intermediates/classes/debug' )
202
+ assert classDirectories. dir == project. file(" build/" )
203
+ assert contentEquals(classDirectories. includes, [' **/intermediates/classes/debug/**' ])
202
204
203
205
assert taskDependsOn(debugTask, ' testDebugUnitTest' )
204
206
assert taskDependsOn(project. tasks. findByName(' check' ), ' jacocoTestReportDebug' )
@@ -231,7 +233,8 @@ public class GenerationTest {
231
233
assert reports. html. enabled
232
234
assert reports. html. destination. toString() == project. buildDir. absolutePath + ' /reports/jacoco/release'
233
235
234
- assert classDirectories. dir == project. file(' build/intermediates/classes/release' )
236
+ assert classDirectories. dir == project. file(" build/" )
237
+ assert contentEquals(classDirectories. includes, [' **/intermediates/classes/release/**' ])
235
238
236
239
assert taskDependsOn(releaseTask, ' testReleaseUnitTest' )
237
240
assert taskDependsOn(project. tasks. findByName(' check' ), ' jacocoTestReportRelease' )
@@ -263,7 +266,8 @@ public class GenerationTest {
263
266
assert sourceDirectories. contains(project. file(" src/main/$it " ))
264
267
}
265
268
266
- assert classDirectories. dir == project. file(' build/classes/' )
269
+ assert classDirectories. dir == project. file(' build/' )
270
+ assert contentEquals(classDirectories. includes, [" **/classes/**" ])
267
271
268
272
assert reports. xml. enabled
269
273
assert reports. html. enabled
@@ -272,13 +276,17 @@ public class GenerationTest {
272
276
}
273
277
}
274
278
279
+ static boolean contentEquals (Collection<?> c1 , Collection<?> c2 ) {
280
+ return c1. containsAll(c2) && c2. containsAll(c1)
281
+ }
282
+
275
283
static boolean taskDependsOn (final Task task , final String taskName ) {
276
284
final def it = task. dependsOn. iterator()
277
285
278
286
while (it. hasNext()) {
279
287
final def item = it. next()
280
288
281
- if (item. toString(). equals( taskName) ) {
289
+ if (item. toString() == taskName) {
282
290
return true
283
291
}
284
292
}
0 commit comments