From e7fa124108e72b0eaaa1319467d666d876278467 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Mon, 12 May 2014 22:18:11 +0200 Subject: update unit test support in build files --- OpenKeychain/build.gradle | 59 ++++++++++++++++++----------------------------- 1 file changed, 23 insertions(+), 36 deletions(-) (limited to 'OpenKeychain/build.gradle') diff --git a/OpenKeychain/build.gradle b/OpenKeychain/build.gradle index 090a7a2bf..11dd7f21c 100644 --- a/OpenKeychain/build.gradle +++ b/OpenKeychain/build.gradle @@ -1,9 +1,11 @@ apply plugin: 'android' +apply plugin: 'android-test' sourceSets { - testLocal { + androidTest { java.srcDir file('src/test/java') - resources.srcDir file('src/test/resources') + // configure the set of classes for JUnit tests + // include '**/*Test.class' } } @@ -23,24 +25,25 @@ dependencies { compile project(':extern:spongycastle:prov') compile project(':extern:AppMsg:library') - // Dependencies for the `testLocal` task, make sure to list all your global dependencies here as well - testLocalCompile 'junit:junit:4.11' - testLocalCompile 'org.robolectric:robolectric:2.2' - testLocalCompile 'com.google.android:android:4.1.1.4' - testLocalCompile 'com.android.support:support-v4:19.1.0' - testLocalCompile 'com.android.support:appcompat-v7:19.1.0' - testLocalCompile project(':extern:openpgp-api-lib') - testLocalCompile project(':extern:openkeychain-api-lib') - testLocalCompile project(':extern:html-textview') - testLocalCompile project(':extern:StickyListHeaders:library') - testLocalCompile project(':extern:AndroidBootstrap:AndroidBootstrap') - testLocalCompile project(':extern:zxing-qr-code') - testLocalCompile project(':extern:zxing-android-integration') - testLocalCompile project(':extern:spongycastle:core') - testLocalCompile project(':extern:spongycastle:pg') - testLocalCompile project(':extern:spongycastle:pkix') - testLocalCompile project(':extern:spongycastle:prov') - testLocalCompile project(':extern:AppMsg:library') + // Dependencies for the `instrumentTest` task, make sure to list all your global dependencies here as well + androidTestCompile 'junit:junit:4.10' + androidTestCompile 'org.robolectric:robolectric:2.1.+' + androidTestCompile 'com.squareup:fest-android:1.0.+' + androidTestCompile 'com.google.android:android:4.1.1.4' + androidTestCompile 'com.android.support:support-v4:19.1.0' + androidTestCompile 'com.android.support:appcompat-v7:19.1.0' + androidTestCompile project(':extern:openpgp-api-lib') + androidTestCompile project(':extern:openkeychain-api-lib') + androidTestCompile project(':extern:html-textview') + androidTestCompile project(':extern:StickyListHeaders:library') + androidTestCompile project(':extern:AndroidBootstrap:AndroidBootstrap') + androidTestCompile project(':extern:zxing-qr-code') + androidTestCompile project(':extern:zxing-android-integration') + androidTestCompile project(':extern:spongycastle:core') + androidTestCompile project(':extern:spongycastle:pg') + androidTestCompile project(':extern:spongycastle:pkix') + androidTestCompile project(':extern:spongycastle:prov') + androidTestCompile project(':extern:AppMsg:library') } android { @@ -92,20 +95,6 @@ android { } } -task localTest(type: Test, dependsOn: assemble) { - testClassesDir = sourceSets.testLocal.output.classesDir - - android.sourceSets.main.java.srcDirs.each { dir -> - def buildDir = dir.getAbsolutePath().split("\\" + File.separator) - buildDir = (buildDir[0..(buildDir.length - 4)] + ['build', 'classes', 'debug']).join("\\" + File.separator) - - sourceSets.testLocal.compileClasspath += files(buildDir) - sourceSets.testLocal.runtimeClasspath += files(buildDir) - } - - classpath = sourceSets.testLocal.runtimeClasspath -} - // NOTE: This disables Lint! tasks.whenTaskAdded { task -> if (task.name.equals("lint")) { @@ -113,5 +102,3 @@ tasks.whenTaskAdded { task -> } } -// NOTE: tests disabled! -//check.dependsOn localTest -- cgit v1.2.3 From 6cb791d567e5205f2ca41e1afbc1015864841ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Wed, 4 Jun 2014 10:21:28 +0200 Subject: Use fixed gradle versions --- OpenKeychain/build.gradle | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'OpenKeychain/build.gradle') diff --git a/OpenKeychain/build.gradle b/OpenKeychain/build.gradle index 11dd7f21c..c30de8de7 100644 --- a/OpenKeychain/build.gradle +++ b/OpenKeychain/build.gradle @@ -10,6 +10,8 @@ sourceSets { } dependencies { + // NOTE: Always use version codes not dynamic ones, e.g. 0.7.3 instead of 0.7.+, see README for more information + compile 'com.android.support:support-v4:19.1.0' compile 'com.android.support:appcompat-v7:19.1.0' compile project(':extern:openpgp-api-lib') @@ -27,8 +29,8 @@ dependencies { // Dependencies for the `instrumentTest` task, make sure to list all your global dependencies here as well androidTestCompile 'junit:junit:4.10' - androidTestCompile 'org.robolectric:robolectric:2.1.+' - androidTestCompile 'com.squareup:fest-android:1.0.+' + androidTestCompile 'org.robolectric:robolectric:2.3' + androidTestCompile 'com.squareup:fest-android:1.0.8' androidTestCompile 'com.google.android:android:4.1.1.4' androidTestCompile 'com.android.support:support-v4:19.1.0' androidTestCompile 'com.android.support:appcompat-v7:19.1.0' -- cgit v1.2.3 From 52f1f30846ad7efa6e6ae11ed96f5b68626bfb3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Wed, 4 Jun 2014 10:22:05 +0200 Subject: Use fixed gradle versions --- OpenKeychain/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenKeychain/build.gradle') diff --git a/OpenKeychain/build.gradle b/OpenKeychain/build.gradle index c30de8de7..c8ef7b418 100644 --- a/OpenKeychain/build.gradle +++ b/OpenKeychain/build.gradle @@ -10,7 +10,7 @@ sourceSets { } dependencies { - // NOTE: Always use version codes not dynamic ones, e.g. 0.7.3 instead of 0.7.+, see README for more information + // NOTE: Always use fixed version codes not dynamic ones, e.g. 0.7.3 instead of 0.7.+, see README for more information compile 'com.android.support:support-v4:19.1.0' compile 'com.android.support:appcompat-v7:19.1.0' -- cgit v1.2.3