Skip to content

Instantly share code, notes, and snippets.

@elye
Last active November 25, 2017 06:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elye/b04780c77cbbb4a0e843cc279bb48fa8 to your computer and use it in GitHub Desktop.
Save elye/b04780c77cbbb4a0e843cc279bb48fa8 to your computer and use it in GitHub Desktop.
ext {
appVersionName = '1.0'
appPackageId = '<YourApplicationID>'
}
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "$appPackageId"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
debug {
storeFile file("<YourDebugKeyStoreLocation>")
}
release {
storeFile file("<YourReleaseKeyStoreLocation>")
storePassword "<YourReleaseKeyStorPassword>"
keyAlias "<YourKeyAlias>"
keyPassword "<YourKeyAliasPassword>"
}
}
buildTypes {
debug {
minifyEnabled true
useProguard false
proguardFiles getDefaultProguardFile ('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
productFlavors {
internal {
applicationId "$appPackageId" + ".internal"
versionName "i$appVersionName"
}
production {
applicationId "$appPackageId"
versionName "$appVersionName"
}
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
//noinspection GroovyAssignabilityCheck
output.outputFile = new File(output.outputFile.parent,
output.outputFile.name.replace(".apk", "-${variant.versionName}.apk"))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment