Skip to content
This repository has been archived by the owner on Jan 14, 2022. It is now read-only.

Fix for newer Android version #112

Open
wants to merge 6 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
6 changes: 3 additions & 3 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
<asset src="www/hostedapp-bridge.js" target="hostedapp-bridge.js" />

<engines>
<engine name="cordova-windows" version="<=4.3.9" />
<engine name="cordova-ios" version="<=4.1.9" />
<engine name="cordova-android" version="<=5.1.9" />
<engine name="cordova-windows" version="<=9.0.0" />
<engine name="cordova-ios" version="<=9.0.0" />
<engine name="cordova-android" version="<=9.0.0" />
</engines>

<!-- android -->
Expand Down
10 changes: 8 additions & 2 deletions scripts/replaceWindowsWrapperFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,16 @@ module.exports = function (context) {
return;
}

etree = context.requireCordovaModule('cordova-lib/node_modules/elementtree');
etree = require('elementtree');

// move contents of the assets folder to the windows platform dir
var Q = context.requireCordovaModule('q');
try{
Q = require('q');
}catch(e){
e.message = 'Unable to load node module dependency \'q\': '+e.message;
log(e.message);
throw e;
}

var filename = "wrapper";

Expand Down
14 changes: 10 additions & 4 deletions scripts/rollbackWindowsWrapperFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ function configureParser(context) {
var cordova_util = context.requireCordovaModule('cordova-lib/src/cordova/util');
var ConfigParser;
try {
ConfigParser = context.requireCordovaModule('cordova-lib/node_modules/cordova-common').ConfigParser;
ConfigParser = require('cordova-common').ConfigParser;
} catch (err) {
// Fallback to old location of config parser (old versions of cordova-lib)
ConfigParser = context.requireCordovaModule('cordova-lib/src/configparser/ConfigParser');
ConfigParser = require('cordova-common/src/ConfigParser');
}

etree = context.requireCordovaModule('cordova-lib/node_modules/elementtree');
etree = require('elementtree');

var xml = cordova_util.projectConfig(context.opts.projectRoot);
config = createConfigParser(xml, etree, ConfigParser);
Expand All @@ -70,7 +70,13 @@ module.exports = function (context) {
return;
}

Q = context.requireCordovaModule('q');
try{
Q = require('q');
}catch(e){
e.message = 'Unable to load node module dependency \'q\': '+e.message;
log(e.message);
throw e;
}
var task = Q.defer();

var destPath = path.join(projectRoot, "platforms", "windows", "www", "wrapper.html");
Expand Down
8 changes: 4 additions & 4 deletions scripts/test/updateConfigurationBeforePrepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ function initializeContext(testDir) {
return require('cordova-lib/node_modules/cordova-common');
}

if (moduleName === 'cordova-lib/src/configparser/ConfigParser') {
return require('cordova-lib/src/configparser/ConfigParser');
if (moduleName === 'node_modules/cordova-common/src/ConfigParser') {
return require('node_modules/cordova-common/src/ConfigParser');
}

if (moduleName === 'cordova-lib/node_modules/elementtree') {
return require('cordova-lib/node_modules/elementtree');
if (moduleName === 'elementtree') {
return require('elementtree');
}

if (requireCordovaModule) {
Expand Down
6 changes: 3 additions & 3 deletions scripts/updateConfigurationAfterPrepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ function configureParser(context) {
var cordova_util = context.requireCordovaModule('cordova-lib/src/cordova/util');
var ConfigParser;
try {
ConfigParser = context.requireCordovaModule('cordova-lib/node_modules/cordova-common').ConfigParser;
ConfigParser = require('cordova-common').ConfigParser;
} catch (err) {
// Fallback to old location of config parser (old versions of cordova-lib)
ConfigParser = context.requireCordovaModule('cordova-lib/src/configparser/ConfigParser');
ConfigParser = require('cordova-common/src/ConfigParser');
}

etree = context.requireCordovaModule('cordova-lib/node_modules/elementtree');
etree = require('elementtree');

var xml = cordova_util.projectConfig(projectRoot);
config = createConfigParser(xml, etree, ConfigParser);
Expand Down
14 changes: 10 additions & 4 deletions scripts/updateConfigurationBeforePrepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ function configureParser(context) {
var cordova_util = context.requireCordovaModule('cordova-lib/src/cordova/util');
var ConfigParser;
try {
ConfigParser = context.requireCordovaModule('cordova-lib/node_modules/cordova-common').ConfigParser;
ConfigParser = require('cordova-common').ConfigParser;
} catch (err) {
// Fallback to old location of config parser (old versions of cordova-lib)
ConfigParser = context.requireCordovaModule('cordova-lib/src/configparser/ConfigParser');
ConfigParser = require('cordova-common/src/ConfigParser');
}

etree = context.requireCordovaModule('cordova-lib/node_modules/elementtree');
etree = require('elementtree');

var xml = cordova_util.projectConfig(projectRoot);
config = createConfigParser(xml, etree, ConfigParser);
Expand Down Expand Up @@ -572,7 +572,13 @@ function processWindowsPhoneIcons(manifestIcons, manifestSplashScreens) {
module.exports = function (context) {
logger.log('Updating Cordova configuration from W3C manifest...');

Q = context.requireCordovaModule('q');
try{
Q = require('q');
}catch(e){
e.message = 'Unable to load node module dependency \'q\': '+e.message;
log(e.message);
throw e;
}

// Get base path for default icons
defaultIconsBaseDir = 'plugins/' + context.opts.plugin.id + '/assets/defaultImages';
Expand Down