This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
executionData = files("${project.buildDir}/jacoco/${testTaskName}.exec") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sourceDirectories = files( | |
"${project.projectDir}/src/main/java", | |
"${project.projectDir}/src/$flavorName/java", | |
"${project.projectDir}/src/$buildTypeName/java", | |
"${project.projectDir}/src/$variantName/java", | |
"${project.projectDir}/src/main/kotlin", | |
"${project.projectDir}/src/$flavorName/kotlin", | |
"${project.projectDir}/src/$buildTypeName/kotlin", | |
"${project.projectDir}/src/$variantName/kotlin", | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def androidGeneratedClasses = [ | |
'**/R.class', | |
'**/R$*.class', | |
'**/BR.class', | |
'**/BR$*.class', | |
'**/BuildConfig.*', | |
'**/Manifest*.*', | |
'**/*Test*.*', | |
'android/**/*.*', | |
'**/databinding' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: "jacoco" | |
jacoco { | |
toolVersion "0.8.1" | |
} | |
jacocoTestReport { | |
reports { | |
xml.enabled true | |
html.enabled true | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project.afterEvaluate { | |
def variantPropertyName | |
if (project.android.hasProperty("applicationVariants")) { | |
variantPropertyName = "applicationVariants" | |
} else if (project.android.hasProperty("libraryVariants")) { | |
variantPropertyName = "libraryVariants" | |
} else { | |
return | |
} | |
project.android.properties[variantPropertyName].all { variant -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'jacoco' | |
jacoco { | |
toolVersion "0.8.1" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'jacoco' | |
jacoco { | |
toolVersion project.jacocoPlugin | |
} | |
project.afterEvaluate { | |
def variantPropertyName | |
if (project.android.hasProperty("applicationVariants")) { | |
variantPropertyName = "applicationVariants" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def variantName = variant.name | |
def flavorName = variant.flavorName | |
def buildTypeName = variant.buildType.name | |
def jacocoTaskName = "jacoco${variantName.capitalize()}TestReport" | |
def testTaskName = "test${variantName.capitalize()}UnitTest" | |
def jacocoTask = project.tasks.create(name: jacocoTaskName, type: JacocoReport) { | |
group = 'reporting' | |
description 'Generates Jacoco coverage reports for JVM tests.' | |
// Task configuration here... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
fun saveFavorite() { | |
val expectedItem = Item() | |
presenter.favoriteIconClick(expectedItem) | |
verify(repository).save(expectedItem) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface FavoritesRepository { | |
fun observe(): Observable<Item> | |
fun save(item: Item) | |
fun delete(item: Item) | |
fun getAll(): List<Item> | |
fun contains(id: String): Boolean | |
} |
NewerOlder