Skip to content
Snippets Groups Projects
Commit b0871644 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Upgrade gradle plugin to version 2.2

parent 20926d2b
No related branches found
No related tags found
No related merge requests found
......@@ -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'
}
}
......
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
......
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment