Files
android-oss/jacoco.gradle
mtgriego e32feda110 [MBL-871] Add compose visuals based on design system (#1811)
* begin work with compose, WIP on alert dialogs

* WIP fixed some dialog visuals

* add theme and update colors and typography to be in theme

* added buttons, ripple themes

* renamed a file

* added more compose stuff

* update alerts for popups, begin work on internal tools preview

* some progress for internal tools visuals

* added controls and more previews in internal tools

* progress indicators, small buttons, more preview stuff, fix alert buttons

* added footers, general cleanup

* move some stuff around, add typography to  preview screen

* lint stuff

* more lint

* yet more lint

* make sure all text uses theme colors, more lint

* added to jacoco for ignoring coverage, moved a util

* add an additional safelet with varargs

* lint, button colors for branded stuff shouldnt change

* added dark mode toggle, updated some text to use design system colors

* lint

---------

Co-authored-by: Isabel Martin <arkariang@gmail.com>
2023-07-12 13:53:47 -07:00

87 lines
3.6 KiB
Groovy

apply plugin: 'jacoco'
jacoco {
toolVersion = "$jacoco_version"
}
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
jacoco.excludes = ['jdk.internal.*']
jacoco.dumpOnExit = true
jacoco.classDumpDir = null
}
// Creates tasks based on the application build variant (productFlavor + buildType = variant)
android.applicationVariants.all { variant ->
def variantName = variant.name.capitalize()
def autoGenerated = ['**/R.class',
'**/R$*.class',
'**/Manifest*.*',
'android/**/*.*',
'**/BuildConfig.*',
'**/*$ViewBinder*.*',
'**/*$ViewInjector*.*',
'**/Lambda$*.class',
'**/Lambda.class',
'**/*Lambda.class',
'**/*Lambda*.class',
'**/*Dagger*.*',
'**/*_MembersInjector.class',
'**/Dagger*Component*.class',
'**/Dagger*Subcomponent*.class',
'**/*Subcomponent$Builder.class',
'**/*Module_*Factory.class',
'**/KSApplication.*',
'**/libs/utils/ApplicationLifecycleUtil.*',
'**/libs/utils/ApplicationUtils.*',
'**/libs/recyclerviewpagination/*.*',
'**/ApplicationModule.*',
'**/*Activity*.*',
'**/*Fragment*.*',
'**/*ViewHolder*.*',
'**/*Toolbar*.*',
'**/*Dialog*.*',
'**/ui/*.*',
'**/ui/compose/*.*',
'**/ui/compose/designsystem/*.*',
'**/ui/views/*.*',
'**/ui/adapters/*.*',
'**/ui/adapters/data/*.*',
'**/ui/adapters/projectcampaign/*.*',
'**/databinding/*.*',
'**/mock/*.*',
'**/mock/factories/*.*',
'**/services/*.*',
'**/firebase/*.*',
'**/fragment/*.*']
/**
* Generates Jacoco coverage reports based off the unit tests.
*/
task("jacoco${variantName}Report", type: JacocoReport, dependsOn: "test${variantName}UnitTest") {
group 'Reporting'
description "Generate ${variantName} Jacoco coverage reports."
reports {
xml.required.set(true)
html.required.set(true)
}
// variant.javaCompile.source does not work
// traverses from starting point
def debugTree = fileTree(dir: variant.javaCompileProvider.get().destinationDirectory, excludes: autoGenerated)
def kotlinDebugTree = fileTree(dir: "${buildDir}/tmp/kotlin-classes/${variant.name}", excludes: autoGenerated)
def variantSourceSets = variant.sourceSets.java.srcDirs.collect { it.path }.flatten()
sourceDirectories.from = [
variantSourceSets,
"src/main/java/com/kickstarter/"
]
classDirectories.from = files([debugTree], [kotlinDebugTree])
def unitTestTask = "test${variantName.capitalize()}UnitTest"
def unitTestsData = "$project.buildDir/jacoco/${unitTestTask}.exec"
executionData.from = files([unitTestsData, "${buildDir}/jacoco/test${variantName}UnitTest.exec"])
}
}