[Android] Upgrade gradle plugin to version 2.2
Geoffrey Métais
git at videolan.org
Tue Sep 20 09:16:07 CEST 2016
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Sep 20 09:13:17 2016 +0200| [b0871644071e9b68f7ed66bc9be318b2ae92d677] | committer: Geoffrey Métais
Upgrade gradle plugin to version 2.2
> https://code.videolan.org/videolan/vlc-android/commit/b0871644071e9b68f7ed66bc9be318b2ae92d677
---
build.gradle | 2 +-
libvlc/build.gradle | 10 ++++++----
vlc-android/build.gradle | 8 +++++---
3 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/build.gradle b/build.gradle
index a87855c..aacf618 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.1.3'
+ classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.jakewharton.sdkmanager:sdk-manager-plugin:1.5.0-SNAPSHOT'
}
}
diff --git a/libvlc/build.gradle b/libvlc/build.gradle
index 8c52ba3..0f7152e 100644
--- a/libvlc/build.gradle
+++ b/libvlc/build.gradle
@@ -1,5 +1,7 @@
apply plugin: 'com.android.library'
+import com.android.builder.core.DefaultManifestParser
+
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
@@ -27,11 +29,11 @@ android {
// Make per-variant version code
libraryVariants.all { variant ->
- def manifestParser = new com.android.builder.core.DefaultManifestParser()
+ def manifestParser = new DefaultManifestParser(android.sourceSets.main.manifest.srcFile)
// get the version code of each flavor
- def vlcVersion = manifestParser.getVersionName(android.sourceSets.main.manifest.srcFile)
- manifestParser = new com.android.builder.core.DefaultManifestParser()
- def androidVersion = manifestParser.getVersionName(file('../vlc-android/AndroidManifest.xml'))
+ def vlcVersion = manifestParser.getVersionName()
+ manifestParser = new DefaultManifestParser(file('../vlc-android/AndroidManifest.xml'))
+ def androidVersion = manifestParser.getVersionName()
//Custom APK name
variant.outputs.each { output ->
def outputFile = output.outputFile
diff --git a/vlc-android/build.gradle b/vlc-android/build.gradle
index 429fb9b..0fbb275 100644
--- a/vlc-android/build.gradle
+++ b/vlc-android/build.gradle
@@ -1,5 +1,7 @@
apply plugin: 'com.android.application'
+import com.android.builder.core.DefaultManifestParser
+
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
@@ -134,14 +136,14 @@ android {
// make per-variant version code
applicationVariants.all { variant ->
- def manifestParser = new com.android.builder.core.DefaultManifestParser()
+ def manifestParser = new DefaultManifestParser(android.sourceSets.main.manifest.srcFile)
// get the version code of each flavor
- def vlcVersion = manifestParser.getVersionName(android.sourceSets.main.manifest.srcFile)
+ def vlcVersion = manifestParser.getVersionName()
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.versionCode = targetVersion * 10000000 + manifestParser.getVersionCode() + abiVersion
variant.mergedFlavor.versionName = vlcVersion
//Custom APK name
More information about the Android
mailing list