aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2015-08-27 23:54:28 -0700
committerKenny Root <kenny@the-b.org>2015-08-27 23:56:01 -0700
commitf6ef2b5e6a4f33ce1d14c5a0d802b30a446ae2bf (patch)
treec8550931954db1ce4bddc2a9fb6d80b0056cfba4
parentf2214b61c7d9f8efa976e36ab05690c9d5ff1f42 (diff)
downloadconnectbot-f6ef2b5e6a4f33ce1d14c5a0d802b30a446ae2bf.tar.gz
connectbot-f6ef2b5e6a4f33ce1d14c5a0d802b30a446ae2bf.tar.bz2
connectbot-f6ef2b5e6a4f33ce1d14c5a0d802b30a446ae2bf.zip
Fix the Jacoco rules now that we have two kinds of tests
Since we have both "test" and "androidTest" they have different task names that we need to track in the Jacoco file.
-rw-r--r--.travis.yml2
-rw-r--r--app/build.gradle2
-rw-r--r--config/jacoco.gradle8
3 files changed, 6 insertions, 6 deletions
diff --git a/.travis.yml b/.travis.yml
index bf6999a..b27f36f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -54,7 +54,7 @@ android:
- '.+'
script:
- - ./gradlew build check jacocoTestDebugReport
+ - ./gradlew build check jacocoUnitTestDebugReport
- ./scripts/check-lint-count.sh app/build/outputs/lint-results.xml $HOME/.cache/lint/issue-count.txt $HOME/.cache/lint/issue-count.txt
after_success: ./gradlew coveralls
diff --git a/app/build.gradle b/app/build.gradle
index e1893d3..e02e5bd 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -126,7 +126,7 @@ android.applicationVariants.all { variant ->
ext.env = System.getenv()
def buildNumber = getGitDescription()
if (buildNumber != null) {
- File valuesFile = file("${buildDir}/intermediates/res/${variant.dirName}/values/values.xml")
+ File valuesFile = file("${buildDir}/intermediates/res/merged/${variant.dirName}/values/values.xml")
String content = valuesFile.getText('UTF-8')
content = content.replaceAll(/\(working copy\)/, buildNumber)
valuesFile.write(content, 'UTF-8')
diff --git a/config/jacoco.gradle b/config/jacoco.gradle
index c603349..25ac311 100644
--- a/config/jacoco.gradle
+++ b/config/jacoco.gradle
@@ -16,9 +16,9 @@ tasks.withType(Test).whenTaskAdded {
}
// These tasks are for generating the coverage report after JUnit+robolectric tests have executed
-tasks.create(name: "jacocoTestDebugReport", type: JacocoReport, dependsOn: "testDebug") {
+tasks.create(name: "jacocoUnitTestDebugReport", type: JacocoReport, dependsOn: "testDebugUnitTest") {
group = "Reporting"
- description = "Generate Jacoco coverage reports"
+ description = "Generate Jacoco coverage reports for unit tests"
classDirectories = fileTree(
dir: "${project.buildDir}/intermediates/classes/debug/",
@@ -30,7 +30,7 @@ tasks.create(name: "jacocoTestDebugReport", type: JacocoReport, dependsOn: "test
)
sourceDirectories = files("src/main/java", "src/debug/java")
- executionData = files("${project.buildDir}/jacoco/testDebug.exec")
+ executionData = files("${project.buildDir}/jacoco/testDebugUnitTest.exec")
reports {
xml.enabled = true
@@ -38,4 +38,4 @@ tasks.create(name: "jacocoTestDebugReport", type: JacocoReport, dependsOn: "test
}
}
-coveralls.jacocoReportPath = "${project.buildDir}/reports/jacoco/jacocoTestDebugReport/jacocoTestDebugReport.xml" \ No newline at end of file
+coveralls.jacocoReportPath = "${project.buildDir}/reports/jacoco/jacocoUnitTestDebugReport/jacocoUnitTestDebugReport.xml" \ No newline at end of file