From 8e5abeea3a961ff290c0de8e46296ac5e247e917 Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Sun, 27 Jan 2019 10:55:08 +0100 Subject: [PATCH] simplify versionCode removed implementation was some Eclipse/ant style, now it's Gradle style --- app/build.gradle | 22 ++++++---------------- app/src/main/AndroidManifest.xml | 10 ++-------- build.gradle | 4 +--- 3 files changed, 9 insertions(+), 27 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 8bc4dc4c4..55e15f130 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -18,20 +18,6 @@ buildscript { } } -def getMyVersionName() { - def parsedManifestXml = (new XmlSlurper()) - .parse("${projectDir}/src/main/AndroidManifest.xml") - .declareNamespace(android: "http://schemas.android.com/apk/res/android") - return parsedManifestXml."@android:versionName" -} - -def getMyVersionCode() { - def parsedManifestXml = (new XmlSlurper()) - .parse("${projectDir}/src/main/AndroidManifest.xml") - .declareNamespace(android: "http://schemas.android.com/apk/res/android") - return parsedManifestXml."@android:versionCode".toInteger() -} - android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion @@ -40,8 +26,12 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled true - versionCode getMyVersionCode() - versionName "${getMyVersionName()}" + // Version code schema: + // "1.2.3-SNAPSHOT" -> 1020300 + // "1.2.3-RC4" -> 1020304 + // btw I would recommend to autogenerate this + versionCode 1070195 + versionName "1.7.1" testApplicationId "de.test.antennapod" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" generatedDensities = [] diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 0c3685ed1..216afc6b7 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,14 +1,8 @@ - + android:installLocation="auto"> + diff --git a/build.gradle b/build.gradle index c823a689b..e23440374 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,8 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - buildscript { repositories { + google() jcenter() mavenCentral() - google() } dependencies { classpath 'com.android.tools.build:gradle:3.1.0'