cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [1/2] android commit: CB-7980: Add 9 to versionCode for minSdk 20+ if not multiarch
Date Tue, 23 Dec 2014 21:31:26 GMT
Repository: cordova-android
Updated Branches:
  refs/heads/master 931a996da -> 7cfb33d0e


CB-7980: Add 9 to versionCode for minSdk 20+ if not multiarch


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/9224ab15
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/9224ab15
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/9224ab15

Branch: refs/heads/master
Commit: 9224ab15929b80d1b149e9f9e4743de86a04d77b
Parents: 931a996
Author: Mark Koudritsky <kamrik@gmail.com>
Authored: Thu Nov 6 15:38:48 2014 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Tue Dec 23 15:29:40 2014 -0500

----------------------------------------------------------------------
 bin/templates/project/build.gradle | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/9224ab15/bin/templates/project/build.gradle
----------------------------------------------------------------------
diff --git a/bin/templates/project/build.gradle b/bin/templates/project/build.gradle
index a5faf91..573b289 100644
--- a/bin/templates/project/build.gradle
+++ b/bin/templates/project/build.gradle
@@ -73,7 +73,7 @@ android {
     }
 
     defaultConfig {
-        versionCode Integer.parseInt(System.env.ANDROID_VERSION_CODE ?: ("" + getVersionCodeFromManifest()
+ "0"))
+        versionCode Integer.parseInt(System.env.ANDROID_VERSION_CODE ?: ("" + getIntFromManifest("versionCode")
+ "0"))
     }
 
     compileSdkVersion cordova.cordovaSdkVersion
@@ -99,6 +99,8 @@ android {
                 }
             }
         }
+    } else if (getIntFromManifest("minSdkVersion") >= 20) {
+        defaultConfig.versionCode += 9
     }
 
     compileOptions {
@@ -179,9 +181,9 @@ gradle.taskGraph.whenReady { taskGraph ->
     }
 }
 
-def getVersionCodeFromManifest() {
+def getIntFromManifest(name) {
     def manifestFile = file(android.sourceSets.main.manifest.srcFile)
-    def pattern = Pattern.compile("versionCode=\"(\\d+)\"")
+    def pattern = Pattern.compile(name + "=\"(\\d+)\"")
     def matcher = pattern.matcher(manifestFile.getText())
     matcher.find()
     return Integer.parseInt(matcher.group(1))


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message