My gradle exception:
Execution failed for task ‘:doJacocoOfflineInstrumentation’.
Could not get unknown property ‘classesDir’ for main classes of type org.gradle.api.internal.tasks.DefaultSourceSetOutput.
My jacocotask code:
jacocoOfflineSourceSets.each { sourceSetName ->
if (file(sourceSets[sourceSetName].output.classesDir).exists()) {
def instrumentedClassedDir = “{outputDir}/{sourceSetName}”
ant.‘jacoco:instrument’(destdir: instrumentedClassedDir) {
fileset(dir: sourceSets[sourceSetName].output.classesDir, includes: ‘**/*.class’)
}
//Replace the classes dir in the test classpath with the instrumented one
sourceSets.test.runtimeClasspath -= files(sourceSets[sourceSetName].output.classesDir)
sourceSets.test.runtimeClasspath += files(instrumentedClassedDir)
instrumented = true
}
Note: I am migrating from 4.4 to 5.6.4 and getting issue durig the same.