[Android] Upgrade AGP to v3.2.0

Geoffrey Métais git at videolan.org
Tue Sep 25 11:23:04 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Sep 25 11:19:28 2018 +0200| [f9e7715e6f5a48c50fe6d90f3f7576ca540882ac] | committer: Geoffrey Métais

Upgrade AGP to v3.2.0

> https://code.videolan.org/videolan/vlc-android/commit/f9e7715e6f5a48c50fe6d90f3f7576ca540882ac
---

 api/build.gradle                 |  1 +
 api/src/main/AndroidManifest.xml |  2 --
 build.gradle                     |  4 ++--
 compile.sh                       |  2 +-
 libvlc/AndroidManifest.xml       |  1 -
 libvlc/build.gradle              |  6 +-----
 medialibrary/AndroidManifest.xml |  2 --
 vlc-android/build.gradle         | 19 +++++--------------
 8 files changed, 10 insertions(+), 27 deletions(-)

diff --git a/api/build.gradle b/api/build.gradle
index d574dc238..5f1a35acf 100644
--- a/api/build.gradle
+++ b/api/build.gradle
@@ -31,6 +31,7 @@ android {
     defaultConfig {
         versionCode 1
         versionName "1.0"
+        minSdkVersion rootProject.ext.minSdkVersion
     }
     buildTypes {
         release {
diff --git a/api/src/main/AndroidManifest.xml b/api/src/main/AndroidManifest.xml
index f83262f22..fd082a431 100644
--- a/api/src/main/AndroidManifest.xml
+++ b/api/src/main/AndroidManifest.xml
@@ -24,8 +24,6 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="org.videolan.vlc.plugin.api">
 
-    <uses-sdk android:minSdkVersion="14" />
-
     <application android:label="@string/app_name"
         android:supportsRtl="true">
 
diff --git a/build.gradle b/build.gradle
index f47812078..5a79394a2 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,7 +1,7 @@
 // Top-level build file where you can add configuration options common to all sub-projects/modules.
 buildscript {
-    ext.android_plugin_version = '3.1.4'
-    ext.kotlin_version = '1.2.70'
+    ext.android_plugin_version = '3.2.0'
+    ext.kotlin_version = '1.2.71'
     ext.kotlinx_version = '0.26.1'
     repositories {
         flatDir dirs: "gradle/plugins"
diff --git a/compile.sh b/compile.sh
index 329d293d7..637e1ad79 100755
--- a/compile.sh
+++ b/compile.sh
@@ -116,7 +116,7 @@ fi
 
 if [ ! -d "gradle/wrapper" ]; then
     diagnostic "Downloading gradle"
-    GRADLE_VERSION=4.4
+    GRADLE_VERSION=4.6
     GRADLE_URL=https://download.videolan.org/pub/contrib/gradle/gradle-${GRADLE_VERSION}-bin.zip
     wget ${GRADLE_URL} 2>/dev/null || curl -O ${GRADLE_URL}
     checkfail "gradle: download failed"
diff --git a/libvlc/AndroidManifest.xml b/libvlc/AndroidManifest.xml
index 52073c83b..33d155196 100644
--- a/libvlc/AndroidManifest.xml
+++ b/libvlc/AndroidManifest.xml
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
       package="org.videolan" android:versionCode="2" android:versionName="3.0.0">
-    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="26"/>
 </manifest> 
diff --git a/libvlc/build.gradle b/libvlc/build.gradle
index 38fe93900..a7e114177 100644
--- a/libvlc/build.gradle
+++ b/libvlc/build.gradle
@@ -1,7 +1,5 @@
 apply plugin: 'com.android.library'
 
-import com.android.builder.core.DefaultManifestParser
-
 android {
     compileSdkVersion rootProject.ext.compileSdkVersion
 
@@ -28,9 +26,7 @@ android {
 
     // Make per-variant version code
     libraryVariants.all { variant ->
-        def manifestParser = new DefaultManifestParser(android.sourceSets.main.manifest.srcFile)
-        // get the version code of each flavor
-        def vlcVersion = manifestParser.getVersionName()
+        def vlcVersion = rootProject.ext.versionName
         //Custom APK name
         variant.outputs.all { output ->
             if (outputFileName != null && outputFileName.endsWith('.aar')) {
diff --git a/medialibrary/AndroidManifest.xml b/medialibrary/AndroidManifest.xml
index 793b41797..e3efabff4 100644
--- a/medialibrary/AndroidManifest.xml
+++ b/medialibrary/AndroidManifest.xml
@@ -2,8 +2,6 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="org.videolan.medialibrary">
 
-    <uses-sdk android:minSdkVersion="14" />
-
     <application/>
 
 </manifest>
diff --git a/vlc-android/build.gradle b/vlc-android/build.gradle
index 5bb3ccb83..6e47152da 100644
--- a/vlc-android/build.gradle
+++ b/vlc-android/build.gradle
@@ -153,22 +153,14 @@ android {
     applicationVariants.all { variant ->
 
         def generatedCode = variant.productFlavors.get(0).versionCode * 10000000 + defaultConfig.versionCode + variant.productFlavors.get(1).versionCode
-        variant.mergedFlavor.versionCode = generatedCode
-        //Custom APK name
-        variant.outputs.all { output ->
+        //Custom APK name and versionCode
+        variant.outputs.each { output ->
+            output.versionCodeOverride = generatedCode
             def outputName = "VLC-Android-"
             if (variant.productFlavors.get(0).name != "vanilla")
                 outputName += variant.productFlavors.get(0).name.toUpperCase() + "-"
             outputName += variant.versionName + "-" + variant.productFlavors.get(1).name + ".apk"
-            outputFileName = outputName
-            output.processManifest.doLast {
-                // set the composite code
-                String manifestPath = "$manifestOutputDirectory/AndroidManifest.xml"
-                def manifestContent = file(manifestPath).getText()
-                manifestContent = manifestContent.replace('android:versionCode="1"',
-                        String.format('android:versionCode="%s"', generatedCode))
-                file(manifestPath).write(manifestContent)
-            }
+            output.outputFileName = outputName
         }
     }
 
@@ -204,7 +196,7 @@ task generateSources (type: Jar) {
 }
 
 dependencies {
-    def paging_version = "1.0.0"
+    def paging_version = "1.0.1"
     implementation project(':libvlc')
     implementation project(':medialibrary')
     implementation project(':api')
@@ -221,7 +213,6 @@ dependencies {
     implementation "com.android.support:support-tv-provider:$rootProject.ext.appCompatVersion"
     // Kotlin
     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
-    kapt "com.android.databinding:compiler:$rootProject.ext.android_plugin_version"
     implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$rootProject.ext.kotlinx_version"
     implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$rootProject.ext.kotlinx_version"
     implementation "android.arch.lifecycle:extensions:$rootProject.ext.archVersion"



More information about the Android mailing list