make running the espresso tests optional via -Pespresso=1

command line arg

// FREEBIE
This commit is contained in:
Rhodey Orbits 2015-05-25 23:39:35 -07:00 committed by Moxie Marlinspike
parent 7cc2941053
commit 26f77bd00f

View File

@ -146,13 +146,6 @@ android {
buildConfigField "String", "PUSH_URL", "\"https://textsecure-service.whispersystems.org\"" buildConfigField "String", "PUSH_URL", "\"https://textsecure-service.whispersystems.org\""
} }
productFlavors {
base { }
espresso {
testInstrumentationRunner "org.thoughtcrime.securesms.TextSecureWakingTestRunner"
}
}
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7 sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7
@ -210,16 +203,9 @@ android {
res.srcDirs = ['res'] res.srcDirs = ['res']
assets.srcDirs = ['assets'] assets.srcDirs = ['assets']
} }
espresso {
manifest.srcFile 'test/espresso/AndroidManifest.xml'
}
androidTest { androidTest {
java.srcDirs = ['test/androidTest/java'] java.srcDirs = ['test/androidTest/java']
} }
androidTestEspresso {
java.srcDirs = ['test/androidTestEspresso/java']
res.srcDirs = ['test/androidTestEspresso/res']
}
} }
lintOptions { lintOptions {
@ -257,3 +243,19 @@ if (propFile.canRead()){
println 'signing.properties not found' println 'signing.properties not found'
android.buildTypes.release.signingConfig = null 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']
}
}