Skip to content

Commit

Permalink
Add new task to gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
AnasNaouchi committed Nov 2, 2023
1 parent 00e47af commit b7383e2
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}

// Use locally to generate full report
// TODO: Fix flaky tests so that this can be used in CI to reflect full coverage
tasks.create(name: 'jacocoTestReport', type: JacocoReport, dependsOn: ['testProductionDebugUnitTest', 'lint', 'createProductionDebugCoverageReport']) {
reports {
xml.required = true
Expand Down Expand Up @@ -244,6 +245,35 @@ tasks.create(name: 'jacocoTestReport', type: JacocoReport, dependsOn: ['testProd
'**/*.ec'
])
}
// Use in CI to coverage generate report without instrumentation testing
tasks.create(name: 'jacocoUnitTestReport', type: JacocoReport, dependsOn: ['testProductionDebugUnitTest', 'lint']) {
reports {
xml.required = true
html.required = true
}

// Main source code
sourceDirectories.from = file("${project.projectDir}/src/main/java")
classDirectories.from = files(fileTree(
// Generated Kotlin classes
dir: "${project.buildDir}/tmp/kotlin-classes/productionDebug",
// Exclude generated code
excludes: [
'**/R.class',
'**/R$*.class',
'**/BuildConfig.*',
'**/Manifest*.*',
'**/*Test*.*',
'android/**/*.*'
]
))
executionData.from = fileTree(dir: project.buildDir, includes: [
// Execution data for unit tests
'**/*.exec',
// Execution data for instrumentation tests
'**/*.ec'
])
}

sonar {
properties {
Expand Down

0 comments on commit b7383e2

Please sign in to comment.