Skip to content

Instantly share code, notes, and snippets.

@elye elye/custom.build.gradle
Last active Nov 25, 2017

Embed
What would you like to do?
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
You can’t perform that action at this time.