.cordova file now a basic manifest
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/0f921284 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/tree/0f921284 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/diff/0f921284 Branch: refs/heads/cordova-client Commit: 0f9212847e2b3f8eb767a31db1ac1a0d25178bcd Parents: 88bc1da Author: Fil Maj <maj....@gmail.com> Authored: Tue Sep 18 12:52:46 2012 -0700 Committer: Fil Maj <maj....@gmail.com> Committed: Tue Sep 18 12:52:46 2012 -0700 ---------------------------------------------------------------------- spec/create.spec.js | 4 +++- spec/plugin.spec.js | 5 +++++ src/create.js | 6 +++++- 3 files changed, 13 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/0f921284/spec/create.spec.js ---------------------------------------------------------------------- diff --git a/spec/create.spec.js b/spec/create.spec.js index a820274..aadd14b 100644 --- a/spec/create.spec.js +++ b/spec/create.spec.js @@ -23,7 +23,9 @@ describe('create command', function () { }); it('should create a cordova project in the specified directory if parameter is provided', function() { cordova.create(tempDir); - expect(fs.lstatSync(path.join(tempDir, '.cordova')).isFile()).toBe(true); + var dotc = path.join(tempDir, '.cordova'); + expect(fs.lstatSync(dotc).isFile()).toBe(true); + expect(JSON.parse(fs.readFileSync(dotc, 'utf8')).name).toBe("Hello Cordova"); }); it('should throw if the directory is already a cordova project', function() { mkdirp(path.join(tempDir, '.cordova')); http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/0f921284/spec/plugin.spec.js ---------------------------------------------------------------------- diff --git a/spec/plugin.spec.js b/spec/plugin.spec.js index b0fd6dc..b53cf89 100644 --- a/spec/plugin.spec.js +++ b/spec/plugin.spec.js @@ -147,6 +147,11 @@ describe('plugin command', function() { expect(fs.existsSync(path.join(tempDir, 'plugins', 'test'))).toBe(true); }); }); + describe('on Android', function() { + it('should properly change any imports of ".R" to match the app\'s package name', function() { + + }); + }); }); }); http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/0f921284/src/create.js ---------------------------------------------------------------------- diff --git a/src/create.js b/src/create.js index d2a7892..36d69dd 100644 --- a/src/create.js +++ b/src/create.js @@ -44,7 +44,11 @@ module.exports = function create (dir, id, name) { mkdirp(path.join(dir, 'plugins')); mkdirp(path.join(dir, 'www')); - fs.writeFileSync(dotCordova, 'do or do not. there is no try.'); + // Write out .cordova file with a simple json manifest + fs.writeFileSync(dotCordova, JSON.stringify({ + id:id, + name:name + })); // Copy in base template cpr(path.join(__dirname, '..', 'templates', 'www'), path.join(dir, 'www'));