You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2016/08/17 23:12:50 UTC
ios commit: CB-9789: Allow setting the default locale
Repository: cordova-ios
Updated Branches:
refs/heads/master c24553551 -> a06f41918
CB-9789: Allow setting the default locale
This closes #237
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/a06f4191
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/a06f4191
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/a06f4191
Branch: refs/heads/master
Commit: a06f41918c16cb266cb3106a826c7efd8cc8667e
Parents: c245535
Author: Darryl Pogue <da...@ayogo.com>
Authored: Thu Jul 21 20:10:30 2016 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Wed Aug 17 16:09:34 2016 -0700
----------------------------------------------------------------------
bin/templates/scripts/cordova/lib/prepare.js | 12 ++++++++----
tests/spec/unit/prepare.spec.js | 18 ++++++++++++++++--
2 files changed, 24 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/a06f4191/bin/templates/scripts/cordova/lib/prepare.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/prepare.js b/bin/templates/scripts/cordova/lib/prepare.js
index f3d6b79..f469e06 100644
--- a/bin/templates/scripts/cordova/lib/prepare.js
+++ b/bin/templates/scripts/cordova/lib/prepare.js
@@ -174,7 +174,7 @@ function updateProject(platformConfig, locations) {
// because node and shell scripts handles unicode symbols differently
// We need to normalize the name to NFD form since iOS uses NFD unicode form
var name = unorm.nfd(platformConfig.name());
- var pkg = platformConfig.ios_CFBundleIdentifier() || platformConfig.packageName();
+ var pkg = platformConfig.getAttribute('ios-CFBundleIdentifier') || platformConfig.packageName();
var version = platformConfig.version();
var originalName = path.basename(locations.xcodeCordovaProj);
@@ -186,9 +186,13 @@ function updateProject(platformConfig, locations) {
// Update version (bundle version)
infoPlist['CFBundleShortVersionString'] = version;
- var CFBundleVersion = platformConfig.ios_CFBundleVersion() || default_CFBundleVersion(version);
+ var CFBundleVersion = platformConfig.getAttribute('ios-CFBundleVersion') || default_CFBundleVersion(version);
infoPlist['CFBundleVersion'] = CFBundleVersion;
+ if (platformConfig.getAttribute('defaultlocale')) {
+ infoPlist['CFBundleDevelopmentRegion'] = platformConfig.getAttribute('defaultlocale');
+ }
+
// replace Info.plist ATS entries according to <access> and <allow-navigation> config.xml entries
var ats = writeATSEntries(platformConfig);
if (Object.keys(ats).length > 0) {
@@ -369,7 +373,7 @@ function updateIcons(cordovaProject, locations) {
}
function cleanIcons(projectRoot, projectConfig, locations) {
- var icons = projectConfig.getIcons('android');
+ var icons = projectConfig.getIcons('ios');
if (icons.length > 0) {
var platformProjDir = path.relative(projectRoot, locations.xcodeCordovaProj);
var iconsDir = getIconsDir(projectRoot, platformProjDir);
@@ -440,7 +444,7 @@ function updateSplashScreens(cordovaProject, locations) {
}
function cleanSplashScreens(projectRoot, projectConfig, locations) {
- var splashScreens = projectConfig.getSplashScreens('android');
+ var splashScreens = projectConfig.getSplashScreens('ios');
if (splashScreens.length > 0) {
var platformProjDir = path.relative(projectRoot, locations.xcodeCordovaProj);
var splashScreensDir = getSplashScreensDir(projectRoot, platformProjDir);
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/a06f4191/tests/spec/unit/prepare.spec.js
----------------------------------------------------------------------
diff --git a/tests/spec/unit/prepare.spec.js b/tests/spec/unit/prepare.spec.js
index ec2a976..a2b2737 100644
--- a/tests/spec/unit/prepare.spec.js
+++ b/tests/spec/unit/prepare.spec.js
@@ -115,13 +115,27 @@ describe('prepare', function () {
});
});
it('should write out the app id to info plist as CFBundleIdentifier', function(done) {
- cfg.ios_CFBundleIdentifier = function() { return null; };
+ var orig = cfg.getAttribute;
+ cfg.getAttribute = function(name) {
+ if (name == 'ios-CFBundleIdentifier') {
+ return null;
+ }
+ return orig.call(this, name);
+ };
+
wrapper(updateProject(cfg, p.locations), done, function() {
expect(plist.build.mostRecentCall.args[0].CFBundleIdentifier).toEqual('testpkg');
});
});
it('should write out the app id to info plist as CFBundleIdentifier with ios-CFBundleIdentifier', function(done) {
- cfg.ios_CFBundleIdentifier = function() { return 'testpkg_ios'; };
+ var orig = cfg.getAttribute;
+ cfg.getAttribute = function(name) {
+ if (name == 'ios-CFBundleIdentifier') {
+ return 'testpkg_ios';
+ }
+ return orig.call(this, name);
+ };
+
wrapper(updateProject(cfg, p.locations), done, function() {
expect(plist.build.mostRecentCall.args[0].CFBundleIdentifier).toEqual('testpkg_ios');
});
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org