I\'d like to change \"app-release.apk\" file name to like following when I build an app by using gradle.
[format] (appname of package name)_V(version code)_(yyMMdd)_(
This may be the shortest way:
defaultConfig {
...
applicationId "com.blahblah.example"
versionCode 1
versionName "1.0"
setProperty("archivesBaseName", applicationId + "-v" + versionCode + "(" + versionName + ")")
}
buildType: like so
buildTypes {
debug {
...
versionNameSuffix "-T"
}
release {
...
versionNameSuffix "-R"
}
}
Keep in mind, Android Studio adds versionNameSuffix by build type name by default, so you may not need this.
Upd. In new versions of Android Studio you can it write little shorter(thanks for szx comment):
defaultConfig {
...
archivesBaseName = "$applicationId-v$versionCode($versionName)"
}