Skip to content

Commit

Permalink
buildDir deprecation fix
Browse files Browse the repository at this point in the history
  • Loading branch information
baronhsieh2005 committed Nov 6, 2024
1 parent 2df072b commit fc02067
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions PennMobile/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jacoco {
}

// https://stackoverflow.com/questions/68065743/cannot-run-gradle-test-tasks-because-of-java-lang-noclassdeffounderror-jdk-inte
tasks.withType(Test) {
tasks.withType(Test).configureEach {
jacoco.includeNoLocationClasses = true
jacoco.excludes = ['jdk.internal.*']
}
Expand All @@ -144,15 +144,15 @@ def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*',
'**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']

// Location of generated output classes
def debugTree = fileTree(dir: "$project.buildDir/tmp/kotlin-classes/debug",
def debugTree = fileTree(dir: "$project.layout.buildDirectory/tmp/kotlin-classes/debug",
excludes: fileFilter)

// Source code directory
def mainSrc = "$project.projectDir/src/main/java"

// Task declaration

task jacocoTestReport(type: JacocoReport) {
tasks.register('jacocoTestReport', JacocoReport) {
// Runs only after the dependencies are executed
dependsOn = ['testDebugUnitTest', 'createDebugCoverageReport']
// Export formats
Expand All @@ -165,7 +165,7 @@ task jacocoTestReport(type: JacocoReport) {
classDirectories.setFrom(files([debugTree]))

// Inform Gradle where the files generated by test cases - are located
executionData.from = fileTree(dir: project.buildDir, includes: [
executionData.from = fileTree(dir: project.layout.buildDirectory, includes: [
'jacoco/testDebugUnitTest.exec'
// 'outputs/code_coverage/debugAndroidTest/connected/*.ec'
])
Expand Down

0 comments on commit fc02067

Please sign in to comment.