Keep `raw` object around, alias to module directly, but drop in a deprecation 
warning if it is used. Update all code and specs to stop using the `raw` object.


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/ca7a068e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/ca7a068e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/ca7a068e

Branch: refs/heads/no-lazy-load
Commit: ca7a068ef92b11a50fdf1fe44eb9df5adeb37bee
Parents: 465079e
Author: filmaj <maj....@gmail.com>
Authored: Fri Jun 9 14:04:17 2017 -0500
Committer: filmaj <maj....@gmail.com>
Committed: Fri Jun 9 14:04:17 2017 -0500

----------------------------------------------------------------------
 integration-tests/fetch.spec.js            |  42 +++++-----
 integration-tests/pkgJson-restore.spec.js  | 102 ++++++++++++------------
 integration-tests/pkgJson.spec.js          |  74 ++++++++---------
 spec-cordova/HooksRunner.spec.js           |   8 +-
 spec-cordova/build.spec.js                 |  22 ++---
 spec-cordova/compile.spec.js               |  18 ++---
 spec-cordova/create.spec.js                |   8 +-
 spec-cordova/emulate.spec.js               |  28 +++----
 spec-cordova/platform.spec.ios.js          |  14 ++--
 spec-cordova/platform.spec.js              |  60 +++++++-------
 spec-cordova/platform1.spec.js             |   2 +-
 spec-cordova/plugin.spec.js                |  22 ++---
 spec-cordova/project-metadata-apis.spec.js |   4 +-
 spec-cordova/run.spec.js                   |  28 +++----
 spec-cordova/save.spec.js                  |  50 ++++++------
 spec-cordova/serve.spec.js                 |   4 +-
 spec-cordova/util.spec.js                  |   4 +-
 spec-plugman/install.spec.js               |   2 +-
 src/cordova/build.js                       |   4 +-
 src/cordova/cordova.js                     |  57 +++++++------
 src/cordova/emulate.js                     |   2 +-
 src/cordova/platform.js                    |   6 +-
 src/cordova/plugin.js                      |   8 +-
 src/cordova/restore-util.js                |   2 +-
 src/cordova/run.js                         |   2 +-
 src/cordova/serve.js                       |   2 +-
 src/cordova/util.js                        |  29 +------
 src/plugman/install.js                     |   2 +-
 src/plugman/plugman.js                     |  63 ++++++---------
 src/util/alias.js                          |  27 +++++++
 30 files changed, 345 insertions(+), 351 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/ca7a068e/integration-tests/fetch.spec.js
