Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Below is the example for how to make gradle to have apk file name with version.
- apply plugin: 'com.android.application'
- android {
- signingConfigs {
- config {
- ... SOMETHING LIKE RELEASE SIGNING CONFIG ...
- }
- }
- compileSdkVersion 23
- buildToolsVersion "23.0.2"
- project.archivesBaseName = "LMS"; // HERE YOU NEED TO PROVIDE PROJECT NAME (BASE NAME)
- signingConfigs {
- release {
- keyAlias 'ALIAS_NAME'
- keyPassword 'ALIAS_PASWORD'
- storeFile file('C:/../../.android/KEYSTORE_NAME.keystore')
- storePassword 'KEYSTORE_PASSWORD'
- }
- }
- defaultConfig {
- ...
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- // HERE YOU NEED TO DEFINE THE APK FILE NAME AS LIKE BELOW
- applicationVariants.all { variant ->
- variant.outputs.each{ output ->
- output.outputFile = new File(output.outputFile.parent,output.outputFile.name.replace(".apk","_v" + defaultConfig.versionName + ".apk" ))
- }
- }
- }
- }
- productFlavors {
- staging {
- ...
- }
- live {
- ...
- }
- }
- }
- dependencies {
- compile fileTree(include: ['*.jar'], dir: 'libs')
- testCompile 'junit:junit:4.12'
- ...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement