cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [3/3] git commit: [CB-4270] [BlackBerry10] Remove custom emulate logic (moving to cordova-blackberry)
Date Tue, 16 Jul 2013 22:16:26 GMT
[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/95ef9bb4
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/95ef9bb4
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/95ef9bb4

Branch: refs/heads/master
Commit: 95ef9bb4af9df93599ed5e029d8c618d325c50a1
Parents: f2d699d
Author: Bryan Higgins <bhiggins@blackberry.com>
Authored: Tue Jul 16 11:07:18 2013 -0400
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Tue Jul 16 14:49:16 2013 -0700

----------------------------------------------------------------------
 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/95ef9bb4/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/95ef9bb4/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);


Mime
View raw message