cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@apache.org
Subject [07/12] cordova-amazon-fireos git commit: CB-7980: Add 9 to versionCode for minSdk 20+ if not multiarch
Date Fri, 16 Jan 2015 21:32:51 GMT
CB-7980: Add 9 to versionCode for minSdk 20+ if not multiarch


Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/252ceaf6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/252ceaf6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/252ceaf6

Branch: refs/heads/master
Commit: 252ceaf6c52a97df09d22d2f469bdcd2533b85c3
Parents: 1ce29c2
Author: Mark Koudritsky <kamrik@gmail.com>
Authored: Thu Nov 6 15:38:48 2014 -0500
Committer: Ajitha <ajithas@amazon.com>
Committed: Mon Jan 5 06:02:39 2015 +0000

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


http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/252ceaf6/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