Closes #21. Support modifying package identifier via config.xml
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/commit/478b3a42 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/tree/478b3a42 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/diff/478b3a42 Branch: refs/heads/cordova-client Commit: 478b3a421e372dd847638d19bdd5a088f3651230 Parents: 501c2d8 Author: Fil Maj <maj....@gmail.com> Authored: Wed Oct 10 15:14:17 2012 -0700 Committer: Fil Maj <maj....@gmail.com> Committed: Wed Oct 10 15:14:17 2012 -0700 ---------------------------------------------------------------------- README.md | 1 + spec/metadata/blackberry_parser.spec.js | 10 +++++++++- src/metadata/blackberry_parser.js | 1 + 3 files changed, 11 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/478b3a42/README.md ---------------------------------------------------------------------- diff --git a/README.md b/README.md index f64edaa..43a1b07 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ Contains the project's web artifacts, such as .html, .css and .js files. These a This file is what you should be editing to modify your application's metadata. Any time you run any cordova-client commands, the tool will look at the contents of `config.xml` and use all relevant info from this file to define native application information. cordova-client supports changing your application's data via the following elements inside the `config.xml` file: - The user-facing name can be modified via the contents of the `<name>` element. +- The package name (AKA bundle identifier or application id) can be modified via the `id` attribute from the top-level `<widget>` element. # Hooks http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/478b3a42/spec/metadata/blackberry_parser.spec.js ---------------------------------------------------------------------- diff --git a/spec/metadata/blackberry_parser.spec.js b/spec/metadata/blackberry_parser.spec.js index 9f2c4b4..e7ffeed 100644 --- a/spec/metadata/blackberry_parser.spec.js +++ b/spec/metadata/blackberry_parser.spec.js @@ -13,6 +13,7 @@ var blackberry_parser = require('../../src/metadata/blackberry_parser'), var cwd = process.cwd(); var original_config = fs.readFileSync(blackberry_config, 'utf-8'); +var orig_www_config = fs.readFileSync(cfg_path, 'utf-8'); describe('blackberry project parser', function() { it('should throw an exception with a path that is not a native blackberry project', function() { @@ -37,6 +38,7 @@ describe('blackberry project parser', function() { }); afterEach(function() { fs.writeFileSync(blackberry_config, original_config, 'utf-8'); + fs.writeFileSync(cfg_path, orig_www_config, 'utf-8'); }); it('should throw an exception if a non config_parser object is passed into it', function() { expect(function() { @@ -51,7 +53,13 @@ describe('blackberry project parser', function() { expect(bb_cfg.name()).toBe('bond. james bond.'); }); - it('should update the application package name properly'); + it('should update the application package name properly', function() { + config.packageName('sofa.king.awesome'); + project.update_from_config(config); + + var bb_cfg = new config_parser(blackberry_config); + expect(bb_cfg.packageName()).toBe('sofa.king.awesome'); + }); }); describe('update_www method', function() { http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/478b3a42/src/metadata/blackberry_parser.js ---------------------------------------------------------------------- diff --git a/src/metadata/blackberry_parser.js b/src/metadata/blackberry_parser.js index 6728c05..d6cf21f 100644 --- a/src/metadata/blackberry_parser.js +++ b/src/metadata/blackberry_parser.js @@ -20,6 +20,7 @@ module.exports.prototype = { } else throw 'update_from_config requires a config_parser object'; this.xml.name(config.name()); + this.xml.packageName(config.packageName()); }, update_project:function(cfg, callback) { this.update_from_config(cfg);