You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bh...@apache.org on 2013/07/16 17:07:25 UTC
git commit: [CB-4270] [BlackBerry10] Remove custom emulate logic
(moving to cordova-blackberry)
Updated Branches:
refs/heads/master 686586fdc -> 2782d5ece
[CB-4270] [BlackBerry10] Remove custom emulate logic (moving to cordova-blackberry)
Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/2782d5ec
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/2782d5ec
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/2782d5ec
Branch: refs/heads/master
Commit: 2782d5ece23c1536239f4c9944179926709298b2
Parents: 686586f
Author: Bryan Higgins <bh...@blackberry.com>
Authored: Tue Jul 16 11:07:18 2013 -0400
Committer: Bryan Higgins <bh...@blackberry.com>
Committed: Tue Jul 16 11:07:18 2013 -0400
----------------------------------------------------------------------
spec/emulate.spec.js | 21 ---------------------
src/emulate.js | 14 --------------
2 files changed, 35 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/2782d5ec/spec/emulate.spec.js
----------------------------------------------------------------------
diff --git a/spec/emulate.spec.js b/spec/emulate.spec.js
index d9f505f..03151e3 100644
--- a/spec/emulate.spec.js
+++ b/spec/emulate.spec.js
@@ -54,15 +54,6 @@ describe('emulate command', function() {
cordova.emulate();
}).toThrow('Current working directory is not a Cordova-based project.');
});
- it('should throw if no BlackBerry simulator targets exist and blackberry is to be emulated', function() {
- var bb_project = path.join(project_dir, 'platforms', 'blackberry');
- spyOn(platforms.blackberry, 'parser').andReturn({
- has_simulator_target:function() { return false; }
- });
- expect(function() {
- cordova.emulate('blackberry');
- }).toThrow('No BlackBerry simulator targets defined. If you want to run emulate with BB10, please add a simulator target. For more information run "' + path.join(bb_project, 'cordova', 'target') + '" -h');
- });
});
describe('success', function() {
@@ -74,18 +65,6 @@ describe('emulate command', function() {
done();
});
});
- it('should execute a different BlackBerry-specific command to emulate blackberry', function() {
- var bb_project = path.join(project_dir, 'platforms', 'blackberry');
- spyOn(platforms.blackberry, 'parser').andReturn({
- has_simulator_target:function() { return true; },
- get_simulator_targets:function() { return [{name:'fifi'}]; },
- get_cordova_config:function() { return {signing_password:'secret'}; }
- });
- expect(function() {
- cordova.emulate('blackberry');
- expect(exec.mostRecentCall.args[0]).toMatch(/blackberry.cordova.run" --target=fifi -k secret/gi);
- }).not.toThrow();
- });
});
describe('hooks', function() {
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/2782d5ec/src/emulate.js
----------------------------------------------------------------------
diff --git a/src/emulate.js b/src/emulate.js
index d41d01c..b9cbe70 100644
--- a/src/emulate.js
+++ b/src/emulate.js
@@ -29,20 +29,6 @@ var cordova_util = require('./util'),
function shell_out_to_emulate(root, platform, error_callback, done) {
var cmd = '"' + path.join(root, 'platforms', platform, 'cordova', 'run') + '" --emulator';
- // TODO: inconsistent API for BB10 run command
- if (platform == 'blackberry') {
- var bb_project = path.join(root, 'platforms', 'blackberry')
- var project = new platforms.blackberry.parser(bb_project);
- if (project.has_simulator_target()) {
- var bb_config = project.get_cordova_config();
- var sim = project.get_simulator_targets()[0].name;
- cmd = '"' + path.join(bb_project, 'cordova', 'run') + '" --target=' + sim + ' -k ' + bb_config.signing_password;
- } else {
- var err = new Error('No BlackBerry simulator targets defined. If you want to run emulate with BB10, please add a simulator target. For more information run "' + path.join(bb_project, 'cordova', 'target') + '" -h');
- if (error_callback) return error_callback(err);
- else throw err;
- }
- }
events.emit('log', 'Running on emulator for platform "' + platform + '" via command "' + cmd + '" (output to follow)...');
shell.exec(cmd, {silent:true, async:true}, function(code, output) {
events.emit('log', output);
Re: git commit: [CB-4270] [BlackBerry10] Remove custom emulate
logic (moving to cordova-blackberry)
Posted by Filip Maj <fi...@adobe.com>.
Yay !
On 7/16/13 8:07 AM, "bhiggins@apache.org" <bh...@apache.org> wrote:
>Updated Branches:
> refs/heads/master 686586fdc -> 2782d5ece
>
>
>[CB-4270] [BlackBerry10] Remove custom emulate logic (moving to
>cordova-blackberry)
>
>
>Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
>Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/2782d5ec
>Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/2782d5ec
>Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/2782d5ec
>
>Branch: refs/heads/master
>Commit: 2782d5ece23c1536239f4c9944179926709298b2
>Parents: 686586f
>Author: Bryan Higgins <bh...@blackberry.com>
>Authored: Tue Jul 16 11:07:18 2013 -0400
>Committer: Bryan Higgins <bh...@blackberry.com>
>Committed: Tue Jul 16 11:07:18 2013 -0400
>
>----------------------------------------------------------------------
> spec/emulate.spec.js | 21 ---------------------
> src/emulate.js | 14 --------------
> 2 files changed, 35 deletions(-)
>----------------------------------------------------------------------
>
>
>http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/2782d5ec/spec/emul
>ate.spec.js
>----------------------------------------------------------------------
>diff --git a/spec/emulate.spec.js b/spec/emulate.spec.js
>index d9f505f..03151e3 100644
>--- a/spec/emulate.spec.js
>+++ b/spec/emulate.spec.js
>@@ -54,15 +54,6 @@ describe('emulate command', function() {
> cordova.emulate();
> }).toThrow('Current working directory is not a Cordova-based
>project.');
> });
>- it('should throw if no BlackBerry simulator targets exist and
>blackberry is to be emulated', function() {
>- var bb_project = path.join(project_dir, 'platforms',
>'blackberry');
>- spyOn(platforms.blackberry, 'parser').andReturn({
>- has_simulator_target:function() { return false; }
>- });
>- expect(function() {
>- cordova.emulate('blackberry');
>- }).toThrow('No BlackBerry simulator targets defined. If you
>want to run emulate with BB10, please add a simulator target. For more
>information run "' + path.join(bb_project, 'cordova', 'target') + '" -h');
>- });
> });
>
> describe('success', function() {
>@@ -74,18 +65,6 @@ describe('emulate command', function() {
> done();
> });
> });
>- it('should execute a different BlackBerry-specific command to
>emulate blackberry', function() {
>- var bb_project = path.join(project_dir, 'platforms',
>'blackberry');
>- spyOn(platforms.blackberry, 'parser').andReturn({
>- has_simulator_target:function() { return true; },
>- get_simulator_targets:function() { return
>[{name:'fifi'}]; },
>- get_cordova_config:function() { return
>{signing_password:'secret'}; }
>- });
>- expect(function() {
>- cordova.emulate('blackberry');
>-
>expect(exec.mostRecentCall.args[0]).toMatch(/blackberry.cordova.run"
>--target=fifi -k secret/gi);
>- }).not.toThrow();
>- });
> });
>
> describe('hooks', function() {
>
>http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/2782d5ec/src/emula
>te.js
>----------------------------------------------------------------------
>diff --git a/src/emulate.js b/src/emulate.js
>index d41d01c..b9cbe70 100644
>--- a/src/emulate.js
>+++ b/src/emulate.js
>@@ -29,20 +29,6 @@ var cordova_util = require('./util'),
>
> function shell_out_to_emulate(root, platform, error_callback, done) {
> var cmd = '"' + path.join(root, 'platforms', platform, 'cordova',
>'run') + '" --emulator';
>- // TODO: inconsistent API for BB10 run command
>- if (platform == 'blackberry') {
>- var bb_project = path.join(root, 'platforms', 'blackberry')
>- var project = new platforms.blackberry.parser(bb_project);
>- if (project.has_simulator_target()) {
>- var bb_config = project.get_cordova_config();
>- var sim = project.get_simulator_targets()[0].name;
>- cmd = '"' + path.join(bb_project, 'cordova', 'run') + '"
>--target=' + sim + ' -k ' + bb_config.signing_password;
>- } else {
>- var err = new Error('No BlackBerry simulator targets
>defined. If you want to run emulate with BB10, please add a simulator
>target. For more information run "' + path.join(bb_project, 'cordova',
>'target') + '" -h');
>- if (error_callback) return error_callback(err);
>- else throw err;
>- }
>- }
> events.emit('log', 'Running on emulator for platform "' + platform +
>'" via command "' + cmd + '" (output to follow)...');
> shell.exec(cmd, {silent:true, async:true}, function(code, output) {
> events.emit('log', output);
>