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 2017/06/10 09:43:18 UTC

ios commit: [CB-10916] Support display name for iOS

Repository: cordova-ios
Updated Branches:
  refs/heads/master 27d2919ca -> 8c77a0b99


[CB-10916] Support display name for iOS

 This closes #228


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

Branch: refs/heads/master
Commit: 8c77a0b991ace06b470dba9496a24e6ef75c2be3
Parents: 27d2919
Author: Darryl Pogue <da...@ayogo.com>
Authored: Tue Jun 7 15:47:38 2016 -0700
Committer: Shazron Abdullah <sh...@gmail.com>
Committed: Sat Jun 10 02:42:57 2017 -0700

----------------------------------------------------------------------
 bin/templates/scripts/cordova/lib/prepare.js |  5 +++++
 tests/spec/unit/prepare.spec.js              | 12 +++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8c77a0b9/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 973074e..d59ff81 100644
--- a/bin/templates/scripts/cordova/lib/prepare.js
+++ b/bin/templates/scripts/cordova/lib/prepare.js
@@ -193,6 +193,7 @@ function updateProject(platformConfig, locations) {
     var name = unorm.nfd(platformConfig.name());
     var pkg = platformConfig.getAttribute('ios-CFBundleIdentifier') || platformConfig.packageName();
     var version = platformConfig.version();
+    var displayName = platformConfig.shortName && platformConfig.shortName();
 
     var originalName = path.basename(locations.xcodeCordovaProj);
 
@@ -210,6 +211,10 @@ function updateProject(platformConfig, locations) {
         infoPlist['CFBundleDevelopmentRegion'] = platformConfig.getAttribute('defaultlocale');
     }
 
+    if (displayName) {
+        infoPlist['CFBundleDisplayName'] = displayName;
+    }
+
     // replace Info.plist ATS entries according to <access> and <allow-navigation> config.xml entries
     var ats = writeATSEntries(platformConfig);
     if (Object.keys(ats).length > 0) {

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8c77a0b9/tests/spec/unit/prepare.spec.js
----------------------------------------------------------------------
diff --git a/tests/spec/unit/prepare.spec.js b/tests/spec/unit/prepare.spec.js
index 5f43e38..fadf638 100644
--- a/tests/spec/unit/prepare.spec.js
+++ b/tests/spec/unit/prepare.spec.js
@@ -1485,7 +1485,13 @@ describe('prepare', function() {
                 expect(exceptionDomains['null']).toBeUndefined();
                 expect(exceptionDomains['undefined']).toBeUndefined();
             });
-        });   
+        });
+        it('Test#020 : <name> - should write out the display name to info plist as CFBundleDisplayName', function(done) {
+            cfg.shortName = function() { return 'MyApp'; };
+            wrapper(updateProject(cfg, p.locations), done, function() {
+                expect(plist.build.mostRecentCall.args[0].CFBundleDisplayName).toEqual('MyApp');
+            });
+        });
     });
 
     describe('<resource-file> tests', function() {
@@ -1588,7 +1594,7 @@ describe('prepare', function() {
             locations: { www: path.join(iosProject, 'www') }
         };
 
-        it('Test#020 : should update project-level www and with platform agnostic www and merges', function() {
+        it('Test#021 : should update project-level www and with platform agnostic www and merges', function() {
             var merges_path = path.join(project.root, 'merges', 'ios');
             shell.mkdir('-p', merges_path);
             updateWww(project, p.locations);
@@ -1598,7 +1604,7 @@ describe('prepare', function() {
                 { rootDir : iosProject },
                 logFileOp);
         });
-        it('Test#021 : should skip merges if merges directory does not exist', function() {
+        it('Test#022 : should skip merges if merges directory does not exist', function() {
             var merges_path = path.join(project.root, 'merges', 'ios');
             shell.rm('-rf', merges_path);
             updateWww(project, p.locations);


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