Repository: cordova-lib Updated Branches: refs/heads/master ab4997356 -> 153092f2c
CB-7091: Remove check_requirements() funcs from platform parsers No longer used, removing. They were either: 1) Empty 2) Duplicating the chqck_reqs call that is also done by platform create scripts 3) In Ubuntu duplicated the code from check_reqs Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/153092f2 Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/153092f2 Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/153092f2 Branch: refs/heads/master Commit: 153092f2c235185c7f141979a550779800954a92 Parents: ab49973 Author: Mark Koudritsky <[email protected]> Authored: Tue Jul 8 11:18:46 2014 -0400 Committer: Mark Koudritsky <[email protected]> Committed: Tue Jul 8 11:18:46 2014 -0400 ---------------------------------------------------------------------- .../metadata/windows8_parser.spec.js | 27 -------------------- .../spec-cordova/metadata/wp8_parser.spec.js | 25 ------------------ .../cordova/metadata/amazon_fireos_parser.js | 6 ----- .../src/cordova/metadata/android_parser.js | 6 ----- .../src/cordova/metadata/firefoxos_parser.js | 4 --- cordova-lib/src/cordova/metadata/ios_parser.js | 6 ----- .../src/cordova/metadata/ubuntu_parser.js | 24 +---------------- .../src/cordova/metadata/windows_parser.js | 25 ------------------ cordova-lib/src/cordova/metadata/wp8_parser.js | 24 ----------------- 9 files changed, 1 insertion(+), 146 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/153092f2/cordova-lib/spec-cordova/metadata/windows8_parser.spec.js ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-cordova/metadata/windows8_parser.spec.js b/cordova-lib/spec-cordova/metadata/windows8_parser.spec.js index 389e9e5..b4b804f 100644 --- a/cordova-lib/spec-cordova/metadata/windows8_parser.spec.js +++ b/cordova-lib/spec-cordova/metadata/windows8_parser.spec.js @@ -90,33 +90,6 @@ describe('windows8 project parser', function() { }); }); - describe('check_requirements', function() { - it('should fire a callback if there is an error during shelling out', function(done) { - exec.andCallFake(function(cmd, opts, cb) { - if (!cb) cb = opts; - cb(50, 'there was an errorz!', ''); - }); - errorWrapper(platforms.windows8.parser.check_requirements(proj), done, function(err) { - expect(err).toContain('there was an errorz!'); - }); - }); - it('should check by calling check_reqs on the stock lib path if no custom path is defined', function(done) { - wrapper(platforms.windows8.parser.check_requirements(proj), done, function() { - expect(exec.mostRecentCall.args[0]).toContain(util.libDirectory); - expect(exec.mostRecentCall.args[0]).toMatch(/check_reqs"$/); - }); - }); - it('should check by calling check_reqs on a custom path if it is so defined', function(done) { - var custom_path = path.join('some','custom','path','to','windows8','lib'); - custom.andReturn(custom_path); - wrapper(platforms.windows8.parser.check_requirements(proj),done, function() { - expect(exec.mostRecentCall.args[0]).toContain(custom_path); - expect(exec.mostRecentCall.args[0]).toMatch(/check_reqs"$/); - }); - done(); - }); - }); - describe('instance', function() { var parser, cp, rm, is_cordova, write, read, mv, mkdir; var windows8_proj = path.join(proj, 'platforms', 'windows8'); http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/153092f2/cordova-lib/spec-cordova/metadata/wp8_parser.spec.js ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-cordova/metadata/wp8_parser.spec.js b/cordova-lib/spec-cordova/metadata/wp8_parser.spec.js index 69336cb..bf05411 100644 --- a/cordova-lib/spec-cordova/metadata/wp8_parser.spec.js +++ b/cordova-lib/spec-cordova/metadata/wp8_parser.spec.js @@ -97,31 +97,6 @@ describe('wp8 project parser', function() { }); }); - describe('check_requirements', function() { - it('should fire a callback if there is an error during shelling out', function(done) { - exec.andCallFake(function(cmd, opts, cb) { - (cb || opts)(50, 'there was an errorz!'); - }); - errorWrapper(platforms.wp8.parser.check_requirements(proj), done, function(err) { - expect(err).toContain('there was an errorz!'); - }); - }); - it('should check by calling check_reqs on the stock lib path if no custom path is defined', function(done) { - wrapper(platforms.wp8.parser.check_requirements(proj), done, function() { - expect(exec.mostRecentCall.args[0]).toContain(util.libDirectory); - expect(exec.mostRecentCall.args[0]).toMatch(/check_reqs"$/); - }); - }); - it('should check by calling check_reqs on a custom path if it is so defined', function(done) { - var custom_path = path.join('some','custom','path','to','wp8','lib'); - custom.andReturn(custom_path); - wrapper(platforms.wp8.parser.check_requirements(proj), done, function(err) { - expect(exec.mostRecentCall.args[0]).toContain(custom_path); - expect(exec.mostRecentCall.args[0]).toMatch(/check_reqs"$/); - }); - }); - }); - describe('instance', function() { var p, cp, rm, is_cordova, write, read, mv, mkdir; var wp8_proj = path.join(proj, 'platforms', 'wp8'); http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/153092f2/cordova-lib/src/cordova/metadata/amazon_fireos_parser.js ---------------------------------------------------------------------- diff --git a/cordova-lib/src/cordova/metadata/amazon_fireos_parser.js b/cordova-lib/src/cordova/metadata/amazon_fireos_parser.js index b3c78bb..3b39605 100644 --- a/cordova-lib/src/cordova/metadata/amazon_fireos_parser.js +++ b/cordova-lib/src/cordova/metadata/amazon_fireos_parser.js @@ -42,12 +42,6 @@ module.exports = function android_parser(project) { this.android_config = path.join(this.path, 'res', 'xml', 'config.xml'); }; -// Returns a promise. -module.exports.check_requirements = function(project_root, lib_path) { - // Rely on platform's bin/create script to check requirements. - return Q(true); -}; - module.exports.prototype = { findOrientationPreference: function(config) { var ret = config.getPreference('orientation'); http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/153092f2/cordova-lib/src/cordova/metadata/android_parser.js ---------------------------------------------------------------------- diff --git a/cordova-lib/src/cordova/metadata/android_parser.js b/cordova-lib/src/cordova/metadata/android_parser.js index 5738e7b..7ad2a33 100644 --- a/cordova-lib/src/cordova/metadata/android_parser.js +++ b/cordova-lib/src/cordova/metadata/android_parser.js @@ -42,12 +42,6 @@ module.exports = function android_parser(project) { this.android_config = path.join(this.path, 'res', 'xml', 'config.xml'); }; -// Returns a promise. -module.exports.check_requirements = function(project_root, lib_path) { - // Rely on platform's bin/create script to check requirements. - return Q(true); -}; - module.exports.prototype = { findOrientationPreference: function(config) { var ret = config.getPreference('orientation'); http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/153092f2/cordova-lib/src/cordova/metadata/firefoxos_parser.js ---------------------------------------------------------------------- diff --git a/cordova-lib/src/cordova/metadata/firefoxos_parser.js b/cordova-lib/src/cordova/metadata/firefoxos_parser.js index b8c43ee..0ec5b6d 100644 --- a/cordova-lib/src/cordova/metadata/firefoxos_parser.js +++ b/cordova-lib/src/cordova/metadata/firefoxos_parser.js @@ -34,10 +34,6 @@ module.exports = function firefoxos_parser(project) { this.path = project; }; -// Returns a promise. -module.exports.check_requirements = function(project_root, lib_path) { - return Q(); // Requirements always met. -}; module.exports.prototype = { // Returns a promise. http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/153092f2/cordova-lib/src/cordova/metadata/ios_parser.js ---------------------------------------------------------------------- diff --git a/cordova-lib/src/cordova/metadata/ios_parser.js b/cordova-lib/src/cordova/metadata/ios_parser.js index 48308ee..fa136dc 100644 --- a/cordova-lib/src/cordova/metadata/ios_parser.js +++ b/cordova-lib/src/cordova/metadata/ios_parser.js @@ -52,12 +52,6 @@ module.exports = function ios_parser(project) { this.config_path = path.join(this.cordovaproj, 'config.xml'); }; -// Returns a promise. -module.exports.check_requirements = function(project_root, lib_path) { - // Rely on platform's bin/create script to check requirements. - return Q(true); -}; - module.exports.prototype = { // Returns a promise. update_from_config:function(config) { http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/153092f2/cordova-lib/src/cordova/metadata/ubuntu_parser.js ---------------------------------------------------------------------- diff --git a/cordova-lib/src/cordova/metadata/ubuntu_parser.js b/cordova-lib/src/cordova/metadata/ubuntu_parser.js index df8a65d..634a575 100644 --- a/cordova-lib/src/cordova/metadata/ubuntu_parser.js +++ b/cordova-lib/src/cordova/metadata/ubuntu_parser.js @@ -25,12 +25,10 @@ var fs = require('fs'), path = require('path'), util = require('../util'), - events = require('../../events'), shell = require('shelljs'), Q = require('q'), os = require('os'), - ConfigParser = require('../../configparser/ConfigParser'), - CordovaError = require('../../CordovaError'); + ConfigParser = require('../../configparser/ConfigParser'); module.exports = function(project) { this.path = project; @@ -42,26 +40,6 @@ function sanitize(str) { return str.replace(/\n/g, ' ').replace(/^\s+|\s+$/g, ''); } -// Returns a promise. -module.exports.check_requirements = function(project_root, lib_path) { - // jshint quotmark:false - var d = Q.defer(); - - events.emit('log', 'Checking ubuntu requirements...'); - var command = "dpkg-query -Wf'${db:Status-abbrev}' cmake debhelper libx11-dev libicu-dev pkg-config qtbase5-dev qtchooser qtdeclarative5-dev qtfeedback5-dev qtlocation5-dev qtmultimedia5-dev qtpim5-dev qtsensors5-dev qtsystems5-dev 2>/dev/null | grep -q '^i'"; - events.emit('log', 'Running "' + command + '" (output to follow)'); - shell.exec(command, {silent:true, async:true}, function(code, output) { - events.emit('log', output); - if (code !== 0) { - d.reject(new CordovaError('Make sure you have the following packages installed: ' + output)); - } else { - d.resolve(); - } - }); - - return d.promise; -}; - module.exports.prototype = { // Returns a promise. update_from_config:function(config) { http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/153092f2/cordova-lib/src/cordova/metadata/windows_parser.js ---------------------------------------------------------------------- diff --git a/cordova-lib/src/cordova/metadata/windows_parser.js b/cordova-lib/src/cordova/metadata/windows_parser.js index 5233167..39fd4fd 100644 --- a/cordova-lib/src/cordova/metadata/windows_parser.js +++ b/cordova-lib/src/cordova/metadata/windows_parser.js @@ -27,11 +27,9 @@ var fs = require('fs'), events = require('../../events'), shell = require('shelljs'), Q = require('q'), - child_process = require('child_process'), ConfigParser = require('../../configparser/ConfigParser'), CordovaError = require('../../CordovaError'), xml = require('../../util/xml-helpers'), - lazy_load = require('../lazy_load'), hooker = require('../hooker'), jsproj = require('../../util/windows/jsproj'); @@ -59,29 +57,6 @@ module.exports = function windows_parser(project) { } }; -// Returns a promise -module.exports.check_requirements = function(project_root, lib_path) { - if (lib_path === undefined) { - return lazy_load.based_on_config(project_root, 'windows8').then(function (lib_path) { - return module.exports.check_requirements(project_root, lib_path); - }); - } - events.emit('log', 'Checking windows8 requirements...'); - var command = '"' + path.join(lib_path, 'bin', 'check_reqs') + '"'; - events.emit('verbose', 'Running "' + command + '" (output to follow)'); - var d = Q.defer(); - - child_process.exec(command, function(err, output, stderr) { - events.emit('verbose', output); - if (err) { - d.reject(new CordovaError('Requirements check failed: ' + output + stderr)); - } else { - d.resolve(); - } - }); - return d.promise; -}; - module.exports.prototype = { update_from_config:function(config) { http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/153092f2/cordova-lib/src/cordova/metadata/wp8_parser.js ---------------------------------------------------------------------- diff --git a/cordova-lib/src/cordova/metadata/wp8_parser.js b/cordova-lib/src/cordova/metadata/wp8_parser.js index f305209..6c5373e 100644 --- a/cordova-lib/src/cordova/metadata/wp8_parser.js +++ b/cordova-lib/src/cordova/metadata/wp8_parser.js @@ -26,12 +26,10 @@ var fs = require('fs'), util = require('../util'), events = require('../../events'), shell = require('shelljs'), - child_process = require('child_process'), Q = require('q'), ConfigParser = require('../../configparser/ConfigParser'), CordovaError = require('../../CordovaError'), xml = require('../../util/xml-helpers'), - lazy_load = require('../lazy_load'), hooker = require('../hooker'), csproj = require('../../util/windows/csproj'); @@ -49,28 +47,6 @@ module.exports = function wp8_parser(project) { this.manifest_path = path.join(this.wp8_proj_dir, 'Properties', 'WMAppManifest.xml'); }; -// Returns a promise. -module.exports.check_requirements = function(project_root, lib_path) { - if (lib_path === undefined) { - return lazy_load.based_on_config(project_root, 'wp8').then(function (lib_path) { - return module.exports.check_requirements(project_root, lib_path); - }); - } - events.emit('log', 'Checking wp8 requirements...'); - var command = '"' + path.join(lib_path, 'bin', 'check_reqs') + '"'; - events.emit('verbose', 'Running "' + command + '" (output to follow)'); - var d = Q.defer(); - child_process.exec(command, function(err, output, stderr) { - events.emit('verbose', output); - if (err) { - d.reject(new CordovaError('Requirements check failed: ' + output + stderr)); - } else { - d.resolve(); - } - }); - return d.promise; -}; - module.exports.prototype = { update_from_config:function(config) { //check config parser
