cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject android commit: CB-10014: Set gradle applicationId to package name.
Date Mon, 04 Jan 2016 20:24:08 GMT
Repository: cordova-android
Updated Branches:
  refs/heads/master b6a329d47 -> fb9cf60c4


CB-10014: Set gradle applicationId to package name.

This closes 247


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

Branch: refs/heads/master
Commit: fb9cf60c4100d5bc6f9320747611da1ca0ced289
Parents: b6a329d
Author: Darryl Pogue <darryl@ayogo.com>
Authored: Mon Dec 21 14:53:49 2015 -0800
Committer: Joe Bowser <bowserj@apache.org>
Committed: Mon Jan 4 12:18:55 2016 -0800

----------------------------------------------------------------------
 bin/templates/project/build.gradle | 2 ++
 framework/cordova.gradle           | 9 +++++++++
 2 files changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/fb9cf60c/bin/templates/project/build.gradle
----------------------------------------------------------------------
diff --git a/bin/templates/project/build.gradle b/bin/templates/project/build.gradle
index f540f69..157c4ee 100644
--- a/bin/templates/project/build.gradle
+++ b/bin/templates/project/build.gradle
@@ -163,6 +163,8 @@ android {
 
     defaultConfig {
         versionCode cdvVersionCode ?: Integer.parseInt("" + privateHelpers.extractIntFromManifest("versionCode")
+ "0")
+        applicationId privateHelpers.extractStringFromManifest("package")
+
         if (cdvMinSdkVersion != null) {
             minSdkVersion cdvMinSdkVersion
         }

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/fb9cf60c/framework/cordova.gradle
----------------------------------------------------------------------
diff --git a/framework/cordova.gradle b/framework/cordova.gradle
index 6e89c4c..7465266 100644
--- a/framework/cordova.gradle
+++ b/framework/cordova.gradle
@@ -128,6 +128,14 @@ def doExtractIntFromManifest(name) {
     return Integer.parseInt(matcher.group(1))
 }
 
+def doExtractStringFromManifest(name) {
+    def manifestFile = file(android.sourceSets.main.manifest.srcFile)
+    def pattern = Pattern.compile(name + "=\"(\\S+)\"")
+    def matcher = pattern.matcher(manifestFile.getText())
+    matcher.find()
+    return matcher.group(1)
+}
+
 def doPromptForPassword(msg) {
     if (System.console() == null) {
         def ret = null
@@ -179,6 +187,7 @@ ext {
     privateHelpers.getProjectTarget = { doGetProjectTarget() }
     privateHelpers.findLatestInstalledBuildTools = { doFindLatestInstalledBuildTools('19.1.0')
}
     privateHelpers.extractIntFromManifest = { name -> doExtractIntFromManifest(name) }
+    privateHelpers.extractStringFromManifest = { name -> doExtractStringFromManifest(name)
}
     privateHelpers.promptForPassword = { msg -> doPromptForPassword(msg) }
     privateHelpers.ensureValueExists = { filePath, props, key -> doEnsureValueExists(filePath,
props, key) }
 


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


Mime
View raw message