Update to com.novoda:gradle-android-test-plugin:0.10.0, no snapshot version anymore, jacoco disabled for now

This commit is contained in:
Dominik Schürmann 2014-12-04 19:42:30 +01:00
parent 450ac161b9
commit 8f5295f2d1
2 changed files with 35 additions and 36 deletions

View file

@ -1,14 +1,11 @@
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()
jcenter()
}
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'
classpath 'com.novoda:gradle-android-test-plugin:0.10.0'
}
}
@ -50,28 +47,30 @@ android {
projectUnderTest ':OpenKeychain'
}
jacoco {
toolVersion = "0.7.0.201403182114"
}
//jacoco {
// //toolVersion = "0.7.0.201403182114"
// toolVersion = "0.7.2.201409121644"
//}
//
//
//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'
// ]
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')
}
//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 {

View file

@ -10,16 +10,16 @@ if ! java -version 2>&1 | grep OpenJDK; then
return
fi
tmpdir="$(mktemp -d)"
(
cd "$tmpdir";
git clone https://github.com/nenick/gradle-android-test-plugin.git
cd gradle-android-test-plugin
echo "rootProject.name = 'gradle-android-test-plugin-parent'" > settings.gradle
echo "include ':gradle-android-test-plugin'" >> settings.gradle
./gradlew :gradle-android-test-plugin:install
)
rm -rf "$tmpdir"
#tmpdir="$(mktemp -d)"
#(
# cd "$tmpdir";
# git clone https://github.com/nenick/gradle-android-test-plugin.git
# cd gradle-android-test-plugin
# echo "rootProject.name = 'gradle-android-test-plugin-parent'" > settings.gradle
# echo "include ':gradle-android-test-plugin'" >> settings.gradle
# ./gradlew :gradle-android-test-plugin:install
#)
#rm -rf "$tmpdir"
echo -n "ok, adding tests to include list.. "
if grep OpenKeychain-Test settings.gradle >/dev/null ; then