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 2012/11/28 19:16:24 UTC
[22/50] git commit: Fixes #57 - issue with folders with spaces in
them. Still need to wait for android to fix its debug/cordova scripts for
full fix, though.
Fixes #57 - issue with folders with spaces in them. Still need to wait for android to fix its debug/cordova scripts for full fix, though.
Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/8e7a41d3
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/8e7a41d3
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/8e7a41d3
Branch: refs/heads/master
Commit: 8e7a41d3866054e2b12a114a6687c40c503b1a28
Parents: b28f0bb
Author: Fil Maj <ma...@gmail.com>
Authored: Wed Oct 31 16:12:39 2012 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Wed Oct 31 16:12:39 2012 -0700
----------------------------------------------------------------------
spec/build.spec.js | 30 ++++++++++++++++++++++++++----
spec/helper.js | 4 ++--
src/build.js | 6 ++++--
3 files changed, 32 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/8e7a41d3/spec/build.spec.js
----------------------------------------------------------------------
diff --git a/spec/build.spec.js b/spec/build.spec.js
index 51b2e0a..7a10ef2 100644
--- a/spec/build.spec.js
+++ b/spec/build.spec.js
@@ -49,7 +49,29 @@ describe('build command', function() {
}).not.toThrow();
expect(s).toHaveBeenCalled();
});
-
+ xit('should run inside a directory with a space', function() {
+ var spaceDir = path.join(__dirname, '..', 'foo proj');
+ var cb = jasmine.createSpy();
+ var buildcb = jasmine.createSpy();
+ this.after(function() {
+ process.chdir(cwd);
+ shell.rm('-rf', spaceDir);
+ });
+
+ runs(function() {
+ cordova.create(spaceDir);
+ process.chdir(spaceDir);
+ cordova.platform('add', 'ios', cb);
+ });
+ waitsFor(function() { return cb.wasCalled; }, 'ios create');
+
+ runs(function() {
+ expect(function() {
+ cordova.build(buildcb);
+ }).not.toThrow();
+ });
+ waitsFor(function() { return buildcb.wasCalled; }, 'ios build');
+ });
it('should not run outside of a Cordova-based project', function() {
this.after(function() {
process.chdir(cwd);
@@ -80,7 +102,7 @@ describe('build command', function() {
it('should shell out to debug command on Android', function() {
var s = spyOn(require('shelljs'), 'exec').andReturn({code:0});
cordova.build();
- expect(s.mostRecentCall.args[0].match(/android\/cordova\/debug > \/dev\/null$/)).not.toBeNull();
+ expect(s.mostRecentCall.args[0].match(/\/cordova\/debug/)).not.toBeNull();
});
it('should call android_parser\'s update_project', function() {
spyOn(require('shelljs'), 'exec').andReturn({code:0});
@@ -106,7 +128,7 @@ describe('build command', function() {
waitsFor(function() { return buildcb.wasCalled; }, 'ios build');
runs(function() {
expect(s).toHaveBeenCalled();
- expect(s.mostRecentCall.args[0].match(/ios\/cordova\/debug > \/dev\/null$/)).not.toBeNull();
+ expect(s.mostRecentCall.args[0].match(/\/cordova\/debug/)).not.toBeNull();
});
});
it('should call ios_parser\'s update_project', function() {
@@ -143,7 +165,7 @@ describe('build command', function() {
waitsFor(function() { return buildcb.wasCalled; }, 'build call', 20000);
runs(function() {
expect(s).toHaveBeenCalled();
- expect(s.mostRecentCall.args[0].match(/ant -f .*build\.xml qnx load-device/)).not.toBeNull();
+ expect(s.mostRecentCall.args[0]).toMatch(/ant -f .*build\.xml" qnx load-device/);
});
});
it('should call blackberry_parser\'s update_project', function() {
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/8e7a41d3/spec/helper.js
----------------------------------------------------------------------
diff --git a/spec/helper.js b/spec/helper.js
index 654f7a9..95afaf3 100644
--- a/spec/helper.js
+++ b/spec/helper.js
@@ -15,13 +15,13 @@ module.exports = {
require('shelljs').exec = function(cmd, opts) {
// Match various commands to exec
if (cmd.match(/android.bin.create/)) {
- var r = new RegExp(/android.bin.create"\s"([\/\\\w-_\.]*)"/);
+ var r = new RegExp(/android.bin.create"\s"([\/\\\w-_\.\s]*)"/);
var dir = r.exec(cmd)[1];
shell.cp('-r', android_project, path.join(dir, '..'));
fs.chmodSync(path.join(dir, 'cordova', 'debug'), '754');
return {code:0};
} else if (cmd.match(/blackberry.bin.create/)) {
- var r = new RegExp(/blackberry.bin.create"\s"([\/\\\w-_\.]*)"/);
+ var r = new RegExp(/blackberry.bin.create"\s"([\/\\\w-_\.\s]*)"/);
var dir = r.exec(cmd)[1];
var platformsDir = path.join(dir, '..');
shell.cp('-r', bb_project, platformsDir);
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/8e7a41d3/src/build.js
----------------------------------------------------------------------
diff --git a/src/build.js b/src/build.js
index a977702..b1ee684 100644
--- a/src/build.js
+++ b/src/build.js
@@ -15,11 +15,13 @@ var cordova_util = require('./util'),
util = require('util');
function shell_out_to_debug(projectRoot, platform) {
- var cmd = path.join(projectRoot, 'platforms', platform, 'cordova', 'debug > /dev/null');
+ var cmd = path.join(projectRoot, 'platforms', platform);
// TODO: wait for https://issues.apache.org/jira/browse/CB-1548 to be fixed before we axe this
// TODO: this is bb10 only for now
if (platform.indexOf('blackberry') > -1) {
- cmd = 'ant -f ' + path.join(projectRoot, 'platforms', platform, 'build.xml') + ' qnx load-device';
+ cmd = 'ant -f "' + path.join(cmd, 'build.xml') + '" qnx load-device';
+ } else {
+ cmd = '"' + cmd + '/cordova/debug"';
}
var response = shell.exec(cmd, {silent:true});
if (response.code > 0) throw 'An error occurred while building the ' + platform + ' project. ' + response.output;