Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6053B10EAB for ; Mon, 12 Aug 2013 20:59:18 +0000 (UTC) Received: (qmail 23648 invoked by uid 500); 12 Aug 2013 20:59:18 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 23620 invoked by uid 500); 12 Aug 2013 20:59:18 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 23529 invoked by uid 99); 12 Aug 2013 20:59:18 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Aug 2013 20:59:18 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id F40338BCF4C; Mon, 12 Aug 2013 20:59:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: filmaj@apache.org To: commits@cordova.apache.org Date: Mon, 12 Aug 2013 20:59:20 -0000 Message-Id: <89d2528f9190470a88b4e67b52409a88@git.apache.org> In-Reply-To: <07bfef1d53164d2a8d28f16761069bf9@git.apache.org> References: <07bfef1d53164d2a8d28f16761069bf9@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [4/7] git commit: [CB-3191] Updated README to reflect tag support. Added support + specs for ios. [CB-3191] Updated README to reflect tag support. Added support + specs for ios. Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/86ef079b Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/86ef079b Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/86ef079b Branch: refs/heads/master Commit: 86ef079b2363194411614a76485a9823f903d0f5 Parents: 057021d Author: Fil Maj Authored: Mon Aug 12 13:22:30 2013 -0700 Committer: Fil Maj Committed: Mon Aug 12 13:22:30 2013 -0700 ---------------------------------------------------------------------- README.md | 1 + spec/metadata/ios_parser.spec.js | 13 +++++++++++-- src/metadata/ios_parser.js | 4 ++++ 3 files changed, 16 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/86ef079b/README.md ---------------------------------------------------------------------- diff --git a/README.md b/README.md index 04f182b..2968366 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,7 @@ This file is what you should be editing to modify your application's metadata. A - The version can be modified via the `version` attribute from the top-level `` element. - The whitelist can be modified using the `` elements. Make sure the `origin` attribute of your `` element points to a valid URL (you can use `*` as wildcard). For more information on the whitelisting syntax, see the [docs.phonegap.com](http://docs.phonegap.com/en/2.2.0/guide_whitelist_index.md.html#Domain%20Whitelist%20Guide). You can use either attribute `uri` ([BlackBerry-proprietary](https://developer.blackberry.com/html5/documentation/access_element_834677_11.html)) or `origin` ([standards-compliant](http://www.w3.org/TR/widgets-access/#attributes)) to denote the domain. - Platform-specific preferences can be customized via `` tags. See [docs.phonegap.com](http://docs.phonegap.com/en/2.3.0/guide_project-settings_index.md.html#Project%20Settings) for a list of preferences you can use. +- The entry/start page for your application can be defined via the `` element + attribute. ## platforms/ Platforms added to your application will have the native application project structures laid out within this directory. http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/86ef079b/spec/metadata/ios_parser.spec.js ---------------------------------------------------------------------- diff --git a/spec/metadata/ios_parser.spec.js b/spec/metadata/ios_parser.spec.js index 546568e..509cf26 100644 --- a/spec/metadata/ios_parser.spec.js +++ b/spec/metadata/ios_parser.spec.js @@ -99,7 +99,7 @@ describe('ios project parser', function () { describe('update_from_config method', function() { var et, xml, find, write_xml, root, mv; - var cfg, find_obj, root_obj, cfg_access_add, cfg_access_rm, cfg_pref_add, cfg_pref_rm; + var cfg, find_obj, root_obj, cfg_access_add, cfg_access_rm, cfg_pref_add, cfg_pref_rm, cfg_content; var plist_parse, plist_build, xc; var update_name, xc_write; beforeEach(function() { @@ -137,10 +137,12 @@ describe('ios project parser', function () { cfg.version = function() { return 'one point oh' }; cfg.access.get = function() { return [] }; cfg.preference.get = function() { return [] }; + cfg.content = function() { return 'index.html'; }; cfg_access_add = jasmine.createSpy('config_parser access add'); cfg_access_rm = jasmine.createSpy('config_parser access rm'); cfg_pref_rm = jasmine.createSpy('config_parser pref rm'); cfg_pref_add = jasmine.createSpy('config_parser pref add'); + cfg_content = jasmine.createSpy('config_parser content'); cfg_parser.andReturn({ access:{ remove:cfg_access_rm, @@ -151,7 +153,8 @@ describe('ios project parser', function () { remove:cfg_pref_rm, get:function(){}, add:cfg_pref_add - } + }, + content:cfg_content }); p = new platforms.ios.parser(ios_proj); }); @@ -201,6 +204,12 @@ describe('ios project parser', function () { done(); }); }); + it('should update the content tag / start page', function(done) { + p.update_from_config(cfg, function() { + expect(cfg_content).toHaveBeenCalledWith('index.html'); + done(); + }); + }); it('should wipe out the ios preferences every time', function(done) { p.update_from_config(cfg, function() { expect(cfg_pref_rm).toHaveBeenCalled(); http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/86ef079b/src/metadata/ios_parser.js ---------------------------------------------------------------------- diff --git a/src/metadata/ios_parser.js b/src/metadata/ios_parser.js index 4766a64..c023ef7 100644 --- a/src/metadata/ios_parser.js +++ b/src/metadata/ios_parser.js @@ -99,6 +99,7 @@ module.exports.prototype = { var plistFile = path.join(this.cordovaproj, this.originalName + '-Info.plist'); var infoPlist = plist.parseFileSync(plistFile); infoPlist['CFBundleIdentifier'] = pkg; + // Update version (bundle version) infoPlist['CFBundleVersion'] = version; var info_contents = plist.build(infoPlist); @@ -113,6 +114,9 @@ module.exports.prototype = { config.access.get().forEach(function(uri) { self.config.access.add(uri); }); + + // Update content (start page) + this.config.content(config.content()); // Update preferences this.config.preference.remove();