При включении jacoco с gradle kotlin dsl происходит сбой, потому что он смотрит на файл build.gradle вместо файла build.gradle.kts.
Вот ошибка:
##[warning]Unable to append code coverage data: Error: File or folder doesn't exist: /home/vsts/work/1/s/build.gradle
##[warning]Failed to enable code coverage: Unable to append code coverage data: Error: File or folder doesn't exist: /home/vsts/work/1/s/build.gradle
app / build.gradle.kts
plugins {
jacoco
}
tasks.withType(JacocoReport::class.java).all {
reports {
xml.isEnabled = true
xml.destination = File("$buildDir/reports/jacoco/report.xml")
}
}
tasks.withType<Test> {
jacoco {
toolVersion = "0.8.3"
reportsDir = file("$buildDir/reports/jacoco")
}
finalizedBy("jacocoTestReport")
}
Azure Задача DevOps
- task: Gradle@2
displayName: Gradle Build
inputs:
gradleWrapperFile: 'gradlew'
tasks: ':app:assembleDevDebug :networking:lintDebug :app:lintDevDebug --warning-mode all'
publishJUnitResults: false
testResultsFiles: '**/TEST-*.xml'
javaHomeOption: 'JDKVersion'
sonarQubeRunAnalysis: false
codeCoverageToolOption: 'jaCoCo'