diff --git a/hooks/after_build/000-build_64_bit.js b/hooks/after_build/000-build_64_bit.js index 4083ecc..cb9eec0 100644 --- a/hooks/after_build/000-build_64_bit.js +++ b/hooks/after_build/000-build_64_bit.js @@ -3,7 +3,7 @@ module.exports = function(context) { /** @external */ - var deferral = context.requireCordovaModule('q').defer(), + var deferral = require('q').defer(), UpdateConfig = require('./../update_config.js'), updateConfig = new UpdateConfig(context); diff --git a/hooks/after_plugin_install/000-shared_mode_special.js b/hooks/after_plugin_install/000-shared_mode_special.js index d0a33ca..83d6196 100644 --- a/hooks/after_plugin_install/000-shared_mode_special.js +++ b/hooks/after_plugin_install/000-shared_mode_special.js @@ -3,7 +3,7 @@ module.exports = function(context) { /** @external */ - var deferral = context.requireCordovaModule('q').defer(), + var deferral = require('q').defer(), UpdateConfig = require('./../update_config.js'), updateConfig = new UpdateConfig(context); diff --git a/hooks/before_build/000-build_64_bit.js b/hooks/before_build/000-build_64_bit.js index 7c6fef7..82979f5 100644 --- a/hooks/before_build/000-build_64_bit.js +++ b/hooks/before_build/000-build_64_bit.js @@ -3,7 +3,7 @@ module.exports = function(context) { /** @external */ - var deferral = context.requireCordovaModule('q').defer(), + var deferral = require('q').defer(), UpdateConfig = require('./../update_config.js'), updateConfig = new UpdateConfig(context); diff --git a/hooks/before_plugin_uninstall/000-shared_mode_special.js b/hooks/before_plugin_uninstall/000-shared_mode_special.js index 19909b8..407d748 100644 --- a/hooks/before_plugin_uninstall/000-shared_mode_special.js +++ b/hooks/before_plugin_uninstall/000-shared_mode_special.js @@ -3,7 +3,7 @@ module.exports = function(context) { /** @external */ - var deferral = context.requireCordovaModule('q').defer(), + var deferral = require('q').defer(), UpdateConfig = require('./../update_config.js'), updateConfig = new UpdateConfig(context); diff --git a/hooks/update_config.js b/hooks/update_config.js index 1f70dcc..77d7849 100644 --- a/hooks/update_config.js +++ b/hooks/update_config.js @@ -5,24 +5,24 @@ module.exports = function(context) { var ConfigParser, XmlHelpers; try { // cordova-lib >= 5.3.4 doesn't contain ConfigParser and xml-helpers anymore - ConfigParser = context.requireCordovaModule("cordova-common").ConfigParser; - XmlHelpers = context.requireCordovaModule("cordova-common").xmlHelpers; + ConfigParser = require("cordova-common").ConfigParser; + XmlHelpers = require("cordova-common").xmlHelpers; } catch (e) { - ConfigParser = context.requireCordovaModule("cordova-lib/src/configparser/ConfigParser"); - XmlHelpers = context.requireCordovaModule("cordova-lib/src/util/xml-helpers"); + ConfigParser = require("cordova-lib/src/configparser/ConfigParser"); + XmlHelpers = require("cordova-lib/src/util/xml-helpers"); } /** @external */ - var fs = context.requireCordovaModule('fs'), - path = context.requireCordovaModule('path'), - et = context.requireCordovaModule('elementtree'); + var fs = require('fs'), + path = require('path'), + et = require('elementtree'); /** @defaults */ var xwalkVariables = {}, argumentsString = context.cmdLine, pluginConfigurationFile = path.join(context.opts.plugin.dir, 'plugin.xml'), androidPlatformDir = path.join(context.opts.projectRoot, - 'platforms', 'android'), + 'platforms', 'android'), projectConfigurationFile = path.join(context.opts.projectRoot, 'config.xml'), platformConfigurationFile,