aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain-Test/build.gradle
diff options
context:
space:
mode:
Diffstat (limited to 'OpenKeychain-Test/build.gradle')
-rw-r--r--OpenKeychain-Test/build.gradle38
1 files changed, 38 insertions, 0 deletions
diff --git a/OpenKeychain-Test/build.gradle b/OpenKeychain-Test/build.gradle
index d795ace3d..a98a79dc1 100644
--- a/OpenKeychain-Test/build.gradle
+++ b/OpenKeychain-Test/build.gradle
@@ -1,5 +1,20 @@
+buildscript {
+ repositories {
+ mavenCentral()
+ // need this for com.novoda:gradle-android-test-plugin:0.9.9-SNAPSHOT below (0.9.3 in repos doesn't work!)
+ // run ./install-custom-gradle-test-plugin.sh to pull the thing into the local repository
+ mavenLocal()
+ }
+
+ dependencies {
+ // NOTE: Always use fixed version codes not dynamic ones, e.g. 0.7.3 instead of 0.7.+, see README for more information
+ classpath 'com.novoda:gradle-android-test-plugin:0.9.9-SNAPSHOT'
+ }
+}
+
apply plugin: 'java'
apply plugin: 'android-test'
+apply plugin: 'jacoco'
dependencies {
testCompile 'junit:junit:4.11'
@@ -31,6 +46,29 @@ android {
projectUnderTest ':OpenKeychain'
}
+jacoco {
+ toolVersion = "0.7.0.201403182114"
+}
+
+coverageSourceDirs = [
+ '../OpenKeychain/src/main/java',
+ '../OpenKeychain/src/gen',
+ '../OpenKeychain/build/source/apt/debug',
+ '../OpenKeychain/build/source/generated/buildConfig/debug',
+ '../OpenKeychain/build/source/generated/r/debug'
+ ]
+
+jacocoTestReport {
+ reports {
+ xml.enabled = true
+ html.destination "${buildDir}/jacocoHtml"
+ }
+ // class R is used, but usage will not be covered, so ignore this class from report
+ classDirectories = fileTree(dir: '../OpenKeychain/build/intermediates/classes/debug/org/sufficientlysecure/keychain', exclude: 'R*.class')
+ additionalSourceDirs = files(coverageSourceDirs)
+ executionData = files('build/jacoco/testDebug.exec')
+}
+
// new workaround to force add custom output dirs for android studio
task addTest {
def file = file(project.name + ".iml")