You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2013/08/12 22:59:17 UTC
[1/7] git commit: Added partial support for "content" tag in
config.xml "cordova prepare" now correctly handles the tag. Android
only.
Updated Branches:
refs/heads/master c775d2ab6 -> a2f6f4ab9
Added partial support for "content" tag in config.xml
"cordova prepare" now correctly handles the <content> tag. Android only.
Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/89b7efda
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/89b7efda
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/89b7efda
Branch: refs/heads/master
Commit: 89b7efda51b6273513a7bc04811eb1a1d6145d60
Parents: c775d2a
Author: Germano Gabbianelli <ty...@gmail.com>
Authored: Fri Apr 19 18:45:09 2013 +0200
Committer: Fil Maj <ma...@gmail.com>
Committed: Fri Aug 9 12:32:34 2013 -0700
----------------------------------------------------------------------
src/config_parser.js | 16 ++++++++++++++++
src/metadata/android_parser.js | 3 +++
2 files changed, 19 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/89b7efda/src/config_parser.js
----------------------------------------------------------------------
diff --git a/src/config_parser.js b/src/config_parser.js
index 5d1b8ed..5c5e0dc 100644
--- a/src/config_parser.js
+++ b/src/config_parser.js
@@ -45,6 +45,22 @@ config_parser.prototype = {
this.update();
} else return this.doc.getroot().attrib.version;
},
+ content: function(src) {
+ var content = this.doc.find('content');
+ if (src) {
+ content = content || new et.Element('content');
+ content.attrib.src = src;
+ this.update();
+ } else {
+ if (content === undefined) {
+ content = new et.Element('content');
+ content.attrib.src = 'index.html';
+ this.doc.getroot().append(content);
+ this.update();
+ }
+ return content.attrib.src;
+ }
+ },
update:function() {
fs.writeFileSync(this.path, this.doc.write({indent: 4}), 'utf-8');
}
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/89b7efda/src/metadata/android_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/android_parser.js b/src/metadata/android_parser.js
index b35b80d..3e9d680 100644
--- a/src/metadata/android_parser.js
+++ b/src/metadata/android_parser.js
@@ -119,6 +119,9 @@ module.exports.prototype = {
config.access.get().forEach(function(uri) {
android_cfg_xml.access.add(uri);
});
+
+ // Update content
+ android_cfg_xml.content(config.content());
// Update preferences
android_cfg_xml.preference.remove();
[2/7] git commit: [CB-3191] Added specs for config_parser changes to
include tag support. Updated stock template.
Posted by fi...@apache.org.
[CB-3191] Added specs for config_parser changes to include <content> tag support. Updated stock template.
Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/9ac61951
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/9ac61951
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/9ac61951
Branch: refs/heads/master
Commit: 9ac619516054283cbbb6802debd9cb9beaa420a0
Parents: 89b7efd
Author: Fil Maj <ma...@gmail.com>
Authored: Fri Aug 9 12:33:42 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Fri Aug 9 12:33:42 2013 -0700
----------------------------------------------------------------------
spec/config_parser.spec.js | 225 ++++++++++++++----------------
spec/metadata/android_parser.spec.js | 11 +-
src/metadata/android_parser.js | 2 +-
templates/config.xml | 2 +
4 files changed, 120 insertions(+), 120 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/9ac61951/spec/config_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec/config_parser.spec.js b/spec/config_parser.spec.js
index 018153a..544075d 100644
--- a/spec/config_parser.spec.js
+++ b/spec/config_parser.spec.js
@@ -41,145 +41,136 @@ describe('config.xml parser', function () {
expect(cfg).toBeDefined();
expect(cfg.doc).toBeDefined();
});
-
- describe('package name / id', function() {
- var cfg;
-
- beforeEach(function() {
- cfg = new config_parser(xml);
- });
-
- it('should get the (default) packagename', function() {
- expect(cfg.packageName()).toEqual('io.cordova.hellocordova');
- });
- it('should allow setting the packagename', function() {
- cfg.packageName('this.is.bat.country');
- expect(cfg.packageName()).toEqual('this.is.bat.country');
- });
- it('should write to disk after setting the packagename', function() {
- cfg.packageName('this.is.bat.country');
- expect(update).toHaveBeenCalled();
- });
- });
-
- describe('version', function() {
- var cfg;
-
- beforeEach(function() {
- cfg = new config_parser(xml);
- });
-
- it('should get the version', function() {
- expect(cfg.version()).toEqual('0.0.1');
- });
- it('should allow setting the version', function() {
- cfg.version('2.0.1');
- expect(cfg.version()).toEqual('2.0.1');
- });
- it('should write to disk after setting the version', function() {
- cfg.version('2.0.1');
- expect(update).toHaveBeenCalled();
- });
- });
-
- describe('app name', function() {
- var cfg;
-
- beforeEach(function() {
- cfg = new config_parser(xml);
- });
-
- it('should get the (default) app name', function() {
- expect(cfg.name()).toEqual('Hello Cordova');
- });
- it('should allow setting the app name', function() {
- cfg.name('this.is.bat.country');
- expect(cfg.name()).toEqual('this.is.bat.country');
- });
- it('should write to disk after setting the name', function() {
- cfg.name('one toke over the line');
- expect(update).toHaveBeenCalled();
- });
- });
-
- describe('access elements (whitelist)', function() {
+
+ describe('methods', function() {
var cfg;
-
beforeEach(function() {
cfg = new config_parser(xml);
});
- describe('getter', function() {
- it('should get the (default) access element', function() {
- expect(cfg.access.get()[0]).toEqual('*');
+ describe('package name / id', function() {
+ it('should get the (default) packagename', function() {
+ expect(cfg.packageName()).toEqual('io.cordova.hellocordova');
+ });
+ it('should allow setting the packagename', function() {
+ cfg.packageName('this.is.bat.country');
+ expect(cfg.packageName()).toEqual('this.is.bat.country');
});
- it('should return an array of all access origin uris via access()', function() {
- expect(cfg.access.get() instanceof Array).toBe(true);
+ it('should write to disk after setting the packagename', function() {
+ cfg.packageName('this.is.bat.country');
+ expect(update).toHaveBeenCalled();
});
});
- describe('setters', function() {
- it('should allow removing a uri from the access list', function() {
- cfg.access.remove('*');
- expect(cfg.access.get().length).toEqual(0);
+
+ describe('version', function() {
+ it('should get the version', function() {
+ expect(cfg.version()).toEqual('0.0.1');
});
- it('should write to disk after removing a uri', function() {
- cfg.access.remove('*');
+ it('should allow setting the version', function() {
+ cfg.version('2.0.1');
+ expect(cfg.version()).toEqual('2.0.1');
+ });
+ it('should write to disk after setting the version', function() {
+ cfg.version('2.0.1');
expect(update).toHaveBeenCalled();
});
- it('should allow adding a new uri to the access list', function() {
- cfg.access.add('http://canucks.com');
- expect(cfg.access.get().length).toEqual(2);
- expect(cfg.access.get().indexOf('http://canucks.com') > -1).toBe(true);
+ });
+
+ describe('content', function() {
+ it('should get the content src attribute', function() {
+ expect(cfg.content()).toEqual('index.html');
});
- it('should write to disk after adding a uri', function() {
- cfg.access.add('http://cordova.io');
- expect(update).toHaveBeenCalled();
+ it('should allow setting the content src attribute', function() {
+ cfg.content('main.html');
+ expect(cfg.content()).toEqual('main.html');
});
- it('should allow removing all access elements when no parameter is specified', function() {
- cfg.access.add('http://cordova.io');
- cfg.access.remove();
- expect(cfg.access.get().length).toEqual(0);
+ it('should write to disk after setting the content', function() {
+ cfg.content('batman.html');
+ expect(update).toHaveBeenCalled();
});
});
- });
- describe('preference elements', function() {
- var cfg;
-
- beforeEach(function() {
- cfg = new config_parser(xml);
+ describe('app name', function() {
+ it('should get the (default) app name', function() {
+ expect(cfg.name()).toEqual('Hello Cordova');
+ });
+ it('should allow setting the app name', function() {
+ cfg.name('this.is.bat.country');
+ expect(cfg.name()).toEqual('this.is.bat.country');
+ });
+ it('should write to disk after setting the name', function() {
+ cfg.name('one toke over the line');
+ expect(update).toHaveBeenCalled();
+ });
});
- describe('getter', function() {
- it('should get all preference elements', function() {
- expect(cfg.preference.get()[0].name).toEqual('fullscreen');
- expect(cfg.preference.get()[0].value).toEqual('true');
+ describe('access elements (whitelist)', function() {
+ describe('getter', function() {
+ it('should get the (default) access element', function() {
+ expect(cfg.access.get()[0]).toEqual('*');
+ });
+ it('should return an array of all access origin uris via access()', function() {
+ expect(cfg.access.get() instanceof Array).toBe(true);
+ });
});
- it('should return an array of all preference name/value pairs', function() {
- expect(cfg.preference.get() instanceof Array).toBe(true);
+ describe('setters', function() {
+ it('should allow removing a uri from the access list', function() {
+ cfg.access.remove('*');
+ expect(cfg.access.get().length).toEqual(0);
+ });
+ it('should write to disk after removing a uri', function() {
+ cfg.access.remove('*');
+ expect(update).toHaveBeenCalled();
+ });
+ it('should allow adding a new uri to the access list', function() {
+ cfg.access.add('http://canucks.com');
+ expect(cfg.access.get().length).toEqual(2);
+ expect(cfg.access.get().indexOf('http://canucks.com') > -1).toBe(true);
+ });
+ it('should write to disk after adding a uri', function() {
+ cfg.access.add('http://cordova.io');
+ expect(update).toHaveBeenCalled();
+ });
+ it('should allow removing all access elements when no parameter is specified', function() {
+ cfg.access.add('http://cordova.io');
+ cfg.access.remove();
+ expect(cfg.access.get().length).toEqual(0);
+ });
});
});
- describe('setters', function() {
- it('should allow removing a preference by name', function() {
- cfg.preference.remove('fullscreen');
- expect(cfg.preference.get().length).toEqual(1);
- });
- it('should write to disk after removing a preference', function() {
- cfg.preference.remove('phonegap-version');
- expect(fs.readFileSync(xml, 'utf-8')).not.toMatch(/<preference\sname="phonegap-version"/);
- });
- it('should allow adding a new preference', function() {
- cfg.preference.add({name:'UIWebViewBounce',value:'false'});
- expect(cfg.preference.get().length).toEqual(3);
- expect(cfg.preference.get()[2].value).toEqual('false');
- });
- it('should write to disk after adding a preference', function() {
- cfg.preference.add({name:'UIWebViewBounce',value:'false'});
- expect(update).toHaveBeenCalled();
+
+ describe('preference elements', function() {
+ describe('getter', function() {
+ it('should get all preference elements', function() {
+ expect(cfg.preference.get()[0].name).toEqual('fullscreen');
+ expect(cfg.preference.get()[0].value).toEqual('true');
+ });
+ it('should return an array of all preference name/value pairs', function() {
+ expect(cfg.preference.get() instanceof Array).toBe(true);
+ });
});
- it('should allow removing all preference elements when no parameter is specified', function() {
- cfg.preference.remove();
- expect(cfg.preference.get().length).toEqual(0);
+ describe('setters', function() {
+ it('should allow removing a preference by name', function() {
+ cfg.preference.remove('fullscreen');
+ expect(cfg.preference.get().length).toEqual(1);
+ });
+ it('should write to disk after removing a preference', function() {
+ cfg.preference.remove('phonegap-version');
+ expect(fs.readFileSync(xml, 'utf-8')).not.toMatch(/<preference\sname="phonegap-version"/);
+ });
+ it('should allow adding a new preference', function() {
+ cfg.preference.add({name:'UIWebViewBounce',value:'false'});
+ expect(cfg.preference.get().length).toEqual(3);
+ expect(cfg.preference.get()[2].value).toEqual('false');
+ });
+ it('should write to disk after adding a preference', function() {
+ cfg.preference.add({name:'UIWebViewBounce',value:'false'});
+ expect(update).toHaveBeenCalled();
+ });
+ it('should allow removing all preference elements when no parameter is specified', function() {
+ cfg.preference.remove();
+ expect(cfg.preference.get().length).toEqual(0);
+ });
});
});
});
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/9ac61951/spec/metadata/android_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec/metadata/android_parser.spec.js b/spec/metadata/android_parser.spec.js
index a3fcf41..228a11b 100644
--- a/spec/metadata/android_parser.spec.js
+++ b/spec/metadata/android_parser.spec.js
@@ -114,7 +114,7 @@ describe('android project parser', function() {
});
describe('update_from_config method', function() {
- var et, xml, find, write_xml, root, cfg, readdir, cfg_parser, find_obj, root_obj, cfg_access_add, cfg_access_rm, cfg_pref_add, cfg_pref_rm;
+ var et, xml, find, write_xml, root, cfg, readdir, cfg_parser, find_obj, root_obj, cfg_access_add, cfg_access_rm, cfg_pref_add, cfg_pref_rm, cfg_content;
beforeEach(function() {
find_obj = {
text:'hi'
@@ -140,11 +140,13 @@ describe('android 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' };
read.andReturn('some java package');
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 = spyOn(util, 'config_parser').andReturn({
access:{
remove:cfg_access_rm,
@@ -155,7 +157,8 @@ describe('android project parser', function() {
remove:cfg_pref_rm,
get:function(){},
add:cfg_pref_add
- }
+ },
+ content:cfg_content
});
});
@@ -197,6 +200,10 @@ describe('android project parser', function() {
expect(cfg_pref_add).toHaveBeenCalledWith({name:"useBrowserHistory",value:"true"});
expect(cfg_pref_add).toHaveBeenCalledWith({name:"exit-on-suspend",value:"false"});
});
+ it('should update the content tag', function() {
+ p.update_from_config(cfg);
+ expect(cfg_content).toHaveBeenCalledWith('index.html');
+ });
});
describe('www_dir method', function() {
it('should return assets/www', function() {
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/9ac61951/src/metadata/android_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/android_parser.js b/src/metadata/android_parser.js
index 3e9d680..722bd45 100644
--- a/src/metadata/android_parser.js
+++ b/src/metadata/android_parser.js
@@ -120,7 +120,7 @@ module.exports.prototype = {
android_cfg_xml.access.add(uri);
});
- // Update content
+ // Update content (start page)
android_cfg_xml.content(config.content());
// Update preferences
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/9ac61951/templates/config.xml
----------------------------------------------------------------------
diff --git a/templates/config.xml b/templates/config.xml
index a66b224..276aae9 100644
--- a/templates/config.xml
+++ b/templates/config.xml
@@ -13,6 +13,8 @@
Apache Cordova Team
</author>
+ <content src="index.html" />
+
<access origin="*" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="true" />
[3/7] git commit: Added tyrion to contributor list.
Posted by fi...@apache.org.
Added tyrion to contributor list.
Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/057021d6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/057021d6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/057021d6
Branch: refs/heads/master
Commit: 057021d627ca4eb95145a7ec20856857cce2f8bb
Parents: 9ac6195
Author: Fil Maj <ma...@gmail.com>
Authored: Fri Aug 9 12:36:33 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Fri Aug 9 12:36:33 2013 -0700
----------------------------------------------------------------------
package.json | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/057021d6/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 8e2d31c..ab40206 100644
--- a/package.json
+++ b/package.json
@@ -72,7 +72,8 @@
{"name": "Michal Mocny", "email": "mmocny@gmail.com"},
{"name": "Sam Breed", "email": "sam@quickleft.com"},
{"name": "Tommy-Carlos Williams", "email": "tommy@devgeeks.org"},
- {"name": "Rubén Norte", "email": "rubennorte@gmail.com"}
+ {"name": "Rubén Norte", "email": "rubennorte@gmail.com"},
+ {"name": "Germano Gabbianelli", "email": "tyrion.mx@gmail.com"}
],
"license": "Apache version 2.0"
}
[7/7] git commit: 3.0.5
Posted by fi...@apache.org.
3.0.5
Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/a2f6f4ab
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/a2f6f4ab
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/a2f6f4ab
Branch: refs/heads/master
Commit: a2f6f4ab937a40e8160d186941f63329f0ca9a37
Parents: 1554307
Author: Fil Maj <ma...@gmail.com>
Authored: Mon Aug 12 13:58:31 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Mon Aug 12 13:58:31 2013 -0700
----------------------------------------------------------------------
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/a2f6f4ab/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index ab40206..1c04980 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "cordova",
- "version": "3.0.4",
+ "version": "3.0.5",
"preferGlobal": "true",
"description": "Cordova command line interface tool",
"main": "cordova",
[6/7] git commit: [CB-3191] Support for tag in windows
phone platforms.
Posted by fi...@apache.org.
[CB-3191] Support for <content> tag in windows phone platforms.
Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/15543072
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/15543072
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/15543072
Branch: refs/heads/master
Commit: 155430725a8f020dea92bbd014b919468ba4bc05
Parents: 0dce191
Author: Fil Maj <ma...@gmail.com>
Authored: Mon Aug 12 13:55:13 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Mon Aug 12 13:55:13 2013 -0700
----------------------------------------------------------------------
spec/metadata/wp7_parser.spec.js | 16 ++++++++++++----
spec/metadata/wp8_parser.spec.js | 16 ++++++++++++----
src/metadata/wp7_parser.js | 8 +++++---
src/metadata/wp8_parser.js | 6 +++++-
4 files changed, 34 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/15543072/spec/metadata/wp7_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec/metadata/wp7_parser.spec.js b/spec/metadata/wp7_parser.spec.js
index b85eac8..c7a74df 100644
--- a/spec/metadata/wp7_parser.spec.js
+++ b/spec/metadata/wp7_parser.spec.js
@@ -29,7 +29,7 @@ var platforms = require('../../platforms'),
describe('wp7 project parser', function() {
var proj = '/some/path';
- var exists, exec, custom, readdir;
+ var exists, exec, custom, readdir, cfg_parser;
beforeEach(function() {
exists = spyOn(fs, 'existsSync').andReturn(true);
exec = spyOn(shell, 'exec').andCallFake(function(cmd, opts, cb) {
@@ -37,6 +37,7 @@ describe('wp7 project parser', function() {
});
custom = spyOn(config, 'has_custom_path').andReturn(false);
readdir = spyOn(fs, 'readdirSync').andReturn(['test.csproj']);
+ cfg_parser = spyOn(util, 'config_parser');
});
describe('constructions', function() {
@@ -99,7 +100,7 @@ describe('wp7 project parser', function() {
});
describe('update_from_config method', function() {
- var et, xml, find, write_xml, root, cfg, cfg_parser, find_obj, root_obj, cfg_access_add, cfg_access_rm, cfg_pref_add, cfg_pref_rm;
+ var et, xml, find, write_xml, root, cfg, find_obj, root_obj, cfg_access_add, cfg_access_rm, cfg_pref_add, cfg_pref_rm, cfg_content;
beforeEach(function() {
find_obj = {
text:'hi',
@@ -121,6 +122,7 @@ describe('wp7 project parser', function() {
xml = spyOn(ET, 'XML');
cfg = new config_parser();
cfg.name = function() { return 'testname' };
+ cfg.content = function() { return 'index.html' };
cfg.packageName = function() { return 'testpkg' };
cfg.version = function() { return 'one point oh' };
cfg.access.get = function() { return [] };
@@ -129,18 +131,20 @@ describe('wp7 project parser', function() {
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_parser = spyOn(util, 'config_parser').andReturn({
+ cfg_content = jasmine.createSpy('config_parser content');
+ p.config = {
access:{
remove:cfg_access_rm,
get:function(){},
add:cfg_access_add
},
+ content:cfg_content,
preference:{
remove:cfg_pref_rm,
get:function(){},
add:cfg_pref_add
}
- });
+ };
readdir.andReturn(['test.sln']);
});
@@ -156,6 +160,10 @@ describe('wp7 project parser', function() {
p.update_from_config(cfg);
expect(find_obj.attrib.Version).toEqual('one point oh');
});
+ it('should update the content element (start page)', function() {
+ p.update_from_config(cfg);
+ expect(cfg_content).toHaveBeenCalledWith('index.html');
+ });
});
describe('www_dir method', function() {
it('should return www', function() {
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/15543072/spec/metadata/wp8_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec/metadata/wp8_parser.spec.js b/spec/metadata/wp8_parser.spec.js
index ff71e87..67a1c89 100644
--- a/spec/metadata/wp8_parser.spec.js
+++ b/spec/metadata/wp8_parser.spec.js
@@ -29,7 +29,7 @@ var platforms = require('../../platforms'),
describe('wp8 project parser', function() {
var proj = '/some/path';
- var exists, exec, custom, readdir;
+ var exists, exec, custom, readdir, cfg_parser;
beforeEach(function() {
exists = spyOn(fs, 'existsSync').andReturn(true);
exec = spyOn(shell, 'exec').andCallFake(function(cmd, opts, cb) {
@@ -37,6 +37,7 @@ describe('wp8 project parser', function() {
});
custom = spyOn(config, 'has_custom_path').andReturn(false);
readdir = spyOn(fs, 'readdirSync').andReturn(['test.csproj']);
+ cfg_parser = spyOn(util, 'config_parser');
});
describe('constructions', function() {
@@ -99,7 +100,7 @@ describe('wp8 project parser', function() {
});
describe('update_from_config method', function() {
- var et, xml, find, write_xml, root, cfg, cfg_parser, find_obj, root_obj, cfg_access_add, cfg_access_rm, cfg_pref_add, cfg_pref_rm;
+ var et, xml, find, write_xml, root, cfg, find_obj, root_obj, cfg_access_add, cfg_access_rm, cfg_pref_add, cfg_pref_rm, cfg_content;
beforeEach(function() {
find_obj = {
text:'hi',
@@ -121,6 +122,7 @@ describe('wp8 project parser', function() {
xml = spyOn(ET, 'XML');
cfg = new config_parser();
cfg.name = function() { return 'testname' };
+ cfg.content = function() { return 'index.html' };
cfg.packageName = function() { return 'testpkg' };
cfg.version = function() { return 'one point oh' };
cfg.access.get = function() { return [] };
@@ -129,18 +131,20 @@ describe('wp8 project parser', function() {
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_parser = spyOn(util, 'config_parser').andReturn({
+ cfg_content = jasmine.createSpy('config_parser content');
+ p.config = {
access:{
remove:cfg_access_rm,
get:function(){},
add:cfg_access_add
},
+ content:cfg_content,
preference:{
remove:cfg_pref_rm,
get:function(){},
add:cfg_pref_add
}
- });
+ };
readdir.andReturn(['test.sln']);
});
@@ -156,6 +160,10 @@ describe('wp8 project parser', function() {
p.update_from_config(cfg);
expect(find_obj.attrib.Version).toEqual('one point oh');
});
+ it('should update the content element (start page)', function() {
+ p.update_from_config(cfg);
+ expect(cfg_content).toHaveBeenCalledWith('index.html');
+ });
});
describe('www_dir method', function() {
it('should return www', function() {
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/15543072/src/metadata/wp7_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/wp7_parser.js b/src/metadata/wp7_parser.js
index f96ed08..6c81668 100644
--- a/src/metadata/wp7_parser.js
+++ b/src/metadata/wp7_parser.js
@@ -38,6 +38,8 @@ module.exports = function wp7_parser(project) {
throw new Error('The provided path "' + project + '" is not a Windows Phone 7 project. ' + e);
}
this.manifest_path = path.join(this.wp7_proj_dir, 'Properties', 'WMAppManifest.xml');
+ this.config_path = path.join(this.wp7_proj_dir, 'config.xml');
+ this.config = new util.config_parser(this.config_path);
};
module.exports.check_requirements = function(project_root, callback) {
@@ -137,6 +139,9 @@ module.exports.prototype = {
fs.writeFileSync(path.join(this.wp7_proj_dir, 'App.xaml.cs'), appCS.replace(namespaceRegEx, 'namespace ' + pkg), 'utf-8');
}
+ // Update content (start page) element
+ this.config.content(config.content());
+
//Write out manifest
fs.writeFileSync(this.manifest_path, manifest.write({indent: 4}), 'utf-8');
},
@@ -144,9 +149,6 @@ module.exports.prototype = {
www_dir:function() {
return path.join(this.wp7_proj_dir, 'www');
},
- config_xml:function() {
- return path.join(this.wp7_proj_dir, 'config.xml');
- },
// copies the app www folder into the wp7 project's www folder and updates the csproj file.
update_www:function() {
var project_root = util.isCordova(this.wp7_proj_dir);
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/15543072/src/metadata/wp8_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/wp8_parser.js b/src/metadata/wp8_parser.js
index d41328a..00797b7 100644
--- a/src/metadata/wp8_parser.js
+++ b/src/metadata/wp8_parser.js
@@ -38,6 +38,8 @@ module.exports = function wp8_parser(project) {
throw new Error('The provided path "' + project + '" is not a Windows Phone 8 project. ' + e);
}
this.manifest_path = path.join(this.wp8_proj_dir, 'Properties', 'WMAppManifest.xml');
+ this.config_path = path.join(this.wp8_proj_dir, 'config.xml');
+ this.config = new util.config_parser(this.config_path);
};
module.exports.check_requirements = function(project_root, callback) {
@@ -138,6 +140,9 @@ module.exports.prototype = {
fs.writeFileSync(path.join(this.wp8_proj_dir, 'App.xaml.cs'), appCS.replace(namespaceRegEx, 'namespace ' + pkg), 'utf-8');
}
+ // Update content (start page) element
+ this.config.content(config.content());
+
//Write out manifest
fs.writeFileSync(this.manifest_path, manifest.write({indent: 4}), 'utf-8');
},
@@ -146,7 +151,6 @@ module.exports.prototype = {
return path.join(this.wp8_proj_dir, 'www');
},
config_xml:function() {
- return path.join(this.wp8_proj_dir, 'config.xml');
},
// copies the app www folder into the wp8 project's www folder and updates the csproj file.
update_www:function() {
[5/7] git commit: [CB-3191] Support for tag (start page
declaration) in BlackBerry10.
Posted by fi...@apache.org.
[CB-3191] Support for <content> tag (start page declaration) in BlackBerry10.
Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/0dce191f
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/0dce191f
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/0dce191f
Branch: refs/heads/master
Commit: 0dce191f739f20e3f0a067da103a2c743ae75fac
Parents: 86ef079
Author: Fil Maj <ma...@gmail.com>
Authored: Mon Aug 12 13:28:57 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Mon Aug 12 13:28:57 2013 -0700
----------------------------------------------------------------------
spec/metadata/blackberry_parser.spec.js | 9 ++++++++-
src/metadata/blackberry10_parser.js | 2 ++
2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0dce191f/spec/metadata/blackberry_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec/metadata/blackberry_parser.spec.js b/spec/metadata/blackberry_parser.spec.js
index 3ba22da..354109e 100644
--- a/spec/metadata/blackberry_parser.spec.js
+++ b/spec/metadata/blackberry_parser.spec.js
@@ -87,8 +87,9 @@ describe('blackberry10 project parser', function() {
describe('update_from_config method', function() {
var et, xml, find, write_xml, root, cfg, find_obj, root_obj;
- var xml_name, xml_pkg, xml_version, xml_access_rm, xml_update, xml_append;
+ var xml_name, xml_pkg, xml_version, xml_access_rm, xml_update, xml_append, xml_content;
beforeEach(function() {
+ xml_content = jasmine.createSpy('xml content');
xml_name = jasmine.createSpy('xml name');
xml_pkg = jasmine.createSpy('xml pkg');
xml_version = jasmine.createSpy('xml version');
@@ -99,6 +100,7 @@ describe('blackberry10 project parser', function() {
p.xml.name = xml_name;
p.xml.packageName = xml_pkg;
p.xml.version = xml_version;
+ p.xml.content = xml_content;
p.xml.access = {
remove:xml_access_rm,
add: xml_access_add
@@ -126,6 +128,7 @@ describe('blackberry10 project parser', function() {
xml = spyOn(ET, 'XML');
cfg = new config_parser();
cfg.name = function() { return 'testname'; };
+ cfg.content = function() { return 'index.html'; };
cfg.packageName = function() { return 'testpkg'; };
cfg.version = function() { return 'one point oh'; };
cfg.access.getAttributes = function() { return []; };
@@ -154,6 +157,10 @@ describe('blackberry10 project parser', function() {
expect(xml_access_add).toHaveBeenCalledWith('one', undefined);
expect(xml_access_add).toHaveBeenCalledWith('two', 'false');
});
+ it('should update the start page (content tag)', function() {
+ p.update_from_config(cfg);
+ expect(xml_content).toHaveBeenCalledWith('index.html');
+ });
});
describe('www_dir method', function() {
it('should return /www', function() {
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0dce191f/src/metadata/blackberry10_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/blackberry10_parser.js b/src/metadata/blackberry10_parser.js
index 79e303f..dbaf85b 100644
--- a/src/metadata/blackberry10_parser.js
+++ b/src/metadata/blackberry10_parser.js
@@ -61,6 +61,8 @@ module.exports.prototype = {
config.access.getAttributes().forEach(function(attribs) {
self.xml.access.add(attribs.uri || attribs.origin, attribs.subdomains);
});
+
+ this.xml.content(config.content());
},
update_project:function(cfg, callback) {
var self = this;
[4/7] git commit: [CB-3191] Updated README to reflect tag
support. Added support + specs for ios.
Posted by fi...@apache.org.
[CB-3191] Updated README to reflect <content> 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 <ma...@gmail.com>
Authored: Mon Aug 12 13:22:30 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
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 `<widget>` element.
- The whitelist can be modified using the `<access>` elements. Make sure the `origin` attribute of your `<access>` 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 `<preference>` 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 `<content src>` 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();