----------------------------------------------------------------------
diff --git a/integration-tests/fetch.spec.js b/integration-tests/fetch.spec.js
index 28278ae..78e3b9b 100644
--- a/integration-tests/fetch.spec.js
+++ b/integration-tests/fetch.spec.js
@@ -49,15 +49,15 @@ describe('end-to-end plugin dependency tests', function() {
     });
 
     it('Test 029 : should fail if dependency already installed is wrong 
version', function(done) {
-        cordova.raw.create('hello3')
+        cordova.create('hello3')
         .then(function() {
             process.chdir(project);
-            return cordova.raw.platform('add', 'android', {'fetch': true});
+            return cordova.platform('add', 'android', {'fetch': true});
         }).then(function() {
-            return cordova.raw.plugin('add', 'cordova-plugin-file', {'fetch': 
true});
+            return cordova.plugin('add', 'cordova-plugin-file', {'fetch': 
true});
         }).then(function() {
             expect(path.join(pluginsDir, 'cordova-plugin-file')).toExist();
-            return cordova.raw.plugin('add', plugins['Test1'], {'fetch': 
true});
+            return cordova.plugin('add', plugins['Test1'], {'fetch': true});
         }).fail(function(err) {
             expect(err.message).toContain('does not satisfy dependency plugin 
requirement');
         })
@@ -65,17 +65,17 @@ describe('end-to-end plugin dependency tests', function() {
     }, TIMEOUT);
 
     it('Test 030 : should pass if dependency already installed is wrong 
version with --force', function(done) {
-        cordova.raw.create('hello3')
+        cordova.create('hello3')
         .then(function() {
             process.chdir(project);
-            return cordova.raw.platform('add', 'android', {'fetch': true});
+            return cordova.platform('add', 'android', {'fetch': true});
         })
         .then(function() {
-            return cordova.raw.plugin('add', 'cordova-plugin-file', {'fetch': 
true});
+            return cordova.plugin('add', 'cordova-plugin-file', {'fetch': 
true});
         })
         .then(function() {
             expect(path.join(pluginsDir, 'cordova-plugin-file')).toExist();
-            return cordova.raw.plugin('add', plugins['Test1'], {'fetch': true, 
'force':true});
+            return cordova.plugin('add', plugins['Test1'], {'fetch': true, 
'force':true});
         })
         .then(function() {
             expect(path.join(pluginsDir, 'Test1')).toExist();
@@ -89,17 +89,17 @@ describe('end-to-end plugin dependency tests', function() {
 
     it('Test 031 : should pass if dependency already installed is same major 
version (if specific version is specified)', function(done) {
         //Test1 requires cordova-plugin-file version 2.0.0 (which should 
automatically turn into ^2.0.0); we'll install version 2.1.0
-        cordova.raw.create('hello3')
+        cordova.create('hello3')
         .then(function() {
             process.chdir(project);
-            return cordova.raw.platform('add', 'android', {'fetch': true});
+            return cordova.platform('add', 'android', {'fetch': true});
         })
         .then(function() {
-            return cordova.raw.plugin('add', 'cordova-plugin-file@2.1.0', 
{'fetch': true});
+            return cordova.plugin('add', 'cordova-plugin-file@2.1.0', 
{'fetch': true});
         })
         .then(function() {
             expect(path.join(pluginsDir, 'cordova-plugin-file')).toExist();
-            return cordova.raw.plugin('add', plugins['Test1'], {'fetch': 
true});
+            return cordova.plugin('add', plugins['Test1'], {'fetch': true});
         })
         .then(function() {
             expect(path.join(pluginsDir, 'Test1')).toExist();
@@ -114,21 +114,21 @@ describe('end-to-end plugin dependency tests', function() 
{
     it('Test 032 : should handle two plugins with same dependent plugin', 
function(done) {
         //Test1 and Test2 have compatible dependencies on cordova-plugin-file
         //Test1 and Test3 have incompatible dependencies on cordova-plugin-file
-        cordova.raw.create('hello3')
+        cordova.create('hello3')
         .then(function() {
             process.chdir(project);
-            return cordova.raw.platform('add', 'android', {'fetch': true});
+            return cordova.platform('add', 'android', {'fetch': true});
         })
         .then(function() {
-            return cordova.raw.plugin('add', plugins['Test1'], {'fetch': 
true});
+            return cordova.plugin('add', plugins['Test1'], {'fetch': true});
         })
         .then(function() {
             expect(path.join(pluginsDir, 'cordova-plugin-file')).toExist();
             expect(path.join(pluginsDir, 'Test1')).toExist();
-            return cordova.raw.plugin('add', plugins['Test2'], {'fetch': 
true});
+            return cordova.plugin('add', plugins['Test2'], {'fetch': true});
         })
         .then(function() {
-            return cordova.raw.plugin('add', plugins['Test3'], {'fetch': 
true});
+            return cordova.plugin('add', plugins['Test3'], {'fetch': true});
         })
         .fail(function(err) {
             expect(path.join(pluginsDir, 'Test2')).toExist();
@@ -141,16 +141,16 @@ describe('end-to-end plugin dependency tests', function() 
{
     it('Test 033 : should use a dev version of a dependent plugin if it is 
already installed', function(done) {
         //Test4 has this dependency in its plugin.xml:
         //<dependency id="cordova-plugin-file" 
url="https://github.com/apache/cordova-plugin-file"; />
-        cordova.raw.create('hello3')
+        cordova.create('hello3')
         .then(function() {
             process.chdir(project);
-            return cordova.raw.platform('add', 'android', {'fetch': true});
+            return cordova.platform('add', 'android', {'fetch': true});
         })
         .then(function() {
-            return cordova.raw.plugin('add', 
'https://github.com/apache/cordova-plugin-file');
+            return cordova.plugin('add', 
'https://github.com/apache/cordova-plugin-file');
         })
         .then(function() {
-            return cordova.raw.plugin('add', plugins['Test4'], {'fetch': 
true});
+            return cordova.plugin('add', plugins['Test4'], {'fetch': true});
         })
         .then(function() {
             expect(path.join(pluginsDir, 'cordova-plugin-file')).toExist();

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/ca7a068e/integration-tests/pkgJson-restore.spec.js
----------------------------------------------------------------------
diff --git a/integration-tests/pkgJson-restore.spec.js 
b/integration-tests/pkgJson-restore.spec.js
index 4fb2f61..01402e9 100644
--- a/integration-tests/pkgJson-restore.spec.js
+++ b/integration-tests/pkgJson-restore.spec.js
@@ -55,7 +55,7 @@ describe('tests platform/spec restore with --save', function 
() {
 
     // Factoring out some repeated checks.
     function emptyPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             expect(installed[1].indexOf(helpers.testPlatform)).toBe(-1);
@@ -79,7 +79,7 @@ describe('tests platform/spec restore with --save', function 
() {
 
         emptyPlatformList().then(function() {
             // Add platform with save, fetch
-            return cordova.raw.platform('add', androidPlatform, {'save':true , 
'fetch':true});
+            return cordova.platform('add', androidPlatform, {'save':true , 
'fetch':true});
         }).then(function() {
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
             // Added platform properly to pkg.json
@@ -104,7 +104,7 @@ describe('tests platform/spec restore with --save', 
function () {
             expect(firstCharConfig === '~');
         }).then(function() {
             // Run cordova prepare
-            return cordova.raw.prepare();
+            return cordova.prepare();
         }).then(function() {
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
             // No changes to pkg.json spec for android.
@@ -149,7 +149,7 @@ describe('tests platform/spec restore with --save', 
function () {
 
         emptyPlatformList().then(function() {
             // Add platform with save and fetch
-            return cordova.raw.platform('add', 
'https://github.com/apache/cordova-browser', {'save':true, 'fetch':true});
+            return cordova.platform('add', 
'https://github.com/apache/cordova-browser', {'save':true, 'fetch':true});
         }).then(function() {
             // Check that platform was added to config.xml successfully.
             var cfg = new ConfigParser(configXmlPath);
@@ -171,7 +171,7 @@ describe('tests platform/spec restore with --save', 
function () {
             expect(platformsJson[bPlatform]).toBeDefined();
         }).then(function() {
             // Remove platform without --save.
-            return cordova.raw.platform('rm', bPlatform, {'fetch':true});
+            return cordova.platform('rm', bPlatform, {'fetch':true});
         }).then(function() {
             // Platform in pkg.json should still be there.
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -182,7 +182,7 @@ describe('tests platform/spec restore with --save', 
function () {
             expect(platformsJson[bPlatform]).toBeUndefined();
         }).then(function() {
             // Run cordova prepare
-            return cordova.raw.prepare({'fetch':true});
+            return cordova.prepare({'fetch':true});
         }).then(function() {
             // Check config.xml for spec modification.
             var cfg3 = new ConfigParser(configXmlPath);
@@ -224,7 +224,7 @@ describe('tests platform/spec restore with --save', 
function () {
 
         emptyPlatformList().then(function() {
             // Add plugin with save and fetch.
-            return cordova.raw.plugin('add', 
['https://github.com/apache/cordova-plugin-splashscreen'], {'save':true, 
'fetch':true});
+            return cordova.plugin('add', 
['https://github.com/apache/cordova-plugin-splashscreen'], {'save':true, 
'fetch':true});
         }).then(function() {
             // Plugin id and spec were added to config.xml successfully.
             var cfg = new ConfigParser(configXmlPath);
@@ -240,7 +240,7 @@ describe('tests platform/spec restore with --save', 
function () {
             expect(path.join(pluginsFolderPath, 
'cordova-plugin-splashscreen')).toExist();
         }).then(function() {
             // Remove plugin without --save.
-            return cordova.raw.plugin('rm', 'cordova-plugin-splashscreen', 
{'fetch':true});
+            return cordova.plugin('rm', 'cordova-plugin-splashscreen', 
{'fetch':true});
         }).then(function() {
             // Plugin id and spec are still in config.xml.
             var cfg2 = new ConfigParser(configXmlPath);
@@ -256,10 +256,10 @@ describe('tests platform/spec restore with --save', 
function () {
             expect(path.join(pluginsFolderPath, 
'cordova-plugin-splashscreen')).not.toExist();
         }).then(function() {
             // Add platform (so that prepare can run).
-            return cordova.raw.platform('add', 'browser', {'save':true});
+            return cordova.platform('add', 'browser', {'save':true});
         }).then(function() {
             // Run cordova prepare with fetch.
-            return cordova.raw.prepare({'fetch':true});
+            return cordova.prepare({'fetch':true});
         }).then(function() {
             // Config.xml spec is modified.
             var cfg3 = new ConfigParser(configXmlPath);
@@ -304,7 +304,7 @@ describe('tests platform/spec restore with --save', 
function () {
 
     // Factoring out some repeated checks.
     function emptyPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             expect(installed[1].indexOf(helpers.testPlatform)).toBe(-1);
@@ -312,7 +312,7 @@ describe('tests platform/spec restore with --save', 
function () {
     }
 
     function fullPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             
expect(installed[1].indexOf(helpers.testPlatform)).toBeGreaterThan(-1);
@@ -333,10 +333,10 @@ describe('tests platform/spec restore with --save', 
function () {
 
         emptyPlatformList().then(function() {
             // Add 'browser' platform to project without --save
-            return cordova.raw.platform('add', secondPlatformAdded);
+            return cordova.platform('add', secondPlatformAdded);
         }).then(function() {
             // Add helpers.testPlatform to project with --save
-            return cordova.raw.platform('add', [helpers.testPlatform], 
{'save':true});
+            return cordova.platform('add', [helpers.testPlatform], 
{'save':true});
         }).then(function() {
             // Delete any previous caches of require(package.json) and 
(platformsJson)
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -351,10 +351,10 @@ describe('tests platform/spec restore with --save', 
function () {
         }).then(fullPlatformList) // Platforms should still be in platform ls.
         .then(function() {
             // Remove helpers.testPlatform without --save.
-            return cordova.raw.platform('rm', [helpers.testPlatform]);
+            return cordova.platform('rm', [helpers.testPlatform]);
         }).then(function() {
             // Remove secondPlatformAdded without --save.
-            return cordova.raw.platform('rm', secondPlatformAdded);
+            return cordova.platform('rm', secondPlatformAdded);
         }).then(function() {
             // Delete any previous caches of require(pkgJson) and 
(platformsJson)
             platformsJson = cordova_util.requireNoCache(platformsFolderPath);
@@ -366,7 +366,7 @@ describe('tests platform/spec restore with --save', 
function () {
             expect(platformsJson[helpers.testPlatform]).toBeUndefined();
         }).then(function() {
             // Run cordova prepare
-            return cordova.raw.prepare();
+            return cordova.prepare();
         }).then(function() {
             // Delete any previous caches of platformsJson
             platformsJson = cordova_util.requireNoCache(platformsFolderPath);
@@ -406,7 +406,7 @@ describe('files should not be modified if their platforms 
are identical', functi
 
     // Factoring out some repeated checks.
     function emptyPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             expect(installed[1].indexOf(helpers.testPlatform)).toBe(-1);
@@ -430,7 +430,7 @@ describe('files should not be modified if their platforms 
are identical', functi
         // Pkg.json and config.xml contain only android at this point 
(basePkgJson6).
         emptyPlatformList().then(function() {
             // Run cordova prepare.
-            return cordova.raw.prepare();
+            return cordova.prepare();
         }).then(function() {
             var cfg2 = new ConfigParser(configXmlPath);
             engines = cfg2.getEngines();
@@ -476,7 +476,7 @@ describe('update pkg.json to include platforms in 
config.xml', function () {
 
     // Factoring out some repeated checks.
     function emptyPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             expect(installed[1].indexOf(helpers.testPlatform)).toBe(-1);
@@ -513,7 +513,7 @@ describe('update pkg.json to include platforms in 
config.xml', function () {
         expect(pkgJson.dependencies[browserPlatform]).toBeUndefined();
         expect(pkgJson.dependencies[androidPlatform]).toBeUndefined();
         emptyPlatformList().then(function() {
-            return cordova.raw.prepare();
+            return cordova.prepare();
         }).then(function() {
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
             // Expect 'browser' to be added to pkg.json.
@@ -560,7 +560,7 @@ describe('update empty package.json to match config.xml', 
function () {
 
     // Factoring out some repeated checks.
     function emptyPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             expect(installed[1].indexOf(helpers.testPlatform)).toBe(-1);
@@ -590,7 +590,7 @@ describe('update empty package.json to match config.xml', 
function () {
         expect(configEngArray.indexOf('android')).toBeGreaterThan(-1);
         expect(configEngArray.length === 1);
         // Run cordova prepare.
-        cordova.raw.prepare();
+        cordova.prepare();
         emptyPlatformList().then(function() {
             var cfg2 = new ConfigParser(configXmlPath);
             engines = cfg2.getEngines();
@@ -638,7 +638,7 @@ describe('update config.xml to include platforms in 
pkg.json', function () {
 
     // Factoring out some repeated checks.
     function emptyPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             expect(installed[1].indexOf(helpers.testPlatform)).toBe(-1);
@@ -670,7 +670,7 @@ describe('update config.xml to include platforms in 
pkg.json', function () {
         expect(pkgJson.dependencies).toEqual({ 'cordova-android' : '^3.1.0', 
'cordova-browser' : '^4.1.0' });
         emptyPlatformList().then(function() {
             // Run cordova prepare.
-            return cordova.raw.prepare();
+            return cordova.prepare();
         }).then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -725,7 +725,7 @@ describe('update config.xml to use the variable found in 
pkg.json', function ()
     });
     // Factoring out some repeated checks.
     function emptyPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             expect(installed[1].indexOf(helpers.testPlatform)).toBe(-1);
@@ -759,7 +759,7 @@ describe('update config.xml to use the variable found in 
pkg.json', function ()
 
         emptyPlatformList().then(function() {
             // Run cordova prepare.
-            return cordova.raw.prepare();
+            return cordova.prepare();
         }).then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -808,7 +808,7 @@ describe('update pkg.json to include plugin and variable 
found in config.xml', f
 
     // Factoring out some repeated checks.
     function emptyPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             expect(installed[1].indexOf(helpers.testPlatform)).toBe(-1);
@@ -844,7 +844,7 @@ describe('update pkg.json to include plugin and variable 
found in config.xml', f
 
         emptyPlatformList().then(function() {
             // Run cordova prepare.
-            return cordova.raw.prepare();
+            return cordova.prepare();
         }).then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -894,7 +894,7 @@ describe('update pkg.json AND config.xml to include all 
plugins and merge unique
 
     // Factoring out some repeated checks.
     function emptyPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             expect(installed[1].indexOf(helpers.testPlatform)).toBe(-1);
@@ -946,7 +946,7 @@ describe('update pkg.json AND config.xml to include all 
plugins and merge unique
 
         emptyPlatformList().then(function() {
             // Run cordova prepare.
-            return cordova.raw.prepare();
+            return cordova.prepare();
         }).then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -1016,7 +1016,7 @@ describe('update pkg.json AND config.xml to include all 
plugins/merge variables
 
     // Factoring out some repeated checks.
     function emptyPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             expect(installed[1].indexOf(helpers.testPlatform)).toBe(-1);
@@ -1075,7 +1075,7 @@ describe('update pkg.json AND config.xml to include all 
plugins/merge variables
 
         emptyPlatformList().then(function() {
             // Run cordova prepare
-            return cordova.raw.prepare();
+            return cordova.prepare();
         }).then(function() {
             // Delete any previous caches of require(package.json)
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -1157,7 +1157,7 @@ describe('update config.xml to include the plugin that is 
in pkg.json', function
 
     // Factoring out some repeated checks.
     function emptyPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             expect(installed[1].indexOf(helpers.testPlatform)).toBe(-1);
@@ -1193,7 +1193,7 @@ describe('update config.xml to include the plugin that is 
in pkg.json', function
 
         emptyPlatformList().then(function() {
             // Run cordova prepare.
-            return cordova.raw.prepare();
+            return cordova.prepare();
         }).then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -1256,7 +1256,7 @@ describe('platforms and plugins should be restored with 
config.xml even without
 
     // Factoring out some repeated checks.
     function emptyPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             expect(installed[1].indexOf(helpers.testPlatform)).toBe(-1);
@@ -1290,7 +1290,7 @@ describe('platforms and plugins should be restored with 
config.xml even without
 
         emptyPlatformList().then(function() {
             // Run platform add.
-            return cordova.raw.platform('add', browserPlatform, {'save':true});
+            return cordova.platform('add', browserPlatform, {'save':true});
         }).then(function () {
             // Android and browser are in config.xml.
             var cfg3 = new ConfigParser(configXmlPath);
@@ -1317,7 +1317,7 @@ describe('platforms and plugins should be restored with 
config.xml even without
             expect(pkgJson.version).toEqual(cfg3.version());
             expect(pkgJson.displayName).toEqual(cfg3.name());
             // Remove android without --save.
-            return cordova.raw.platform('rm', [browserPlatform]);
+            return cordova.platform('rm', [browserPlatform]);
         }).then(function () {
             // Android should not be in the installed list (only browser).
             platformsJson = cordova_util.requireNoCache(platformsFolderPath1);
@@ -1326,7 +1326,7 @@ describe('platforms and plugins should be restored with 
config.xml even without
             expect(platformsJson[androidPlatform]).not.toBeDefined();
         }).then(function () {
             // Run cordova prepare.
-            return cordova.raw.prepare();
+            return cordova.prepare();
         }).then(function() {
             var cfg2 = new ConfigParser(configXmlPath);
             engines = cfg2.getEngines();
@@ -1357,7 +1357,7 @@ describe('platforms and plugins should be restored with 
config.xml even without
             expect(path.join(pluginsFolderPath16, 
'cordova-plugin-device')).toExist();
         }).then(function () {
             // Remove plugin without save.
-            return cordova.raw.plugin('rm', 'cordova-plugin-device');
+            return cordova.plugin('rm', 'cordova-plugin-device');
         }).then(function () {
             var cfg4 = new ConfigParser(configXmlPath);
             engines = cfg4.getEngines();
@@ -1372,7 +1372,7 @@ describe('platforms and plugins should be restored with 
config.xml even without
             expect(path.join(pluginsFolderPath16, 
'cordova-plugin-device')).not.toExist();
         }).then(function () {
             // Run cordova prepare.
-            return cordova.raw.prepare();
+            return cordova.prepare();
         }).then(function () {
         //  Plugin should be restored and returned to the installed list.
         expect(path.join(pluginsFolderPath16, 
'cordova-plugin-device')).toExist();
@@ -1407,7 +1407,7 @@ describe('tests platform/spec restore with --save', 
function () {
 
     // Factoring out some repeated checks.
     function emptyPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             expect(installed[1].indexOf(helpers.testPlatform)).toBe(-1);
@@ -1415,7 +1415,7 @@ describe('tests platform/spec restore with --save', 
function () {
     }
 
     function fullPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             
expect(installed[1].indexOf(helpers.testPlatform)).toBeGreaterThan(-1);
@@ -1437,7 +1437,7 @@ describe('tests platform/spec restore with --save', 
function () {
 
         emptyPlatformList().then(function() {
             // Add the testing platform with --save.
-            return cordova.raw.platform('add', 'android', {'save':true});
+            return cordova.platform('add', 'android', {'save':true});
         }).then(function() {
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
             // Require platformsFolderPath
@@ -1451,7 +1451,7 @@ describe('tests platform/spec restore with --save', 
function () {
         }).then(fullPlatformList) // Platform should still be in platform ls.
         .then(function() {
             // And now remove helpers.testPlatform without --save.
-            return cordova.raw.platform('rm', [helpers.testPlatform]);
+            return cordova.platform('rm', [helpers.testPlatform]);
         }).then(function() {
             // Delete any previous caches of require(package.json) and 
(platforms.json)
             platformsJson = cordova_util.requireNoCache(platformsFolderPath);
@@ -1462,7 +1462,7 @@ describe('tests platform/spec restore with --save', 
function () {
             expect(platformsJson[helpers.testPlatform]).toBeUndefined();
         }).then(function() {
             // Run cordova prepare.
-            return cordova.raw.prepare();
+            return cordova.prepare();
         }).then(function() {
             // Delete any previous caches of platforms.json.
             platformsJson = cordova_util.requireNoCache(platformsFolderPath);
@@ -1489,10 +1489,10 @@ describe('tests platform/spec restore with --save', 
function () {
 
         emptyPlatformList().then(function() {
             // Add the testing platform with --save.
-            return cordova.raw.platform('add', [helpers.testPlatform], 
{'save':true});
+            return cordova.platform('add', [helpers.testPlatform], 
{'save':true});
         }).then(function() {
             // Add the 'browser' platform with --save
-            return cordova.raw.platform('add',secondPlatformAdded, 
{'save':true});
+            return cordova.platform('add',secondPlatformAdded, {'save':true});
         }).then(function() {
             // Delete any previous caches of require(package.json) and 
(platforms.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -1508,10 +1508,10 @@ describe('tests platform/spec restore with --save', 
function () {
         }).then(fullPlatformList) // Platform should still be in platform ls.
         .then(function() {
             // Remove helpers.testPlatform with --save.
-            return cordova.raw.platform('rm', [helpers.testPlatform], 
{'save':true});
+            return cordova.platform('rm', [helpers.testPlatform], 
{'save':true});
         }).then(function() {
             // Remove secondPlatformAdded without --save.
-            return cordova.raw.platform('rm', secondPlatformAdded);
+            return cordova.platform('rm', secondPlatformAdded);
         }).then(function() {
             // Delete any previous caches of require(package.json) and 
(platformsJson).
             platformsJson = cordova_util.requireNoCache(platformsFolderPath);
@@ -1524,7 +1524,7 @@ describe('tests platform/spec restore with --save', 
function () {
             expect(platformsJson[secondPlatformAdded]).toBeUndefined();
         }).then(function() {
             // Run cordova prepare.
-            return cordova.raw.prepare();
+            return cordova.prepare();
         }).then(function() {
             // Delete any previous caches of platformsJson.
             platformsJson = cordova_util.requireNoCache(platformsFolderPath);

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/ca7a068e/integration-tests/pkgJson.spec.js
----------------------------------------------------------------------
diff --git a/integration-tests/pkgJson.spec.js 
b/integration-tests/pkgJson.spec.js
index 9e85d08..d5cdf15 100644
--- a/integration-tests/pkgJson.spec.js
+++ b/integration-tests/pkgJson.spec.js
@@ -77,7 +77,7 @@ describe('plugin end-to-end', function() {
         expect(pkgJsonPath).toExist();
 
         // Add the plugin with --save.
-        return cordova.raw.plugin('add', pluginId+'@1.1.2', {'save':true, 
'fetch':true})
+        return cordova.plugin('add', pluginId+'@1.1.2', {'save':true, 
'fetch':true})
         .then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -94,7 +94,7 @@ describe('plugin end-to-end', function() {
             expect(configPlugin).toEqual({ name: 'cordova-plugin-device', 
spec: '^1.1.2', variables: {} });
         }).then(function() {
             // And now remove it with --save.
-            return cordova.raw.plugin('rm', pluginId, {'save':true, 
'fetch':true});
+            return cordova.plugin('rm', pluginId, {'save':true, 'fetch':true});
         }).then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -113,10 +113,10 @@ describe('plugin end-to-end', function() {
         expect(pkgJsonPath).toExist();
 
         // Add the geolocation plugin with --save.
-        return cordova.raw.plugin('add', 'cordova-plugin-geolocation', 
{'save':true, 'fetch':true})
+        return cordova.plugin('add', 'cordova-plugin-geolocation', 
{'save':true, 'fetch':true})
         .then(function() {
             // Add a second plugin without save.
-            return cordova.raw.plugin('add', pluginId);
+            return cordova.plugin('add', pluginId);
         }).then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -137,7 +137,7 @@ describe('plugin end-to-end', function() {
         expect(pkgJsonPath).toExist();
 
         // Add the plugin with --save.
-        return cordova.raw.plugin('add', pluginId, {'save':true})
+        return cordova.plugin('add', pluginId, {'save':true})
         .then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -147,7 +147,7 @@ describe('plugin end-to-end', function() {
             expect(pkgJson.cordova.plugins[pluginId]).toBeDefined();
         }).then(function() {
             // And now remove it, but without --save.
-            return cordova.raw.plugin('rm', 'cordova-plugin-device');
+            return cordova.plugin('rm', 'cordova-plugin-device');
         }).then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -166,7 +166,7 @@ describe('plugin end-to-end', function() {
         expect(pkgJsonPath).toExist();
 
         // Add the plugin with --save.
-        return cordova.raw.plugin('add', pluginId, {'save':true, 
'cli_variables': {'someKey':'someValue'}})
+        return cordova.plugin('add', pluginId, {'save':true, 'cli_variables': 
{'someKey':'someValue'}})
         .then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -177,7 +177,7 @@ describe('plugin end-to-end', function() {
             
expect(pkgJson.cordova.plugins[pluginId][someKey]).toEqual('someValue');
         }).then(function() {
             // And now remove it with --save.
-            return cordova.raw.plugin('rm', pluginId, {'save':true});
+            return cordova.plugin('rm', pluginId, {'save':true});
         }).then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -197,7 +197,7 @@ describe('plugin end-to-end', function() {
         expect(pkgJsonPath).toExist();
 
         // Add the plugin with --save.
-        return cordova.raw.plugin('add', 
[pluginId,'cordova-plugin-device-motion'], {'save':true, 'fetch':true})
+        return cordova.plugin('add', 
[pluginId,'cordova-plugin-device-motion'], {'save':true, 'fetch':true})
         .then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -210,7 +210,7 @@ describe('plugin end-to-end', function() {
             
expect(pkgJson.dependencies['cordova-plugin-device-motion']).toBeDefined();
         }).then(function() {
             // And now remove it with --save.
-            return cordova.raw.plugin('rm', 
[pluginId,'cordova-plugin-device-motion'], {'save':true, 'fetch':true});
+            return cordova.plugin('rm', 
[pluginId,'cordova-plugin-device-motion'], {'save':true, 'fetch':true});
         }).then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -249,7 +249,7 @@ describe('plugin end-to-end', function() {
         // Config.xml has no platform or plugin or specs.
         expect(engines.length).toEqual(0);
         // Add ios without version.
-        return cordova.raw.platform('add', ['ios'], {'save':true, 
'fetch':true})
+        return cordova.platform('add', ['ios'], {'save':true, 'fetch':true})
         .then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -273,7 +273,7 @@ describe('plugin end-to-end', function() {
             });
         }).then(function() {
             // Add geolocation plugin with --save --fetch.
-            return cordova.raw.plugin('add', 'cordova-plugin-geolocation', 
{'save':true, 'fetch':true});
+            return cordova.plugin('add', 'cordova-plugin-geolocation', 
{'save':true, 'fetch':true});
         }).then(function() {
             var iosJson = cordova_util.requireNoCache(iosJsonPath);
             
expect(iosJson.installed_plugins['cordova-plugin-geolocation']).toBeDefined();
@@ -311,7 +311,7 @@ describe('plugin end-to-end', function() {
 
         cordova_util.requireNoCache(pkgJsonPath);
         // Run cordova platform add local path --save --fetch.
-        return cordova.raw.platform('add', platformPath, {'save':true, 
'fetch':true})
+        return cordova.platform('add', platformPath, {'save':true, 
'fetch':true})
         .then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -335,7 +335,7 @@ describe('plugin end-to-end', function() {
             });
         }).then(function() {
             // Run cordova plugin add local path --save --fetch.
-            return cordova.raw.plugin('add', pluginPath, {'save':true, 
'fetch':true});
+            return cordova.plugin('add', pluginPath, {'save':true, 
'fetch':true});
         }).then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -389,14 +389,14 @@ describe('platform end-to-end with --save', function () {
 
     // Factoring out some repeated checks.
     function emptyPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             expect(installed[1].indexOf(helpers.testPlatform)).toBe(-1);
         });
     }
     function fullPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             
expect(installed[1].indexOf(helpers.testPlatform)).toBeGreaterThan(-1);
@@ -411,7 +411,7 @@ describe('platform end-to-end with --save', function () {
         // Check there are no platforms yet.
         emptyPlatformList().then(function() {
             // Add the testing platform with --save.
-            return cordova.raw.platform('add', [helpers.testPlatform], 
{'save':true});
+            return cordova.platform('add', [helpers.testPlatform], 
{'save':true});
         }).then(function() {
             // Check the platform add was successful.
             pkgJson = require(pkgJsonPath);
@@ -420,7 +420,7 @@ describe('platform end-to-end with --save', function () {
         }).then(fullPlatformList) // Platform should still be in platform ls.
         .then(function() {
             // And now remove it with --save.
-            return cordova.raw.platform('rm', [helpers.testPlatform], 
{'save':true});
+            return cordova.platform('rm', [helpers.testPlatform], 
{'save':true});
         }).then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -438,7 +438,7 @@ describe('platform end-to-end with --save', function () {
 
         emptyPlatformList().then(function() {
             // Add the testing platform with --save.
-            return cordova.raw.platform('add', [helpers.testPlatform], 
{'save':true});
+            return cordova.platform('add', [helpers.testPlatform], 
{'save':true});
         }).then(function() {
             // Check the platform add was successful.
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -447,7 +447,7 @@ describe('platform end-to-end with --save', function () {
         }).then(fullPlatformList) // Platform should still be in platform ls.
         .then(function() {
             // And now remove it without --save.
-            return cordova.raw.platform('rm', [helpers.testPlatform]);
+            return cordova.platform('rm', [helpers.testPlatform]);
         }).then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -467,7 +467,7 @@ describe('platform end-to-end with --save', function () {
         // Pkg.json "platforms" should be empty and helpers.testPlatform 
should not exist in pkg.json.
         expect(pkgJson.cordova).toBeUndefined();
         // Add platform without --save.
-        cordova.raw.platform('add',[helpers.testPlatform])
+        cordova.platform('add',[helpers.testPlatform])
         .then(function() {
             // Check the platform add was successful, reload, skipping cache.
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -487,10 +487,10 @@ describe('platform end-to-end with --save', function () {
         expect(pkgJsonPath).toExist();
 
         // Add a platform without --save.
-        cordova.raw.platform('add',platformNotToAdd)
+        cordova.platform('add',platformNotToAdd)
         .then(function() {
             // And now add another platform with --save.
-            return cordova.raw.platform('add', [helpers.testPlatform], 
{'save':true});
+            return cordova.platform('add', [helpers.testPlatform], 
{'save':true});
         }).then(function() {
             // Check the platform add was successful, reload, skipping cache.
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -527,7 +527,7 @@ describe('platform end-to-end with --save', function () {
         // Check there are no platforms yet.
         emptyPlatformList().then(function() {
             // Add the testing platform with --save and add specific version 
to android platform.
-            return cordova.raw.platform('add', ['android@6.1.0', 
'browser@4.1.0'], {'save':true, 'fetch':true});
+            return cordova.platform('add', ['android@6.1.0', 'browser@4.1.0'], 
{'save':true, 'fetch':true});
         }).then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -554,7 +554,7 @@ describe('platform end-to-end with --save', function () {
         }).then(fullPlatformList) // Platform should still be in platform ls.
         .then(function() {
             // And now remove it with --save.
-            return cordova.raw.platform('rm', ['android', 'browser'], 
{'save':true, 'fetch':true});
+            return cordova.platform('rm', ['android', 'browser'], 
{'save':true, 'fetch':true});
         }).then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -606,7 +606,7 @@ describe('During add, if pkg.json has a platform/plugin 
spec, use that one.', fu
 
     // Factoring out some repeated checks.
     function emptyPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             expect(installed[1].indexOf(helpers.testPlatform)).toBe(-1);
@@ -643,7 +643,7 @@ describe('During add, if pkg.json has a platform/plugin 
spec, use that one.', fu
 
         emptyPlatformList().then(function() {
             // Add ios with --save and --fetch.
-            return cordova.raw.platform('add', [iosPlatform], {'save':true , 
'fetch':true});
+            return cordova.platform('add', [iosPlatform], {'save':true , 
'fetch':true});
         }).then(function() {
             // Require platformsFolderPath, ios and spec should be in there.
             platformsJson = cordova_util.requireNoCache(platformsFolderPath);
@@ -677,7 +677,7 @@ describe('During add, if pkg.json has a platform/plugin 
spec, use that one.', fu
             expect(semver.satisfies(platformsJson[iosPlatform], 
pkgJson.dependencies['cordova-ios'])).toEqual(true);
         }).then(function() {
             // Add splashscreen plugin with --save --fetch.
-            return cordova.raw.plugin('add', 'cordova-plugin-splashscreen', 
{'save':true, 'fetch':true});
+            return cordova.plugin('add', 'cordova-plugin-splashscreen', 
{'save':true, 'fetch':true});
         }).then(function() {
             pluginPkgJsonVersion = 
cordova_util.requireNoCache(pluginPkgJsonDir);
             // Check that pkg.json version and plugin pkg.json version 
"satisfy" each other.
@@ -715,7 +715,7 @@ describe('During add, if config.xml has a platform/plugin 
spec and pkg.json does
 
     // Factoring out some repeated checks.
     function emptyPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             expect(installed[1].indexOf(helpers.testPlatform)).toBe(-1);
@@ -744,10 +744,10 @@ describe('During add, if config.xml has a platform/plugin 
spec and pkg.json does
 
         // Pkg.json does not have platform or spec yet. Config.xml has ios and 
spec '~4.2.1'.
         // Remove for testing purposes so platform is not pre-installed.
-        cordova.raw.platform('rm', [iosPlatform], {'save':true});
+        cordova.platform('rm', [iosPlatform], {'save':true});
         emptyPlatformList().then(function() {
             // Add ios with --save and --fetch.
-            return cordova.raw.platform('add', [iosPlatform], {'save':true , 
'fetch':true});
+            return cordova.platform('add', [iosPlatform], {'save':true , 
'fetch':true});
         }).then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -770,7 +770,7 @@ describe('During add, if config.xml has a platform/plugin 
spec and pkg.json does
             });
         }).then(function() {
             // Add splashscreen with --save --fetch.
-            return cordova.raw.plugin('add', 'cordova-plugin-splashscreen', 
{'save':true, 'fetch':true});
+            return cordova.plugin('add', 'cordova-plugin-splashscreen', 
{'save':true, 'fetch':true});
         }).then(function() {
             var cfg3 = new ConfigParser(configXmlPath);
             // Check config.xml for plugins and spec.
@@ -814,7 +814,7 @@ describe('During add, if add specifies a platform spec, use 
that one regardless
 
     // Factoring out some repeated checks.
     function emptyPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             expect(installed[1].indexOf(helpers.testPlatform)).toBe(-1);
@@ -848,7 +848,7 @@ describe('During add, if add specifies a platform spec, use 
that one regardless
         expect(engines).toEqual([ { name: 'ios', spec: '~4.2.1' } ]);
         emptyPlatformList().then(function() {
             // Add ios with --save and --fetch.
-            return cordova.raw.platform('add', ['ios@4.3.0'], {'save':true , 
'fetch':true});
+            return cordova.platform('add', ['ios@4.3.0'], {'save':true , 
'fetch':true});
         }).then(function() {
             // Delete any previous caches of require(package.json).
             pkgJson = cordova_util.requireNoCache(pkgJsonPath);
@@ -870,7 +870,7 @@ describe('During add, if add specifies a platform spec, use 
that one regardless
             expect(semver.satisfies(iosVersion.version, 
pkgJson.dependencies['cordova-ios'])).toEqual(true);
         }).then(function() {
             // Add splashscreen with --save --fetch.
-            return cordova.raw.plugin('add', 
'cordova-plugin-splashscreen@4.0.0', {'save':true, 'fetch':true});
+            return cordova.plugin('add', 'cordova-plugin-splashscreen@4.0.0', 
{'save':true, 'fetch':true});
         }).then(function() {
             var cfg3 = new ConfigParser(configXmlPath);
             // Check config.xml for plugins and spec.
@@ -927,7 +927,7 @@ describe('local path is added to config.xml without 
pkg.json', function () {
         var platformPath = 
path.join(testRunRoot,'spec-cordova/fixtures/platforms/cordova-browser');
 
         // Run cordova platform add local path --save --fetch.
-        return cordova.raw.platform('add', platformPath, {'save':true, 
'fetch':true})
+        return cordova.platform('add', platformPath, {'save':true, 
'fetch':true})
         .then(function() {
             var cfg2 = new ConfigParser(configXmlPath);
             engines = cfg2.getEngines();
@@ -955,7 +955,7 @@ describe('local path is added to config.xml without 
pkg.json', function () {
         var configPlugins = cfg.getPluginIdList();
         var configPlugin = cfg.getPlugin(configPlugins);
         // Run platform add with local path.
-        return cordova.raw.plugin('add', pluginPath, {'save':true, 
'fetch':true})
+        return cordova.plugin('add', pluginPath, {'save':true, 'fetch':true})
         .then(function() {
             var cfg2 = new ConfigParser(configXmlPath);
             // Check config.xml for plugins and spec.

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/ca7a068e/spec-cordova/HooksRunner.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/HooksRunner.spec.js b/spec-cordova/HooksRunner.spec.js
index ef28fa8..86d3896 100644
--- a/spec-cordova/HooksRunner.spec.js
+++ b/spec-cordova/HooksRunner.spec.js
@@ -125,7 +125,7 @@ describe('HooksRunner', function() {
 
 
         // Add the testing platform.
-        cordova.raw.platform('add', [helpers.testPlatform]).fail(function 
(err) {
+        cordova.platform('add', [helpers.testPlatform]).fail(function (err) {
             expect(err).toBeUndefined();
             done();
         }).then(function () {
@@ -142,7 +142,7 @@ describe('HooksRunner', function() {
 
             hookOptions = { projectRoot: project, cordova: options };
 
-            cordova.raw.plugin('add', testPluginFixturePath).fail(function 
(err) {
+            cordova.plugin('add', testPluginFixturePath).fail(function (err) {
                 expect(err && err.stack).toBeUndefined();
                 done();
             }).then(function () {
@@ -423,10 +423,10 @@ describe('HooksRunner', function() {
                 var projectRoot = cordovaUtil.isCordova();
 
                 // remove plugin
-                cordova.raw.plugin('rm', 'com.plugin.withhooks').fail(function 
(err) {
+                cordova.plugin('rm', 'com.plugin.withhooks').fail(function 
(err) {
                     expect(err.stack).toBeUndefined();
                 }).then(function () {
-                    cordova.raw.plugin('add', 
testPluginFixturePath).fail(function (err) {
+                    cordova.plugin('add', testPluginFixturePath).fail(function 
(err) {
                         expect(err).toBeUndefined();
                     }).then(function () {
                         testPluginInstalledPath = path.join(projectRoot, 
'plugins', 'com.plugin.withhooks');

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/ca7a068e/spec-cordova/build.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/build.spec.js b/spec-cordova/build.spec.js
index d1fe02e..b6e3ad1 100644
--- a/spec-cordova/build.spec.js
+++ b/spec-cordova/build.spec.js
@@ -34,13 +34,13 @@ describe('build command', function() {
         cd_project_root = spyOn(util, 
'cdProjectRoot').and.returnValue(project_dir);
         list_platforms = spyOn(util, 
'listPlatforms').and.returnValue(supported_platforms);
         fire = spyOn(HooksRunner.prototype, 'fire').and.returnValue(Q());
-        prepare_spy = spyOn(cordova.raw, 'prepare').and.returnValue(Q());
-        compile_spy = spyOn(cordova.raw, 'compile').and.returnValue(Q());
+        prepare_spy = spyOn(cordova, 'prepare').and.returnValue(Q());
+        compile_spy = spyOn(cordova, 'compile').and.returnValue(Q());
     });
     describe('failure', function() {
         it('Test 001 : should not run inside a project with no platforms', 
function(done) {
             list_platforms.and.returnValue([]);
-            cordova.raw.build()
+            cordova.build()
             .then(function() {
                 expect('this call').toBe('fail');
             }, function(err) {
@@ -53,7 +53,7 @@ describe('build command', function() {
         it('Test 002 : should not run outside of a Cordova-based project', 
function(done) {
             is_cordova.and.returnValue(false);
 
-            cordova.raw.build()
+            cordova.build()
             .then(function() {
                 expect('this call').toBe('fail');
             }, function(err) {
@@ -66,7 +66,7 @@ describe('build command', function() {
 
     describe('success', function() {
         it('Test 003 : should run inside a Cordova-based project with at least 
one added platform and call both prepare and compile', function(done) {
-            cordova.raw.build(['android','ios']).then(function() {
+            cordova.build(['android','ios']).then(function() {
                 var opts = Object({ platforms: [ 'android', 'ios' ], verbose: 
false, options: Object({  }) });
                 expect(prepare_spy).toHaveBeenCalledWith(opts);
                 expect(compile_spy).toHaveBeenCalledWith(opts);
@@ -74,7 +74,7 @@ describe('build command', function() {
             });
         });
         it('Test 004 : should pass down options', function(done) {
-            cordova.raw.build({platforms: ['android'], options: {release: 
true}}).then(function() {
+            cordova.build({platforms: ['android'], options: {release: 
true}}).then(function() {
                 var opts = {platforms: ['android'], options: {release: true}, 
verbose: false};
                 expect(prepare_spy).toHaveBeenCalledWith(opts);
                 expect(compile_spy).toHaveBeenCalledWith(opts);
@@ -84,11 +84,11 @@ describe('build command', function() {
 
         it('Test 005 : should convert options from old format and warn user 
about this', function (done) {
             function warnSpy(message) {
-                expect(message).toMatch('The format of cordova.raw.* methods 
"options" argument was changed');
+                expect(message).toMatch('The format of cordova.* methods 
"options" argument was changed');
             }
 
             cordova.on('warn', warnSpy);
-            cordova.raw.build({platforms:['android'], options:['--release', 
'--cdvBuildOpt=opt']}).then(function () {
+            cordova.build({platforms:['android'], options:['--release', 
'--cdvBuildOpt=opt']}).then(function () {
                 var opts = {platforms: ['android'], options: 
jasmine.objectContaining({release: true, argv: ['--cdvBuildOpt=opt']}), 
verbose: false};
                 expect(prepare_spy).toHaveBeenCalledWith(opts);
                 expect(compile_spy).toHaveBeenCalledWith(opts);
@@ -101,13 +101,13 @@ describe('build command', function() {
     describe('hooks', function() {
         describe('when platforms are added', function() {
             it('Test 006 : should fire before hooks through the hooker 
module', function(done) {
-                cordova.raw.build(['android', 'ios']).then(function() {
+                cordova.build(['android', 'ios']).then(function() {
                     expect(fire.calls.argsFor(0)).toEqual(['before_build', 
{verbose: false, platforms:['android', 'ios'] , options: {}}]);
                     done();
                 });
             });
             it('Test 007 : should fire after hooks through the hooker module', 
function(done) {
-                cordova.raw.build('android').then(function() {
+                cordova.build('android').then(function() {
                      expect(fire.calls.argsFor(1)).toEqual([ 'after_build', { 
platforms: [ 'android' ], verbose: false, options: {} } ]);
                      done();
                 });
@@ -117,7 +117,7 @@ describe('build command', function() {
         describe('with no platforms added', function() {
             it('Test 008 : should not fire the hooker', function(done) {
                 list_platforms.and.returnValue([]);
-                Q().then(cordova.raw.build).then(function() {
+                Q().then(cordova.build).then(function() {
                     expect('this call').toBe('fail');
                 }, function(err) {
                     expect(err.message).toEqual(

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/ca7a068e/spec-cordova/compile.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/compile.spec.js b/spec-cordova/compile.spec.js
index 4cd1c1d..4c94508 100644
--- a/spec-cordova/compile.spec.js
+++ b/spec-cordova/compile.spec.js
@@ -42,7 +42,7 @@ describe('compile command', function() {
         it('Test 001 : should not run inside a Cordova-based project with no 
added platforms by calling util.listPlatforms', function(done) {
             list_platforms.and.returnValue([]);
             var success = jasmine.createSpy('success');
-            cordova.raw.compile()
+            cordova.compile()
             .then(success, function(result) {
                 expect(result instanceof Error).toBe(true);
                 expect('' + result).toContain('No platforms added to this 
project. Please use `cordova platform add <platform>`.');
@@ -55,7 +55,7 @@ describe('compile command', function() {
         it('Test 002 : should not run outside of a Cordova-based project', 
function(done) {
             is_cordova.and.returnValue(false);
             var success = jasmine.createSpy('success');
-            cordova.raw.compile()
+            cordova.compile()
             .then(success, function(result) {
                 expect(result instanceof Error).toBe(true);
             })
@@ -68,7 +68,7 @@ describe('compile command', function() {
 
     describe('success', function() {
         it('Test 003 : should run inside a Cordova-based project with at least 
one added platform and shell out to build', function(done) {
-            cordova.raw.compile(['android','ios']).then(function() {
+            cordova.compile(['android','ios']).then(function() {
                 expect(getPlatformApi).toHaveBeenCalledWith('android');
                 expect(getPlatformApi).toHaveBeenCalledWith('ios');
                 expect(platformApi.build).toHaveBeenCalled();
@@ -78,7 +78,7 @@ describe('compile command', function() {
         });
 
         it('Test 004 : should pass down optional parameters', function (done) {
-            cordova.raw.compile({platforms:['blackberry10'], options:{release: 
true}}).then(function () {
+            cordova.compile({platforms:['blackberry10'], options:{release: 
true}}).then(function () {
                 expect(getPlatformApi).toHaveBeenCalledWith('blackberry10');
                 expect(platformApi.build).toHaveBeenCalledWith({release: 
true});
             })
@@ -88,11 +88,11 @@ describe('compile command', function() {
 
         it('Test 005 : should convert options from old format and warn user 
about this', function (done) {
             function warnSpy(message) {
-                expect(message).toMatch('The format of cordova.raw.* methods 
"options" argument was changed');
+                expect(message).toMatch('The format of cordova.* methods 
"options" argument was changed');
             }
 
             cordova.on('warn', warnSpy);
-            cordova.raw.compile({platforms:['blackberry10'], 
options:['--release']}).then(function () {
+            cordova.compile({platforms:['blackberry10'], 
options:['--release']}).then(function () {
                 expect(getPlatformApi).toHaveBeenCalledWith('blackberry10');
                 expect(platformApi.build).toHaveBeenCalledWith({release: true, 
argv: []});
             })
@@ -107,7 +107,7 @@ describe('compile command', function() {
     describe('hooks', function() {
         describe('when platforms are added', function() {
             it('Test 006 : should fire before hooks through the hooker 
module', function(done) {
-                cordova.raw.compile(['android', 'ios']).then(function() {
+                cordova.compile(['android', 'ios']).then(function() {
                     expect(fire.calls.argsFor(0)).toEqual(['before_compile', 
{verbose: false, platforms:['android', 'ios'] , options: {}}]);
                     done();
                 })
@@ -115,7 +115,7 @@ describe('compile command', function() {
                 .fin(done);
             });
             it('Test 007 : should fire after hooks through the hooker module', 
function(done) {
-                cordova.raw.compile('android').then(function() {
+                cordova.compile('android').then(function() {
                     expect(fire.calls.argsFor(1)).toEqual(['after_compile', 
{verbose: false, platforms:['android'] , options: {}}]);
                     done();
                 })
@@ -127,7 +127,7 @@ describe('compile command', function() {
         describe('with no platforms added', function() {
             it('Test 008 : should not fire the hooker', function(done) {
                 list_platforms.and.returnValue([]);
-                Q().then(cordova.raw.compile).then(function() {
+                Q().then(cordova.compile).then(function() {
                     expect('this call').toBe('fail');
                 }, function(err) {
                     expect(fire).not.toHaveBeenCalled();

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/ca7a068e/spec-cordova/create.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/create.spec.js b/spec-cordova/create.spec.js
index d731ccb..d9bc572 100644
--- a/spec-cordova/create.spec.js
+++ b/spec-cordova/create.spec.js
@@ -40,7 +40,7 @@ var configBasic = {
 
 describe('cordova create checks for valid-identifier', function() {
     it('Test 001 : should reject reserved words from start of id', 
function(done) {
-        cordova.raw.create('projectPath', 'int.bob', 'appName', {}, events)
+        cordova.create('projectPath', 'int.bob', 'appName', {}, events)
         .fail(function(err) {
             expect(err.message).toBe('App id contains a reserved word, or is 
not a valid identifier.');
         })
@@ -48,7 +48,7 @@ describe('cordova create checks for valid-identifier', 
function() {
     });
     
     it('Test 002 : should reject reserved words from end of id', 
function(done) {
-        cordova.raw.create('projectPath', 'bob.class', 'appName', {}, events)
+        cordova.create('projectPath', 'bob.class', 'appName', {}, events)
         .fail(function(err) {
             expect(err.message).toBe('App id contains a reserved word, or is 
not a valid identifier.');
         })
@@ -99,7 +99,7 @@ describe('create basic test (see more in cordova-create)', 
function() {
         Q()
             .then(function() {
                 // Create a real project
-                return cordova.raw.create(project, appId, appName, 
configBasic, events);
+                return cordova.create(project, appId, appName, configBasic, 
events);
             })
             .then(checkProject)
             .fail(function(err) {
@@ -109,4 +109,4 @@ describe('create basic test (see more in cordova-create)', 
function() {
             .fin(done);
     }, 60000);
 
-});
\ No newline at end of file
+});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/ca7a068e/spec-cordova/emulate.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/emulate.spec.js b/spec-cordova/emulate.spec.js
index ecb6440..24a72bf 100644
--- a/spec-cordova/emulate.spec.js
+++ b/spec-cordova/emulate.spec.js
@@ -34,7 +34,7 @@ describe('emulate command', function() {
         cd_project_root = spyOn(util, 
'cdProjectRoot').and.returnValue(project_dir);
         list_platforms = spyOn(util, 
'listPlatforms').and.returnValue(supported_platforms);
         fire = spyOn(HooksRunner.prototype, 'fire').and.returnValue(Q());
-        prepare_spy = spyOn(cordova.raw, 'prepare').and.returnValue(Q());
+        prepare_spy = spyOn(cordova, 'prepare').and.returnValue(Q());
         fail = function (err) { expect(err.stack).not.toBeDefined(); };
         platformApi = {
             run: jasmine.createSpy('run').and.returnValue(Q()),
@@ -47,7 +47,7 @@ describe('emulate command', function() {
         it('Test 001 : should not run inside a Cordova-based project with no 
added platforms by calling util.listPlatforms', function(done) {
             list_platforms.and.returnValue([]);
             var success = jasmine.createSpy('success');
-            cordova.raw.compile()
+            cordova.compile()
             .then(success, function(result) {
                 expect(result instanceof Error).toBe(true);
                 expect('' + result).toContain('No platforms added to this 
project. Please use `cordova platform add <platform>`.');
@@ -60,7 +60,7 @@ describe('emulate command', function() {
         it('Test 002 : should not run outside of a Cordova-based project', 
function(done) {
             is_cordova.and.returnValue(false);
             var success = jasmine.createSpy('success');
-            cordova.raw.compile()
+            cordova.compile()
             .then(success, function(result) {
                 expect(result instanceof Error).toBe(true);
             })
@@ -73,7 +73,7 @@ describe('emulate command', function() {
 
     describe('success', function() {
         it('Test 003 : should run inside a Cordova-based project with at least 
one added platform and call prepare and shell out to the emulate script', 
function(done) {
-            cordova.raw.emulate(['android','ios']).then(function(err) {
+            cordova.emulate(['android','ios']).then(function(err) {
                 
expect(prepare_spy).toHaveBeenCalledWith(jasmine.objectContaining({platforms: 
['android', 'ios']}));
                 expect(getPlatformApi).toHaveBeenCalledWith('android');
                 expect(getPlatformApi).toHaveBeenCalledWith('ios');
@@ -84,7 +84,7 @@ describe('emulate command', function() {
             .fin(done);
         });
         it('Test 004 : should pass down options', function(done) {
-            cordova.raw.emulate({platforms: ['ios'], options: {optionTastic: 
true }}).then(function(err) {
+            cordova.emulate({platforms: ['ios'], options: {optionTastic: true 
}}).then(function(err) {
                 
expect(prepare_spy).toHaveBeenCalledWith(jasmine.objectContaining({platforms: 
['ios']}));
                 expect(getPlatformApi).toHaveBeenCalledWith('ios');
                 expect(platformApi.build).toHaveBeenCalledWith({ device: 
false, emulator: true, optionTastic: true });
@@ -95,11 +95,11 @@ describe('emulate command', function() {
         });
         it('Test 005 : should convert options from old format and warn user 
about this', function (done) {
             function warnSpy(message) {
-                expect(message).toMatch('The format of cordova.raw.* methods 
"options" argument was changed');
+                expect(message).toMatch('The format of cordova.* methods 
"options" argument was changed');
             }
 
             cordova.on('warn', warnSpy);
-            cordova.raw.emulate({platforms:['ios'], 
options:['--optionTastic']}).then(function () {
+            cordova.emulate({platforms:['ios'], 
options:['--optionTastic']}).then(function () {
                 
expect(prepare_spy).toHaveBeenCalledWith(jasmine.objectContaining({platforms: 
['ios']}));
                 expect(getPlatformApi).toHaveBeenCalledWith('ios');
                 
expect(platformApi.run).toHaveBeenCalledWith(jasmine.objectContaining({emulator:
 true, argv: ['--optionTastic']}));
@@ -123,7 +123,7 @@ describe('emulate command', function() {
                 platformApi.build = originalBuildSpy;
             });
             it('Test 006 : should leave parameters unchanged', function(done) {
-                cordova.raw.run({platforms: ['blackberry10'], 
options:{password: '1q1q'}}).then(function() {
+                cordova.run({platforms: ['blackberry10'], options:{password: 
'1q1q'}}).then(function() {
                     expect(prepare_spy).toHaveBeenCalledWith({ platforms: [ 
'blackberry10' ], options: { password: '1q1q', 'couldBeModified': 'insideBuild' 
}, verbose: false });
                     expect(platformApi.build).toHaveBeenCalledWith({password: 
'1q1q', 'couldBeModified': 'insideBuild'});
                     expect(platformApi.run).toHaveBeenCalledWith({password: 
'1q1q', nobuild: true});
@@ -134,7 +134,7 @@ describe('emulate command', function() {
         });
 
         it('Test 007 : should call platform\'s build method', function (done) {
-            cordova.raw.emulate({platforms: ['blackberry10']})
+            cordova.emulate({platforms: ['blackberry10']})
             .then(function() {
                 expect(prepare_spy).toHaveBeenCalled();
                 expect(platformApi.build).toHaveBeenCalledWith({device: false, 
emulator: true});
@@ -146,7 +146,7 @@ describe('emulate command', function() {
         });
 
         it('Test 008 : should not call build if --nobuild option is passed', 
function (done) {
-            cordova.raw.emulate({platforms: ['blackberry10'], options: { 
nobuild: true }})
+            cordova.emulate({platforms: ['blackberry10'], options: { nobuild: 
true }})
             .then(function() {
                 expect(prepare_spy).toHaveBeenCalled();
                 expect(platformApi.build).not.toHaveBeenCalled();
@@ -161,7 +161,7 @@ describe('emulate command', function() {
     describe('hooks', function() {
         describe('when platforms are added', function() {
             it('Test 009 : should fire before hooks through the hooker 
module', function(done) {
-                cordova.raw.emulate(['android', 'ios']).then(function() {
+                cordova.emulate(['android', 'ios']).then(function() {
                     expect(fire).toHaveBeenCalledWith('before_emulate',
                         jasmine.objectContaining({verbose: false, 
platforms:['android', 'ios'], options: jasmine.any(Object)}));
                 })
@@ -169,7 +169,7 @@ describe('emulate command', function() {
                 .fin(done);
             });
             it('Test 010 : should fire after hooks through the hooker module', 
function(done) {
-                cordova.raw.emulate('android').then(function() {
+                cordova.emulate('android').then(function() {
                      expect(fire).toHaveBeenCalledWith('after_emulate',
                         jasmine.objectContaining({verbose: false, 
platforms:['android'], options: jasmine.any(Object)}));
                 })
@@ -181,7 +181,7 @@ describe('emulate command', function() {
         describe('with no platforms added', function() {
             it('Test 011 : should not fire the hooker', function(done) {
                 list_platforms.and.returnValue([]);
-                Q().then(cordova.raw.emulate).then(function() {
+                Q().then(cordova.emulate).then(function() {
                     expect('this call').toBe('fail');
                 }, function(err) {
                     expect(fire).not.toHaveBeenCalled();
@@ -190,4 +190,4 @@ describe('emulate command', function() {
             });
         });
     });
-});
\ No newline at end of file
+});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/ca7a068e/spec-cordova/platform.spec.ios.js
----------------------------------------------------------------------
diff --git a/spec-cordova/platform.spec.ios.js 
b/spec-cordova/platform.spec.ios.js
index 6934a8f..5a183bc 100644
--- a/spec-cordova/platform.spec.ios.js
+++ b/spec-cordova/platform.spec.ios.js
@@ -47,13 +47,13 @@ describe('cocoapod plugin add and rm end-to-end', function 
() {
 
     it('Test 001 : installs and uninstalls plugin depending on new pod and 
existing pod', function(done) {
 
-        cordova.raw.create('hello4')
+        cordova.create('hello4')
         .then(function() {
             process.chdir(project);
-            return cordova.raw.platform('add', 
'https://git-wip-us.apache.org/repos/asf/cordova-ios.git');
+            return cordova.platform('add', 
'https://git-wip-us.apache.org/repos/asf/cordova-ios.git');
         })
         .then(function() {
-            return cordova.raw.plugin('add', samplePlugin);
+            return cordova.plugin('add', samplePlugin);
         })
         .then(function() {
             podfile = path.resolve('./platforms/ios/Podfile');
@@ -81,7 +81,7 @@ describe('cocoapod plugin add and rm end-to-end', function () 
{
             var podsJSONContent = require(podsJSON);
             expect(podsJSONContent[AFNetworking] !== null);
 
-            return cordova.raw.plugin('add', overlappingDependencyPlugin);
+            return cordova.plugin('add', overlappingDependencyPlugin);
         })
         .then(function() {
             var podfileContent = fs.readFileSync(podfile, {'encoding' : 
'utf8'});
@@ -99,7 +99,7 @@ describe('cocoapod plugin add and rm end-to-end', function () 
{
             //spec property should not be changed because of overlapping 
dependency
             expect(specPropertyOfAFNetworkingInPodsJSON).toEqual('~> 3.0');
 
-            return 
cordova.raw.plugin('rm','sample-cocoapod-plugin-overlapping-dependency');
+            return 
cordova.plugin('rm','sample-cocoapod-plugin-overlapping-dependency');
         })
         .then(function() {
             //expect only AFNetworking
@@ -113,7 +113,7 @@ describe('cocoapod plugin add and rm end-to-end', function 
() {
             expect(podsJSONContent[AFNetworking]);
             expect(podsJSONContent[CWStatusBarNotification] === undefined);
 
-            return cordova.raw.plugin('rm', 
'sample-cordova-plugin-cocoapod-dependent');
+            return cordova.plugin('rm', 
'sample-cordova-plugin-cocoapod-dependent');
         })
         .then(function() {
             //expect no pods 
@@ -134,4 +134,4 @@ describe('cocoapod plugin add and rm end-to-end', function 
() {
         })
         .fin(done);
     }, 60000); 
-});
\ No newline at end of file
+});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/ca7a068e/spec-cordova/platform.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/platform.spec.js b/spec-cordova/platform.spec.js
index c15b0f2..ae23178 100644
--- a/spec-cordova/platform.spec.js
+++ b/spec-cordova/platform.spec.js
@@ -77,14 +77,14 @@ describe('platform end-to-end', function () {
 
     // Factoring out some repeated checks.
     function emptyPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             expect(installed[1].indexOf(helpers.testPlatform)).toBe(-1);
         });
     }
     function fullPlatformList() {
-        return cordova.raw.platform('list').then(function() {
+        return cordova.platform('list').then(function() {
             var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             
expect(installed[1].indexOf(helpers.testPlatform)).toBeGreaterThan(-1);
@@ -103,7 +103,7 @@ describe('platform end-to-end', function () {
         // Check there are no platforms yet.
         emptyPlatformList().then(function() {
             // Add the testing platform.
-            return cordova.raw.platform('add', [helpers.testPlatform]);
+            return cordova.platform('add', [helpers.testPlatform]);
         }).then(function() {
             // Check the platform add was successful.
             expect(path.join(project, 'platforms', 
helpers.testPlatform)).toExist();
@@ -111,14 +111,14 @@ describe('platform end-to-end', function () {
         }).then(fullPlatformList) // Check for it in platform ls.
         .then(function() {
             // Try to update the platform.
-            return cordova.raw.platform('update', [helpers.testPlatform]);
+            return cordova.platform('update', [helpers.testPlatform]);
         }).then(function() {
             // Our fake update script in the exec mock above creates this 
dummy file.
             expect(path.join(project, 'platforms', helpers.testPlatform, 
'updated')).toExist();
         }).then(fullPlatformList) // Platform should still be in platform ls.
         .then(function() {
             // And now remove it.
-            return cordova.raw.platform('rm', [helpers.testPlatform]);
+            return cordova.platform('rm', [helpers.testPlatform]);
         }).then(function() {
             // It should be gone.
             expect(path.join(project, 'platforms', 
helpers.testPlatform)).not.toExist();
@@ -130,9 +130,9 @@ describe('platform end-to-end', function () {
 
     it('Test 002 : should install plugins correctly while adding platform', 
function(done) {
 
-        cordova.raw.plugin('add', path.join(pluginsDir, 'test'))
+        cordova.plugin('add', path.join(pluginsDir, 'test'))
         .then(function() {
-            return cordova.raw.platform('add', [helpers.testPlatform]);
+            return cordova.platform('add', [helpers.testPlatform]);
         })
         .then(function() {
             // Check the platform add was successful.
@@ -149,12 +149,12 @@ describe('platform end-to-end', function () {
     it('Test 003 : should call prepare after plugins were installed into 
platform', function(done) {
         var order = '';
         var fail = jasmine.createSpy(fail);
-        spyOn(plugman.raw, 'install').and.callFake(function() { order += 'I'; 
});
-        spyOn(cordova.raw, 'prepare').and.callFake(function() { order += 'P'; 
});
+        spyOn(plugman, 'install').and.callFake(function() { order += 'I'; });
+        spyOn(cordova, 'prepare').and.callFake(function() { order += 'P'; });
 
-        cordova.raw.plugin('add', path.join(pluginsDir, 'test'))
+        cordova.plugin('add', path.join(pluginsDir, 'test'))
         .then(function() {
-            return cordova.raw.platform('add', [helpers.testPlatform]);
+            return cordova.platform('add', [helpers.testPlatform]);
         })
         .fail(fail)
         .fin(function() {
@@ -220,23 +220,23 @@ describe('platform add plugin rm end-to-end', function () 
{
 
     it('Test 006 : should remove dependency when removing parent plugin', 
function(done) {
 
-        cordova.raw.create('hello')
+        cordova.create('hello')
         .then(function() {
             process.chdir(project);
-            return cordova.raw.platform('add', 'browser@latest');
+            return cordova.platform('add', 'browser@latest');
         })
         .then(function() {
-            return cordova.raw.plugin('add', 'cordova-plugin-media');
+            return cordova.plugin('add', 'cordova-plugin-media');
         })
         .then(function() {
             expect(path.join(pluginsDir, 'cordova-plugin-media')).toExist();
             expect(path.join(pluginsDir, 'cordova-plugin-file')).toExist();
-            return cordova.raw.platform('add', 'android');
+            return cordova.platform('add', 'android');
         })
         .then(function() {
             expect(path.join(pluginsDir, 'cordova-plugin-media')).toExist();
             expect(path.join(pluginsDir, 'cordova-plugin-file')).toExist();
-            return cordova.raw.plugin('rm', 'cordova-plugin-media');
+            return cordova.plugin('rm', 'cordova-plugin-media');
         })
         .then(function() {
             expect(path.join(pluginsDir, 
'cordova-plugin-media')).not.toExist();
@@ -268,27 +268,27 @@ describe('platform add and remove --fetch', function () {
 
     it('Test 007 : should add and remove platform from node_modules 
directory', function(done) {
 
-        cordova.raw.create('helloFetch')
+        cordova.create('helloFetch')
         .then(function() {
             process.chdir(project);
-            return cordova.raw.platform('add', 'browser', {'fetch':true});
+            return cordova.platform('add', 'browser', {'fetch':true});
         })
         .then(function() {
             expect(path.join(nodeModulesDir, 'cordova-browser')).toExist();
             expect(path.join(platformsDir, 'browser')).toExist();
-            return cordova.raw.platform('add', 'android', {'fetch':true});
+            return cordova.platform('add', 'android', {'fetch':true});
         })
         .then(function() {
             expect(path.join(nodeModulesDir, 'cordova-browser')).toExist();
             expect(path.join(platformsDir, 'android')).toExist();
             //Tests finish before this command finishes resolving
-            //return cordova.raw.platform('rm', 'ios', {'fetch':true});
+            //return cordova.platform('rm', 'ios', {'fetch':true});
         })
         .then(function() {
             //expect(path.join(nodeModulesDir, 'cordova-ios')).not.toExist();
             //expect(path.join(platformsDir, 'ios')).not.toExist();
             //Tests finish before this command finishes resolving
-            //return cordova.raw.platform('rm', 'android', {'fetch':true});
+            //return cordova.platform('rm', 'android', {'fetch':true});
         })
         .then(function() {
             //expect(path.join(nodeModulesDir, 
'cordova-android')).not.toExist();
@@ -319,13 +319,13 @@ describe('plugin add and rm end-to-end --fetch', function 
() {
 
     it('Test 008 : should remove dependency when removing parent plugin', 
function(done) {
 
-        cordova.raw.create('hello3')
+        cordova.create('hello3')
         .then(function() {
             process.chdir(project);
-            return cordova.raw.platform('add', 'browser', {'fetch': true});
+            return cordova.platform('add', 'browser', {'fetch': true});
         })
         .then(function() {
-            return cordova.raw.plugin('add', 'cordova-plugin-media', {'fetch': 
true});
+            return cordova.plugin('add', 'cordova-plugin-media', {'fetch': 
true});
         })
         .then(function() {
             expect(path.join(pluginsDir, 'cordova-plugin-media')).toExist();
@@ -334,12 +334,12 @@ describe('plugin add and rm end-to-end --fetch', function 
() {
             expect(path.join(project, 'node_modules', 
'cordova-plugin-media')).toExist();
             expect(path.join(project, 'node_modules', 
'cordova-plugin-file')).toExist();
             expect(path.join(project, 'node_modules', 
'cordova-plugin-compat')).toExist();
-            return cordova.raw.platform('add', 'android', {'fetch':true});
+            return cordova.platform('add', 'android', {'fetch':true});
         })
         .then(function() {
             expect(path.join(pluginsDir, 'cordova-plugin-media')).toExist();
             expect(path.join(pluginsDir, 'cordova-plugin-file')).toExist();
-            return cordova.raw.plugin('rm', 'cordova-plugin-media', 
{'fetch':true});
+            return cordova.plugin('rm', 'cordova-plugin-media', 
{'fetch':true});
         })
         .then(function() {
             expect(path.join(pluginsDir, 
'cordova-plugin-media')).not.toExist();
@@ -376,18 +376,18 @@ describe('non-core platform add and rm end-to-end 
--fetch', function () {
 
     it('Test 009 : should add and remove 3rd party platforms', function(done) {
         var installed;
-        cordova.raw.create('hello')
+        cordova.create('hello')
         .then(function() {
             process.chdir(project);
             //add cordova-android instead of android
-            return cordova.raw.platform('add', 'cordova-android', {'fetch': 
true});
+            return cordova.platform('add', 'cordova-android', {'fetch': true});
         }).then(function() {
             //3rd party platform from npm
-            return cordova.raw.platform('add', 'cordova-platform-test', 
{'fetch': true});
+            return cordova.platform('add', 'cordova-platform-test', {'fetch': 
true});
         }).then(function() {
             expect(path.join(project, 'platforms', 'android')).toExist();
             expect(path.join(project, 'platforms', 
'cordova-platform-test')).toExist();
-            return cordova.raw.platform('ls');
+            return cordova.platform('ls');
         })
         .then(function() {
             //use regex to grab installed platforms

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/ca7a068e/spec-cordova/platform1.spec.js
----------------------------------------------------------------------
diff --git a/spec-cordova/platform1.spec.js b/spec-cordova/platform1.spec.js
index c47aca1..134147d 100644
--- a/spec-cordova/platform1.spec.js
+++ b/spec-cordova/platform1.spec.js
@@ -5,7 +5,7 @@ var path = require('path'),
     platform = rewire('../src/cordova/platform'),
     cordova_util = require('../src/cordova/util'),
     prepare = require('../src/cordova/prepare'),
-    cordova = require('../src/cordova/cordova').raw,
+    cordova = require('../src/cordova/cordova'),
     platformMetadata = require('../src/cordova/platform_metadata'),
     platforms = require('../src/platforms/platforms'),
     lazy_load = require('../src/cordova/lazy_load'),


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org
For additional commands, e-mail: commits-h...@cordova.apache.org

Reply via email to