Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

refractor require #254

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hooks/after_build/000-build_64_bit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion hooks/after_plugin_install/000-shared_mode_special.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion hooks/before_build/000-build_64_bit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion hooks/before_plugin_uninstall/000-shared_mode_special.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
16 changes: 8 additions & 8 deletions hooks/update_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down