[Android] Set version name in BuildConfig variables

Geoffrey Métais git at videolan.org
Mon Feb 23 11:34:50 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Feb 23 11:33:44 2015 +0100| [698a970a2f8f6eeb939d6642f08bfe69673aea4f] | committer: Geoffrey Métais

Set version name in BuildConfig variables

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=698a970a2f8f6eeb939d6642f08bfe69673aea4f
---

 vlc-android/build.gradle |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vlc-android/build.gradle b/vlc-android/build.gradle
index 2ebedab..1c3373e 100644
--- a/vlc-android/build.gradle
+++ b/vlc-android/build.gradle
@@ -135,14 +135,15 @@ android {
     applicationVariants.all { variant ->
         def manifestParser = new com.android.builder.core.DefaultManifestParser()
         // get the version code of each flavor
+        def vlcVersion = manifestParser.getVersionName(android.sourceSets.main.manifest.srcFile)
         def targetVersion = variant.productFlavors.get(0).versionCode
         def abiVersion = variant.productFlavors.get(1).versionCode
 
         // set the composite code
         variant.mergedFlavor.versionCode = targetVersion * 10000000 + manifestParser.getVersionCode(android.sourceSets.main.manifest.srcFile) + abiVersion
+        variant.mergedFlavor.versionName = vlcVersion
 
         //Custom APK name
-        def vlcVersion = manifestParser.getVersionName(android.sourceSets.main.manifest.srcFile)
         variant.outputs.each { output ->
             def outputName = "VLC-"+vlcVersion+"-"+variant.productFlavors.get(1).name+".apk"
             output.outputFile = new File(output.outputFile.parentFile, outputName);



More information about the Android mailing list