Skip to content

Instantly share code, notes, and snippets.

@xalexchen
Last active December 22, 2015 21:29
Show Gist options
  • Save xalexchen/6533922 to your computer and use it in GitHub Desktop.
Save xalexchen/6533922 to your computer and use it in GitHub Desktop.
rename final apk accoring to build time
String VERSION_NAME = "v0.0.1"
int VERSION_CODE = 1
String APK_NAME = "Hello"
android {
compileSdkVersion 18
buildToolsVersion "18.0.1"
defaultConfig {
minSdkVersion 10
targetSdkVersion 18
versionCode VERSION_CODE
versionName VERSION_NAME
}
signingConfigs {
myConfig {
storeFile file('android')
storePassword "android"
keyAlias "android"
keyPassword "android"
}
}
buildTypes {
release {
buildDate = new SimpleDateFormat("yyyyMMddHHmm").format(new Date())
project.archivesBaseName = APK_NAME+"-"+VERSION_NAME + "-"+buildDate;
zipAlign true
signingConfig signingConfigs.myConfig
runProguard true
proguardFile file('proguard.txt')
}
debug {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment