packages/apps/Taskbar
Revisión | 1ee0cbc70de00d4eb9ac6c74eff9744e46c46d3a (tree) |
---|---|
Tiempo | 2020-04-14 14:41:48 |
Autor | Braden Farmer <farmerbb@gmai...> |
Commiter | Braden Farmer |
Create Jacoco build type for tests to run under
@@ -48,7 +48,6 @@ android { | ||
48 | 48 | buildTypes { |
49 | 49 | debug { |
50 | 50 | applicationIdSuffix ".debug" |
51 | - testCoverageEnabled true | |
52 | 51 | manifestPlaceholders = [appName: "@string/tb_app_name_debug"] |
53 | 52 | } |
54 | 53 |
@@ -65,6 +64,11 @@ android { | ||
65 | 64 | } |
66 | 65 | } |
67 | 66 | } |
67 | + | |
68 | + jacoco { | |
69 | + initWith buildTypes.debug | |
70 | + testCoverageEnabled true | |
71 | + } | |
68 | 72 | } |
69 | 73 | |
70 | 74 | flavorDimensions "default" |
@@ -134,7 +138,7 @@ dependencies { | ||
134 | 138 | testImplementation 'org.apache.commons:commons-lang3:3.10' |
135 | 139 | } |
136 | 140 | |
137 | -task jacocoTestReport(type: JacocoReport, dependsOn: ['testFreeDebugUnitTest']) { | |
141 | +task jacocoTestReport(type: JacocoReport, dependsOn: ['testFreeJacocoUnitTest']) { | |
138 | 142 | reports { |
139 | 143 | xml.enabled = true |
140 | 144 | html.enabled = true |
@@ -147,14 +151,14 @@ task jacocoTestReport(type: JacocoReport, dependsOn: ['testFreeDebugUnitTest']) | ||
147 | 151 | '**/BuildConfig.class' |
148 | 152 | ] |
149 | 153 | |
150 | - def debugTree = fileTree(dir: "$buildDir/intermediates/javac/freeDebug/classes", excludes: fileFilter) | |
154 | + def jacocoTree = fileTree(dir: "$buildDir/intermediates/javac/freeJacoco/classes", excludes: fileFilter) | |
151 | 155 | def mainSrc = "${project.projectDir}/src/main/java" |
152 | 156 | |
153 | 157 | sourceDirectories.from = [mainSrc] |
154 | - classDirectories.from = [debugTree] | |
155 | - executionData.from = "$buildDir/jacoco/testFreeDebugUnitTest.exec" | |
158 | + classDirectories.from = [jacocoTree] | |
159 | + executionData.from = "$buildDir/jacoco/testFreeJacocoUnitTest.exec" | |
156 | 160 | |
157 | 161 | doLast { |
158 | - println("Test report link: file://$buildDir/reports/jacoco/jacocoTestReport/html/index.html") | |
162 | + println "Test report link: file://$buildDir/reports/jacoco/jacocoTestReport/html/index.html" | |
159 | 163 | } |
160 | 164 | } |