Skip to content

Instantly share code, notes, and snippets.

@almozavr
Created May 5, 2016 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save almozavr/a9ae06052846ce213d65b11472005983 to your computer and use it in GitHub Desktop.
Save almozavr/a9ae06052846ce213d65b11472005983 to your computer and use it in GitHub Desktop.
AndroidTDDBootStrap app Flavor Dimensions test
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 Piasy
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
apply plugin: 'com.android.application'
apply plugin: 'com.frogermcs.androiddevmetrics'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'de.mobilej.unmock'
apply plugin: 'com.ofg.uptodate'
apply plugin: 'com.getkeepsafe.dexcount'
apply from: '../AndroidCodeQualityConfig/quality.gradle'
apply plugin: 'com.bugtags.library.plugin'
apply plugin: 'android-git-sha'
/*def keyConfigPath
if (isFamily(FAMILY_WINDOWS)) {
keyConfigPath = System.getenv('USERPROFILE') + File.separator + ".ssh" + File.separator +
"TemplateKeyStore.properties"
} else {
keyConfigPath = System.getenv('HOME') + File.separator + ".ssh" + File.separator +
"TemplateKeyStore.properties"
}
Properties props = new Properties()
if (new File(keyConfigPath).exists()) {
props.load(new FileInputStream(file(keyConfigPath)))
}*/
def isTravis = "true".equals(System.getenv("TRAVIS"))
def preDexEnabled = "true".equals(System.getProperty("pre-dex", "true"))
android {
compileSdkVersion rootProject.ext.androidCompileSdkVersion
buildToolsVersion rootProject.ext.androidBuildToolsVersion
defaultConfig {
applicationId "com.github.piasy.bootstrap"
minSdkVersion rootProject.ext.androidMinSdkVersion
targetSdkVersion rootProject.ext.androidTargetSdkVersion
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName
multiDexEnabled true
testInstrumentationRunner "com.github.piasy.app.CustomTestRunner"
buildConfigField "String", "API_BASE_URL", "\"https://api.github.com/\""
flavorDimensions "type", "version"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
dexOptions {
// Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
preDexLibraries = preDexEnabled && !isTravis
javaMaxHeapSize "4g"
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
signingConfigs {
develop {
storeFile file('../buildsystem/OpenKey.jks')
storePassword '123456'
keyAlias '123456'
keyPassword '123456'
}
/*production {
storeFile file(props['keystore'])
storePassword props['keystore.password']
keyAlias props['key.alias']
keyPassword props['key.password']
}*/
}
buildTypes {
debug {
minifyEnabled false
debuggable true
signingConfig signingConfigs.develop
}
release {
minifyEnabled true
debuggable false
shrinkResources true
signingConfig signingConfigs.develop
//signingConfig signingConfigs.production
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
dev {
dimension "type"
minSdkVersion 23
}
prod {
dimension "type"
}
standart {
dimension "version"
}
pro {
dimension "version"
}
}
sourceSets {
test.java.srcDirs += 'build/generated/source/apt/develop/debug'
}
testOptions.unitTests.all {
testLogging {
events 'passed', 'skipped', 'failed', 'standardOut', 'standardError'
outputs.upToDateWhen { false }
showStandardStreams = true
}
}
}
unMock {
// URI to download the android-all.jar from. e.g. https://oss.sonatype
// .org/content/groups/public/org/robolectric/android-all/
downloadFrom 'https://oss.sonatype.org/content/groups/public/org/robolectric/android-all/4' +
'.3_r2-robolectric-0/android-all-4.3_r2-robolectric-0.jar'
keep "android.text.TextUtils"
}
bugtags {
appKey "82cdb5f7f8925829ccc4a6e7d5d12216"
appSecret BUG_TAGS_API_SECRET
}
gitSha {
buildTypeMatcher = 'release'
flavorMatcher = '.*'
abortIfGitDirty = false
}
dependencies {
def appDependencies = rootProject.ext.appDependencies
def aptDependencies = rootProject.ext.aptDependencies
def testDependencies = rootProject.ext.testDependencies
compile appDependencies.recyclerViewV7
compile appDependencies.cardViewV7
compile project(':model')
compile appDependencies.rxJavaProGuardRules
compile(appDependencies.once) {
exclude module: 'support-annotations'
}
compile(appDependencies.fresco) {
exclude module: 'support-v4'
}
compile(appDependencies.iconifyMD) {
exclude module: 'support-v4'
}
compile(appDependencies.statusBarUtil) {
exclude module: 'appcompat-v7'
}
compile(appDependencies.bugTags) {
exclude module: 'support-v4'
}
compile appDependencies.gitSha
compile appDependencies.stetho
compile appDependencies.strictmodeNotifier
compile appDependencies.anrWatchDog
compile appDependencies.blockCanary
compile appDependencies.leakCanary
apt aptDependencies.daggerApt
apt aptDependencies.autoBundleApt
apt aptDependencies.butterKnifeApt
androidTestCompile project(':testbase')
androidTestCompile(testDependencies.androidJUnitRunner) {
exclude module: 'support-annotations'
}
androidTestCompile(testDependencies.mockito) {
exclude module: 'hamcrest-core'
}
androidTestCompile testDependencies.dexmaker
androidTestCompile(testDependencies.dexmakerMockito) {
exclude module: 'hamcrest-core'
exclude module: 'mockito-core'
}
androidTestCompile(testDependencies.androidJUnit4Rules) {
exclude module: 'support-annotations'
exclude module: 'hamcrest-core'
}
androidTestApt(aptDependencies.daggerApt) {
exclude module: 'dagger'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment