From 26f77bd00f1c9b44b3b0f5b051fc87d8b6469278 Mon Sep 17 00:00:00 2001 From: Rhodey Orbits Date: Mon, 25 May 2015 23:39:35 -0700 Subject: [PATCH] make running the espresso tests optional via -Pespresso=1 command line arg // FREEBIE --- build.gradle | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index 1c426ea026..822e90d2e9 100644 --- a/build.gradle +++ b/build.gradle @@ -146,13 +146,6 @@ android { buildConfigField "String", "PUSH_URL", "\"https://textsecure-service.whispersystems.org\"" } - productFlavors { - base { } - espresso { - testInstrumentationRunner "org.thoughtcrime.securesms.TextSecureWakingTestRunner" - } - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 @@ -210,16 +203,9 @@ android { res.srcDirs = ['res'] assets.srcDirs = ['assets'] } - espresso { - manifest.srcFile 'test/espresso/AndroidManifest.xml' - } androidTest { java.srcDirs = ['test/androidTest/java'] } - androidTestEspresso { - java.srcDirs = ['test/androidTestEspresso/java'] - res.srcDirs = ['test/androidTestEspresso/res'] - } } lintOptions { @@ -257,3 +243,19 @@ if (propFile.canRead()){ println 'signing.properties not found' android.buildTypes.release.signingConfig = null } + +if (project.hasProperty('espresso')) { + android.productFlavors { + base {} + espresso { + testInstrumentationRunner "org.thoughtcrime.securesms.TextSecureWakingTestRunner" + } + } + android.sourceSets.espresso { + manifest.srcFile 'test/espresso/AndroidManifest.xml' + } + android.sourceSets.androidTestEspresso { + java.srcDirs = ['test/androidTestEspresso/java'] + res.srcDirs = ['test/androidTestEspresso/res'] + } +} \ No newline at end of file