cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [06/11] cordova-lib git commit: CB-7827 Add support for `android-activityName` within `config.xml` (close #171)
Date Tue, 03 Mar 2015 08:31:03 GMT
CB-7827 Add support for `android-activityName` within `config.xml` (close #171)

Requires cordova-android@4.0.0


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

Branch: refs/heads/CB-8551
Commit: 264f5e8c5761478406dd4f171fa71ac8fafdb3f9
Parents: 96595cf
Author: Connor Pearson <cjp822@gmail.com>
Authored: Sun Feb 22 15:46:23 2015 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Mon Mar 2 10:02:25 2015 -0500

----------------------------------------------------------------------
 cordova-lib/src/configparser/ConfigParser.js | 3 +++
 cordova-lib/src/cordova/platform.js          | 8 ++++++++
 2 files changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/264f5e8c/cordova-lib/src/configparser/ConfigParser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/configparser/ConfigParser.js b/cordova-lib/src/configparser/ConfigParser.js
index fafc76f..213432f 100644
--- a/cordova-lib/src/configparser/ConfigParser.js
+++ b/cordova-lib/src/configparser/ConfigParser.js
@@ -108,6 +108,9 @@ ConfigParser.prototype = {
     android_packageName: function() {
         return this.doc.getroot().attrib['android-packageName'];
     },
+    android_activityName: function() {
+	return this.doc.getroot().attrib['android-activityName'];
+    },
     ios_CFBundleIdentifier: function() {
         return this.doc.getroot().attrib['ios-CFBundleIdentifier'];
     },

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/264f5e8c/cordova-lib/src/cordova/platform.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/platform.js b/cordova-lib/src/cordova/platform.js
index a7bd1e4..c599734 100644
--- a/cordova-lib/src/cordova/platform.js
+++ b/cordova-lib/src/cordova/platform.js
@@ -532,12 +532,20 @@ function getCreateArgs(platDetails, projectRoot, cfg, template_dir,
opts) {
     // We need to normalize the name to NFD form since iOS uses NFD unicode form
     var name = platDetails.platform == 'ios' ? unorm.nfd(cfg.name()) : cfg.name();
     args.push(output, pkg, name);
+
+    var activityName = cfg.android_activityName();
+    if (activityName && platDetails.platform === 'android' && semver.gte(platDetails.version,
'4.0.0-dev')) {
+        activityName = activityName.replace(/\W/g, '');
+        args.push('--activity-name', activityName);
+    }
+
     if (template_dir) {
         args.push(template_dir);
     }
     if (opts.link) {
         args.push('--link');
     }
+
     return args;
 }
 


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


Mime
View raw message