-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
85f47b3
commit 74ade4b
Showing
13 changed files
with
146 additions
and
120 deletions.
There are no files selected for viewing
24 changes: 0 additions & 24 deletions
24
app/src/androidTest/java/dev/nikhi1/eventbrite/clone/ExampleInstrumentedTest.kt
This file was deleted.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
apply plugin: 'jacoco' | ||
|
||
jacoco { | ||
toolVersion = "0.8.5" | ||
} | ||
|
||
tasks.withType(Test) { | ||
jacoco.includeNoLocationClasses = true | ||
} | ||
|
||
def mainSrc = "$project.projectDir/src/main/java" | ||
|
||
def executionDataFiles = [ | ||
'jacoco/test.exec', | ||
'jacoco/testDebugUnitTest.exec', | ||
'outputs/code-coverage/connected/*coverage.ec' | ||
] | ||
|
||
subprojects { subproject -> | ||
afterEvaluate { | ||
subproject.apply plugin: 'jacoco' | ||
|
||
// TODO WORKAROUND: subproject.plugins.withType is not correctly detecting Android projects | ||
subproject.plugins.each { plugin -> | ||
if (subproject.hasProperty('excludeFromCoverage') && subproject.excludeFromCoverage) { | ||
logger.info "Excluding $subproject from coverage measurement" | ||
return | ||
} | ||
|
||
if (isAndroidLibrary(plugin) || isAndroidApp(plugin)) { | ||
android.jacoco.version = "0.8.5" | ||
|
||
logger.info "Applying Android JaCoCo task for $subproject" | ||
task jacocoTestReport( | ||
type: JacocoReport, | ||
dependsOn: ['testDebugUnitTest', 'createDebugCoverageReport'] | ||
) { | ||
reports { | ||
xml.enabled = true | ||
html.enabled = true | ||
} | ||
|
||
sourceDirectories.setFrom files([mainSrc]) | ||
|
||
def javaClassDir = "$project.buildDir/intermediates/classes/debug" | ||
def kotlinClassDir = "$project.buildDir/tmp/kotlin-classes/debug" | ||
classDirectories.setFrom fileTree(javaClassDir) + fileTree(kotlinClassDir) | ||
|
||
executionData.setFrom fileTree(dir: project.buildDir, includes: executionDataFiles) | ||
} | ||
} else if (isJvmLibrary(plugin)) { | ||
logger.info "Applying Java JaCoCo task for $subproject" | ||
jacocoTestReport { | ||
dependsOn test | ||
reports { | ||
xml.enabled = true | ||
html.enabled = true | ||
} | ||
|
||
sourceDirectories.setFrom files([mainSrc]) | ||
|
||
def javaClassDir = "$project.buildDir/classes/java/main" | ||
def kotlinClassDir = "$project.buildDir/classes/kotlin/main" | ||
classDirectories.setFrom fileTree(javaClassDir) + fileTree(kotlinClassDir) | ||
|
||
executionData.setFrom fileTree(dir: project.buildDir, includes: executionDataFiles) | ||
} | ||
} | ||
return | ||
} | ||
} | ||
} | ||
|
||
private static boolean isAndroidLibrary(plugin) { | ||
plugin.toString().contains('com.android.build.gradle.LibraryPlugin') | ||
} | ||
|
||
private static boolean isAndroidApp(plugin) { | ||
plugin.toString().contains('com.android.build.gradle.AppPlugin') | ||
} | ||
|
||
private static boolean isJvmLibrary(plugin) { | ||
plugin instanceof JavaLibraryPlugin | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
internal object Versions { | ||
object Versions { | ||
|
||
const val koin = "2.0.1" | ||
const val kotlin = "1.3.41" | ||
|
24 changes: 0 additions & 24 deletions
24
core/src/androidTest/java/dev/nikhi1/eventbrite/core/ExampleInstrumentedTest.kt
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
plugins { | ||
id("com.android.library") | ||
id("dev.nikhi1.plugin.android") | ||
} | ||
} |
24 changes: 0 additions & 24 deletions
24
home/src/androidTest/java/dev/nikhi1/eventbrite/home/ExampleInstrumentedTest.kt
This file was deleted.
Oops, something went wrong.
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
24 changes: 0 additions & 24 deletions
24
search/src/androidTest/java/dev/nikhi1/eventbrite/search/ExampleInstrumentedTest.kt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.