Skip to content

Instantly share code, notes, and snippets.

@jt-gilkeson
Last active March 24, 2017 22:23
Show Gist options
  • Save jt-gilkeson/b20521c1bbc6b51514bf to your computer and use it in GitHub Desktop.
Save jt-gilkeson/b20521c1bbc6b51514bf to your computer and use it in GitHub Desktop.
/*
* Copyright (C) 2015 J.T. Gilkeson
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
dexOptions {
javaMaxHeapSize "4g"
jumboMode = true
}
signingConfigs {
release {
storeFile file("release.keystore")
storePassword "android"
keyAlias "androidkey"
keyPassword "android"
}
}
defaultConfig {
minSdkVersion 15
targetSdkVersion 23
multiDexEnabled true
versionCode 1
versionName "1.0"
}
buildTypes {
release {
debuggable false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
qa {
debuggable true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
applicationIdSuffix ".debug"
signingConfig signingConfigs.release
}
debug {
debuggable true
minifyEnabled false // No proguard for faster dev builds
applicationIdSuffix ".debug"
}
}
productFlavors {
normal {
applicationId "com.jt.examplemultidexproguard"
}
developer {
applicationId "com.jt.examplemultidexproguard"
minSdkVersion 21 // avoid multiDex for faster dev builds
}
}
// Filter out bad variants, only allow: developerDebug, normalQa, normalRelease
variantFilter { variant ->
if (variant.getFlavors().get(0).name == 'developer' && variant.buildType.name != 'debug') {
variant.setIgnore(true);
}
else if (variant.getFlavors().get(0).name == 'normal' && variant.buildType.name == 'debug') {
variant.setIgnore(true);
}
}
}
dependencies {
compile fileTree(include: '*.jar', dir: 'libs')
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:23.4.0'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment