Merge branch 'patch-1' of https://github.com/filfat/cordova-windows
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..91582f4
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,22 @@
+<!--
+Please make sure the checklist boxes are all checked before submitting the PR. The checklist
+is intended as a quick reference, for complete details please see our Contributor Guidelines:
+
+http://cordova.apache.org/contribute/contribute_guidelines.html
+
+Thanks!
+-->
+
+### Platforms affected
+
+
+### What does this PR do?
+
+
+### What testing has been done on this change?
+
+
+### Checklist
+- [ ] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
+- [ ] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
+- [ ] Added automated test coverage as appropriate for this change.
diff --git a/.gitignore b/.gitignore
index 337812c..198f042 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,8 +13,77 @@
node_modules/.bin
node_modules/istanbul/
node_modules/jasmine-node/
+node_modules/jasmine/
+node_modules/jasmine-core/
node_modules/jshint/
node_modules/rewire/
+node_modules/align-text/
+node_modules/amdefine/
+node_modules/argparse/
+node_modules/async/
+node_modules/camelcase/
+node_modules/center-align/
+node_modules/cli/
+node_modules/cliui/
+node_modules/coffee-script/
+node_modules/console-browserify/
+node_modules/core-util-is/
+node_modules/date-now/
+node_modules/decamelize/
+node_modules/deep-is/
+node_modules/dom-serializer/
+node_modules/domelementtype/
+node_modules/domhandler/
+node_modules/domutils/
+node_modules/entities/
+node_modules/escodegen/
+node_modules/esprima/
+node_modules/estraverse/
+node_modules/esutils/
+node_modules/exit/
+node_modules/fast-levenshtein/
+node_modules/fileset/
+node_modules/fs.realpath/
+node_modules/gaze/
+node_modules/growl/
+node_modules/handlebars/
+node_modules/has-flag/
+node_modules/htmlparser2/
+node_modules/is-buffer/
+node_modules/isarray/
+node_modules/isexe/
+node_modules/jasmine-growl-reporter/
+node_modules/jasmine-reporters/
+node_modules/js-yaml/
+node_modules/kind-of/
+node_modules/lazy-cache/
+node_modules/levn/
+node_modules/longest/
+node_modules/lru-cache/
+node_modules/minimist/
+node_modules/mkdirp/
+node_modules/optimist/
+node_modules/optionator/
+node_modules/prelude-ls/
+node_modules/readable-stream/
+node_modules/repeat-string/
+node_modules/requirejs/
+node_modules/resolve/
+node_modules/right-align/
+node_modules/sigmund/
+node_modules/source-map/
+node_modules/sprintf-js/
+node_modules/string_decoder/
+node_modules/strip-json-comments/
+node_modules/supports-color/
+node_modules/type-check/
+node_modules/uglify-js/
+node_modules/uglify-to-browserify/
+node_modules/walkdir/
+node_modules/which/
+node_modules/window-size/
+node_modules/wordwrap/
+node_modules/yargs/
npm-debug.log
diff --git a/.travis.yml b/.travis.yml
index 89d3468..dcbeeda 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,12 @@
language: node_js
sudo: false
+git:
+ depth: 10
+node_js:
+ - "0.10"
+ - "0.12"
+ - "4"
+ - "6"
install:
- npm install
- npm install -g codecov
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 7f39cdd..78b1fc4 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -24,6 +24,52 @@
cordova-windows is a library that enables developers to create Windows 8/8.1/10 and WP8.1 application projects that support Cordova APIs.
+### 5.0.0 (Jan 27, 2017)
+* [CB-12415](https://issues.apache.org/jira/browse/CB-12415) Windows build fails if start page is missing
+* [CB-12416](https://issues.apache.org/jira/browse/CB-12416) (Windows) Built bundles are misplaced when building for multiple archs
+* [CB-12298](https://issues.apache.org/jira/browse/CB-12298) [Windows] bundle.appxupload not generated for Windows 10 target Generate appxupload for non-bundle builds as well This closes #227
+* Remove duplicate logic after upgrading cordova-common
+* [CB-12163](https://issues.apache.org/jira/browse/CB-12163) Add resource-file reference functionality through a flag
+* [CB-12163](https://issues.apache.org/jira/browse/CB-12163) Make resource-file copy files again
+* Upgrade cordova-common to 2.0.0
+* [CB-12298](https://issues.apache.org/jira/browse/CB-12298) [Windows] bundle.appxupload not generated for Windows 10 target
+* [CB-12189](https://issues.apache.org/jira/browse/CB-12189) Add support for WinMD and DLL combination
+* [CB-12238](https://issues.apache.org/jira/browse/CB-12238) [Windows] Colorize titlebar to match splash bg color
+* [CB-11177](https://issues.apache.org/jira/browse/CB-11177) SplashScreen gets shifted on Windows devices with soft navbar
+* [CB-12239](https://issues.apache.org/jira/browse/CB-12239) Add buildFlag option similar to iOS
+* [CB-12193](https://issues.apache.org/jira/browse/CB-12193) cordova.js crashes windows app if there is no CoreWindow Also made confighelper to load after WinJS as it depends on it
+* [CB-11751](https://issues.apache.org/jira/browse/CB-11751) 'extendedSplashScreen' is undefined
+* [CB-12192](https://issues.apache.org/jira/browse/CB-12192) - No SplashScreen on Windows when content.src is subpage
+* [CB-9287](https://issues.apache.org/jira/browse/CB-9287) Not enough Icons and Splashscreens for Windows 8.1 and Windows Phone 8.1
+* Do not ignore already prefixed capabilities at plugin add/rm
+* Fix pattern for extracting capabilities names
+* [CB-12142](https://issues.apache.org/jira/browse/CB-12142) Move windows-specific logic from cordova-common
+* [CB-12147](https://issues.apache.org/jira/browse/CB-12147) (windows) Fix typo in verbose output
+* [CB-12124](https://issues.apache.org/jira/browse/CB-12124) Make available device capabilities in package.windows10.appxmanifest
+* [CB-12071](https://issues.apache.org/jira/browse/CB-12071) Fix for [CB-11825](https://issues.apache.org/jira/browse/CB-11825) breaks usage of InProcessServer in Cordova Windows
+* [CB-12036](https://issues.apache.org/jira/browse/CB-12036) Fix setSplashBgColor exception when no splashscreen is found
+
+### 4.4.3 (Oct 19, 2016)
+* [CB-12044](https://issues.apache.org/jira/browse/CB-12044) Fix splashscreen image path for ms-appx on Windows
+* [CB-12042](https://issues.apache.org/jira/browse/CB-12042) Copy base.js to www directory at create
+* [CB-11933](https://issues.apache.org/jira/browse/CB-11933) Add uap prefixes for capabilities at plugin install
+* [CB-12003](https://issues.apache.org/jira/browse/CB-12003) updated node_modules
+* [CB-11933](https://issues.apache.org/jira/browse/CB-11933) Remove capabilities from manifest
+* [CB-11993](https://issues.apache.org/jira/browse/CB-11993) - windows platform doesn't test all node versions on appveyor and travis
+* [CB-11825](https://issues.apache.org/jira/browse/CB-11825) Windows dll file won't be copied as resource while adding custom plugin to a UWP project
+* output message, catch exception if require fails, change eventEmitter to events to be consistent with ios+android
+* [CB-11922](https://issues.apache.org/jira/browse/CB-11922) - Add github pull request template
+* [CB-11522](https://issues.apache.org/jira/browse/CB-11522) [windows] Make cordova-js handle 'unknown' type
+* [CB-11857](https://issues.apache.org/jira/browse/CB-11857) Fixed VS 2015 detection on Windows 10 Anniversary
+* [CB-10738](https://issues.apache.org/jira/browse/CB-10738) Use hardcoded Id attribute in Win10 manifest
+* Add missing license headers to prebuild scripts
+* Update bundled cordova-common dependency to 1.4.1
+* [CB-11658](https://issues.apache.org/jira/browse/CB-11658) activated event is not fired on Windows 10 RS1
+* [CB-11657](https://issues.apache.org/jira/browse/CB-11657) Add bom to www after plugin operations
+* [CB-11478](https://issues.apache.org/jira/browse/CB-11478) Parse --archs option consistently
+* [CB-11558](https://issues.apache.org/jira/browse/CB-11558) Make windows plugin rm remove ProjectReference items
+* [CB-11579](https://issues.apache.org/jira/browse/CB-11579) windows: fix bug with 'cordova clean windows'
+
### 4.4.2 (Jul 25, 2016)
* [CB-11548](https://issues.apache.org/jira/browse/CB-11548) Fix issues where MSBuild cannot be found
* [CB-11241](https://issues.apache.org/jira/browse/CB-11241) Return adding BOM to www back to prepare
diff --git a/VERSION b/VERSION
index 63bdbfa..f8ee15f 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.5.0-dev
+5.1.0-dev
diff --git a/appveyor.yml b/appveyor.yml
index 808c28a..b8d1fea 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -19,7 +19,15 @@
# appveyor file
# http://www.appveyor.com/docs/appveyor-yml
+environment:
+ matrix:
+ - nodejs_version: "0.10"
+ - nodejs_version: "0.12"
+ - nodejs_version: "4"
+ - nodejs_version: "6"
+
install:
+ - ps: Install-Product node $env:nodejs_version
- npm install
build: off
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index 9e31fda..dd41b81 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -150,7 +150,7 @@
.fail(function () {
// if we got any errors on previous steps, we're assuming that
// required VS update is not installed.
- installedVersions.splice(installedVersions.indexOf('12.0'));
+ installedVersions.splice(installedVersions.indexOf('12.0'), 1);
return installedVersions;
});
});
@@ -346,7 +346,7 @@
/** Checks if Windows SDK required to build the target_platform is present
* @param {String} target_platorm Target platform ('8.1' or '10.0')
- */
+ */
module.exports.isWinSDKPresent = function (target_platform) {
return checkWinSdk(target_platform, '8.1');
};
@@ -421,9 +421,9 @@
if (requirement.isFatal) fatalIsHit = true;
requirement.metadata.reason = err;
result.push(requirement);
- });
+ });
});
-
+
});
}, Q())
.then(function () {
diff --git a/bin/lib/create.js b/bin/lib/create.js
index eb6bb7d..08c5156 100644
--- a/bin/lib/create.js
+++ b/bin/lib/create.js
@@ -92,6 +92,10 @@
recursiveCreateDirectory(destinationDirectory);
shell.cp('-f', srcBaseJsPath, destBaseJsPath);
+ // CB-12042 Also copy base.js to www directory
+ shell.mkdir('-p', path.join(projectPath, 'www/WinJS/js'));
+ shell.cp('-f', srcBaseJsPath, path.join(projectPath, 'www/WinJS/js/base.js'));
+
// replace specific values in manifests' templates
events.emit('verbose', 'Updating manifest files with project configuration.');
[ 'package.windows.appxmanifest', 'package.phone.appxmanifest',
diff --git a/cordova-js-src/confighelper.js b/cordova-js-src/confighelper.js
index 47971d3..c166052 100644
--- a/cordova-js-src/confighelper.js
+++ b/cordova-js-src/confighelper.js
@@ -19,26 +19,47 @@
*
*/
-// config.xml wrapper (non-node ConfigParser analogue)
-var config;
-function Config(xhr) {
- function loadPreferences(xhr) {
- var parser = new DOMParser();
- var doc = parser.parseFromString(xhr.responseText, "application/xml");
+// config.xml and AppxManifest.xml wrapper (non-node ConfigParser analogue)
+var configCache = {};
+var utils = require("cordova/utils");
- var preferences = doc.getElementsByTagName("preference");
- return Array.prototype.slice.call(preferences);
- }
+var isPhone = (cordova.platformId == 'windows') && WinJS.Utilities.isPhone;
+var isWin10UWP = navigator.appVersion.indexOf('MSAppHost/3.0') !== -1;
+var splashScreenTagName = isWin10UWP ? "SplashScreen" : (isPhone ? "m3:SplashScreen" : "m2:SplashScreen");
- this.xhr = xhr;
- this.preferences = loadPreferences(this.xhr);
+function XmlFile(text) {
+ this.text = text;
}
-function readConfig(success, error) {
+XmlFile.prototype.loadTags = function (tagName) {
+ var parser;
+ if (!this.doc) {
+ parser = new DOMParser();
+ this.doc = parser.parseFromString(this.text, "application/xml");
+ }
+
+ var tags = this.doc.getElementsByTagName(tagName);
+ return Array.prototype.slice.call(tags);
+}
+
+function Config(text) {
+ XmlFile.apply(this, arguments);
+ this.preferences = this.loadTags("preference");
+}
+
+function Manifest(text) {
+ XmlFile.apply(this, arguments);
+ this.splashScreen = this.loadTags(splashScreenTagName)[0];
+}
+
+utils.extend(Config, XmlFile);
+utils.extend(Manifest, XmlFile);
+
+function requestFile(filePath, success, error) {
var xhr;
- if (typeof config != 'undefined') {
- success(config);
+ if (typeof configCache[filePath] != 'undefined') {
+ success(configCache[filePath]);
}
function fail(msg) {
@@ -52,11 +73,11 @@
var xhrStatusChangeHandler = function () {
if (xhr.readyState == 4) {
if (xhr.status == 200 || xhr.status == 304 || xhr.status == 0 /* file:// */) {
- config = new Config(xhr);
- success(config);
+ configCache[filePath] = xhr.responseText;
+ success(xhr.responseText);
}
else {
- fail('[Windows][cordova.js][xhrStatusChangeHandler] Could not XHR config.xml: ' + xhr.statusText);
+ fail('[Windows][cordova.js][xhrStatusChangeHandler] Could not XHR ' + filePath + ': ' + xhr.statusText);
}
}
};
@@ -65,18 +86,30 @@
xhr.addEventListener("load", xhrStatusChangeHandler);
try {
- xhr.open("get", "/config.xml", true);
+ xhr.open("get", filePath, true);
xhr.send();
} catch (e) {
- fail('[Windows][cordova.js][readConfig] Could not XHR config.xml: ' + JSON.stringify(e));
+ fail('[Windows][cordova.js][xhrFile] Could not XHR ' + filePath + ': ' + JSON.stringify(e));
}
}
+function readConfig(success, error) {
+ requestFile("/config.xml", function (contents) {
+ success(new Config(contents));
+ }, error);
+}
+
+function readManifest(success, error) {
+ requestFile("/AppxManifest.xml", function (contents) {
+ success(new Manifest(contents));
+ }, error);
+}
+
/**
* Reads a preference value from config.xml.
* Returns preference value or undefined if it does not exist.
* @param {String} preferenceName Preference name to read */
-Config.prototype.getPreferenceValue = function getPreferenceValue(preferenceName) {
+Config.prototype.getPreferenceValue = function (preferenceName) {
var preferenceItem = this.preferences && this.preferences.filter(function (item) {
return item.attributes['name'].value === preferenceName;
});
@@ -86,4 +119,12 @@
}
}
+/**
+ * Reads SplashScreen image path
+ */
+Manifest.prototype.getSplashScreenImagePath = function () {
+ return this.splashScreen.attributes['Image'].value;
+}
+
exports.readConfig = readConfig;
+exports.readManifest = readManifest;
diff --git a/cordova-js-src/platform.js b/cordova-js-src/platform.js
index 1f9ddbd..4bc4025 100644
--- a/cordova-js-src/platform.js
+++ b/cordova-js-src/platform.js
@@ -27,7 +27,6 @@
channel = cordova.require('cordova/channel'),
platform = require('cordova/platform'),
modulemapper = require('cordova/modulemapper'),
- configHelper = require('cordova/confighelper'),
utils = require('cordova/utils');
modulemapper.clobbers('cordova/exec/proxy', 'cordova.commandProxy');
@@ -41,7 +40,8 @@
var onWinJSReady = function () {
var app = WinJS.Application,
- splashscreen = require('cordova/splashscreen');
+ splashscreen = require('cordova/splashscreen'),
+ configHelper = require('cordova/confighelper');
modulemapper.clobbers('cordova/splashscreen', 'navigator.splashscreen');
@@ -78,8 +78,14 @@
return;
}
- e.setPromise(makePromise(configHelper.readConfig).then(function (config) {
- splashscreen.firstShow(config, e);
+ var manifest;
+
+ e.setPromise(makePromise(configHelper.readManifest).then(function (manifestTmp) {
+ manifest = manifestTmp;
+ return makePromise(configHelper.readConfig);
+ })
+ .then(function (config) {
+ splashscreen.firstShow(config, manifest, e);
}).then(function () {
// Avoids splashimage flicker on Windows Phone 8.1/10
return WinJS.Promise.timeout();
@@ -88,13 +94,22 @@
}));
};
- app.addEventListener("checkpoint", checkpointHandler);
- app.addEventListener("activated", activationHandler, false);
- Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", resumingHandler, false);
+ // CB-12193 CoreWindow and some WinRT APIs are not available in webview
+ var isCoreWindowAvailable = false;
+ try {
+ Windows.UI.ViewManagement.ApplicationView.getForCurrentView();
+ isCoreWindowAvailable = true;
+ } catch (e) { }
- injectBackButtonHandler();
+ if (isCoreWindowAvailable) {
+ app.addEventListener("checkpoint", checkpointHandler);
+ app.addEventListener("activated", activationHandler, false);
+ Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", resumingHandler, false);
- app.start();
+ injectBackButtonHandler();
+
+ app.start();
+ }
};
function appendScript(scriptElem, loadedCb) {
diff --git a/cordova-js-src/splashscreen.js b/cordova-js-src/splashscreen.js
index 0d1be69..6fe918b 100644
--- a/cordova-js-src/splashscreen.js
+++ b/cordova-js-src/splashscreen.js
@@ -1,4 +1,4 @@
-/*
+/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -19,15 +19,21 @@
*
*/
-var isPhone = (cordova.platformId == 'windows') && WinJS.Utilities.isPhone;
var isWp81 = navigator.appVersion.indexOf("Windows Phone 8.1") !== -1;
var isWp10 = navigator.appVersion.indexOf("Windows Phone 10") !== -1;
+var isPhoneDevice = isWp81 || isWp10;
var isWin10UWP = navigator.appVersion.indexOf('MSAppHost/3.0') !== -1;
var isHosted = window.location.protocol.indexOf('http') === 0;
-var splashImageSrc = ((isHosted || isWin10UWP) ? 'ms-appx-web' : 'ms-appx') + ':///images/'
- + (isPhone ? 'splashscreenphone.png' : 'splashscreen.png');
+var isMsAppxWeb = window.location.protocol.indexOf('ms-appx-web') === 0;
-var splashElement = null, extendedSplashImage = null, extendedSplashProgress = null;
+var schema = (isHosted || isWin10UWP && isMsAppxWeb) ? 'ms-appx-web' : 'ms-appx';
+var fileName = isWp81 ? 'splashscreenphone.png' : 'splashscreen.png';
+var splashImageSrc = schema + ':///images/' + fileName;
+
+var splashElement = null,
+ extendedSplashImage = null,
+ extendedSplashProgress = null,
+ extendedSplashImageHelper = null;
//// <Config and initialization>
var DEFAULT_SPLASHSCREEN_DURATION = 3000, // in milliseconds
@@ -37,6 +43,8 @@
PROGRESSRING_BOTTOM_MARGIN = 10; // needed for windows 10 min height window
var bgColor = "#464646",
+ titleInitialBgColor,
+ titleBgColor,
autoHideSplashScreen = true,
splashScreenDelay = DEFAULT_SPLASHSCREEN_DURATION,
fadeSplashScreen = true,
@@ -55,8 +63,11 @@
}
}
-function readPreferencesFromCfg(cfg) {
+function readPreferencesFromCfg(cfg, manifest) {
try {
+ // Update splashscreen image path to match application manifest
+ splashImageSrc = schema + ':///' + manifest.getSplashScreenImagePath().replace(/\\/g, '/');
+
bgColor = cfg.getPreferenceValue('SplashScreenBackgroundColor') || bgColor;
bgColor = bgColor.replace('0x', '#').replace('0X', '#');
if (bgColor.length > 7) {
@@ -64,6 +75,13 @@
bgColor = bgColor.slice(0, 1) + bgColor.slice(3, bgColor.length);
}
+ titleBgColor = {
+ a: 255,
+ r: parseInt(bgColor.slice(1, 3), 16),
+ g: parseInt(bgColor.slice(3, 5), 16),
+ b: parseInt(bgColor.slice(5, 7), 16)
+ };
+
autoHideSplashScreen = readBoolFromCfg('AutoHideSplashScreen', autoHideSplashScreen, cfg);
splashScreenDelay = cfg.getPreferenceValue('SplashScreenDelay') || splashScreenDelay;
@@ -84,23 +102,8 @@
return window.innerHeight > window.innerWidth;
}
-// Shift down the image to be vertical centered
-function centerY() {
- if (isPortrait()) {
- if (window.screen.deviceYDPI === 172) { // 720p 4.7"
- extendedSplashImage.style.transform = "translateY(22px)";
- } else if (window.screen.deviceYDPI === 230) { // 1080p 5.5"
- extendedSplashImage.style.transform = "translateY(25px)";
- } else if (window.screen.deviceYDPI === 211) { // 1080p 6"
- extendedSplashImage.style.transform = "translateY(27px)";
- }
- } else {
- extendedSplashImage.style.transform = "";
- }
-}
-
-function init(config) {
- readPreferencesFromCfg(config);
+function init(config, manifest) {
+ readPreferencesFromCfg(config, manifest);
var splashscreenStyles = document.createElement("link");
splashscreenStyles.rel = 'stylesheet';
@@ -119,6 +122,9 @@
splashElement.classList.add('hidden');
splashElement.style.backgroundColor = bgColor;
+ extendedSplashImageHelper = document.createElement('span');
+ extendedSplashImageHelper.id = 'extendedSplashImageHelper';
+
extendedSplashImage = document.createElement('img');
extendedSplashImage.id = 'extendedSplashImage';
extendedSplashImage.alt = 'Splash screen image';
@@ -128,8 +134,6 @@
draggableAttr.value = 'false';
extendedSplashImage.attributes.setNamedItem(draggableAttr);
- extendedSplashImage.style.left = '0px';
-
// This helps prevent flickering by making the system wait until your image has been rendered
// before it switches to your extended splash screen.
var onloadAttr = document.createAttribute('onload');
@@ -142,29 +146,18 @@
extendedSplashProgress.classList.add('win-medium');
extendedSplashProgress.classList.add('win-ring');
- if (isWp81 || isWp10) {
- extendedSplashImage.style.maxWidth = "100%";
- extendedSplashImage.style.maxHeight = "100%";
- extendedSplashImage.src = splashImageSrc;
- // center horizontally
- extendedSplashImage.style.margin = "0 auto";
- extendedSplashImage.style.display = "block";
- // center vertically
- extendedSplashImage.style.position = "relative";
- extendedSplashImage.style.top = "50%";
+ extendedSplashImage.src = splashImageSrc;
- // Workaround for intial splashimage jump
- if (isWp10) {
- extendedSplashImage.style.transform = "translateY(-50%)";
- } else {
- centerY();
- }
+ if (isPhoneDevice) {
+ extendedSplashImage.classList.add('phone');
}
if (isWp81) {
extendedSplashProgress.classList.add('extended-splash-progress-phone');
} else if (isWp10) {
extendedSplashProgress.classList.add('extended-splash-progress-wp10');
+ } else {
+ extendedSplashProgress.classList.add('extended-splash-progress-desktop');
}
if (!showSplashScreenSpinner) {
@@ -174,6 +167,7 @@
extendedSplashProgress.style.color = splashScreenSpinnerColor;
}
+ splashElement.appendChild(extendedSplashImageHelper);
splashElement.appendChild(extendedSplashImage);
splashElement.appendChild(extendedSplashProgress);
@@ -197,14 +191,53 @@
document.body.style['-ms-content-zooming'] = origZooming;
}
+// Enter fullscreen mode
+function enterFullScreen() {
+ if (Windows.UI.ViewManagement.ApplicationViewBoundsMode) { // else crash on 8.1
+ var view = Windows.UI.ViewManagement.ApplicationView.getForCurrentView();
+ view.setDesiredBoundsMode(Windows.UI.ViewManagement.ApplicationViewBoundsMode.useCoreWindow);
+ view.suppressSystemOverlays = true;
+ }
+}
+
+// Exit fullscreen mode
+function exitFullScreen() {
+ if (Windows.UI.ViewManagement.ApplicationViewBoundsMode) { // else crash on 8.1
+ var view = Windows.UI.ViewManagement.ApplicationView.getForCurrentView();
+ view.setDesiredBoundsMode(Windows.UI.ViewManagement.ApplicationViewBoundsMode.useVisible);
+ view.suppressSystemOverlays = false;
+ }
+}
+
+// Make title bg color match splashscreen bg color
+function colorizeTitleBar() {
+ var appView = Windows.UI.ViewManagement.ApplicationView.getForCurrentView();
+ if (appView.titleBar) {
+ titleInitialBgColor = appView.titleBar.backgroundColor;
+
+ appView.titleBar.backgroundColor = titleBgColor;
+ appView.titleBar.buttonBackgroundColor = titleBgColor;
+ }
+}
+
+// Revert title bg color
+function revertTitleBarColor() {
+ var appView = Windows.UI.ViewManagement.ApplicationView.getForCurrentView();
+ if (appView.titleBar) {
+ appView.titleBar.backgroundColor = titleInitialBgColor;
+ appView.titleBar.buttonBackgroundColor = titleInitialBgColor;
+ }
+}
+
// Displays the extended splash screen. Pass the splash screen object retrieved during activation.
function show() {
+ enterFullScreen();
+ colorizeTitleBar();
disableUserInteraction();
-
positionControls();
// Once the extended splash screen is setup, apply the CSS style that will make the extended splash screen visible.
- WinJS.Utilities.removeClass(extendedSplashScreen, 'hidden');
+ WinJS.Utilities.removeClass(splashElement, 'hidden');
}
function positionControls() {
@@ -221,13 +254,13 @@
}
// Position the extended splash screen image in the same location as the system splash screen image.
- if (isPhone) {
+ if (isPhoneDevice) {
extendedSplashImage.style.top = 0;
extendedSplashImage.style.left = 0;
- centerY();
} else {
- extendedSplashImage.style.top = splash.imageLocation.y + 'px';
+ // Avoiding subtle image shift on desktop
extendedSplashImage.style.left = splash.imageLocation.x + 'px';
+ extendedSplashImage.style.top = splash.imageLocation.y + 'px';
}
if (!isWp81) {
@@ -247,7 +280,7 @@
// Checks whether the extended splash screen is visible and returns a boolean.
function isVisible() {
- return !(WinJS.Utilities.hasClass(extendedSplashScreen, 'hidden'));
+ return !(WinJS.Utilities.hasClass(splashElement, 'hidden'));
}
function fadeOut(el, duration, finishCb) {
@@ -267,13 +300,25 @@
function hide() {
if (isVisible()) {
var hideFinishCb = function () {
- WinJS.Utilities.addClass(extendedSplashScreen, 'hidden');
- extendedSplashScreen.style.opacity = 1;
+ WinJS.Utilities.addClass(splashElement, 'hidden');
+ splashElement.style.opacity = 1;
enableUserInteraction();
+ exitFullScreen();
+ }
+
+ // Color reversion before fading is over looks better:
+ revertTitleBarColor();
+
+ // https://issues.apache.org/jira/browse/CB-11751
+ // This can occur when we directly replace whole document.body f.e. in a router.
+ // Note that you should disable the splashscreen in this case or update a container element instead.
+ if (document.getElementById(splashElement.id) == null) {
+ hideFinishCb();
+ return;
}
if (fadeSplashScreen) {
- fadeOut(extendedSplashScreen, fadeSplashScreenDuration, hideFinishCb);
+ fadeOut(splashElement, fadeSplashScreenDuration, hideFinishCb);
} else {
hideFinishCb();
}
@@ -318,8 +363,8 @@
//// </Events>
module.exports = {
- firstShow: function (config, activatedEventArgs) {
- init(config);
+ firstShow: function (config, manifest, activatedEventArgs) {
+ init(config, manifest);
activated(activatedEventArgs);
if (!isVisible() && (splashScreenDelay > 0 || !autoHideSplashScreen)) {
diff --git a/node_modules/abbrev/package.json b/node_modules/abbrev/package.json
index eaa57db..620503c 100644
--- a/node_modules/abbrev/package.json
+++ b/node_modules/abbrev/package.json
@@ -10,7 +10,7 @@
"spec": ">=1.0.0 <2.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\nopt"
+ "/Users/steveng/repo/cordova/cordova-windows/node_modules/nopt"
]
],
"_from": "abbrev@>=1.0.0 <2.0.0",
@@ -41,11 +41,11 @@
"_requiredBy": [
"/nopt"
],
- "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz",
+ "_resolved": "http://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz",
"_shasum": "91b4792588a7738c25f35dd6f63752a2f8776135",
"_shrinkwrap": null,
"_spec": "abbrev@1",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\nopt",
+ "_where": "/Users/steveng/repo/cordova/cordova-windows/node_modules/nopt",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me"
diff --git a/node_modules/ansi/examples/beep/index.js b/node_modules/ansi/examples/beep/index.js
old mode 100644
new mode 100755
diff --git a/node_modules/ansi/examples/clear/index.js b/node_modules/ansi/examples/clear/index.js
old mode 100644
new mode 100755
diff --git a/node_modules/ansi/examples/cursorPosition.js b/node_modules/ansi/examples/cursorPosition.js
old mode 100644
new mode 100755
diff --git a/node_modules/ansi/package.json b/node_modules/ansi/package.json
index 0585f8c..295b887 100644
--- a/node_modules/ansi/package.json
+++ b/node_modules/ansi/package.json
@@ -10,13 +10,12 @@
"spec": ">=0.3.1 <0.4.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\cordova-common"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/cordova-common"
]
],
"_from": "ansi@>=0.3.1 <0.4.0",
"_id": "ansi@0.3.1",
"_inCache": true,
- "_installable": true,
"_location": "/ansi",
"_nodeVersion": "5.3.0",
"_npmUser": {
@@ -41,7 +40,7 @@
"_shasum": "0c42d4fb17160d5a9af1e484bace1c66922c1b21",
"_shrinkwrap": null,
"_spec": "ansi@^0.3.1",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\cordova-common",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/cordova-common",
"author": {
"name": "Nathan Rajlich",
"email": "nathan@tootallnate.net",
diff --git a/node_modules/balanced-match/package.json b/node_modules/balanced-match/package.json
index b0d9090..86a2816 100644
--- a/node_modules/balanced-match/package.json
+++ b/node_modules/balanced-match/package.json
@@ -10,13 +10,12 @@
"spec": ">=0.4.1 <0.5.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\brace-expansion"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/brace-expansion"
]
],
"_from": "balanced-match@>=0.4.1 <0.5.0",
"_id": "balanced-match@0.4.2",
"_inCache": true,
- "_installable": true,
"_location": "/balanced-match",
"_nodeVersion": "4.4.7",
"_npmOperationalInternal": {
@@ -45,7 +44,7 @@
"_shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838",
"_shrinkwrap": null,
"_spec": "balanced-match@^0.4.1",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\brace-expansion",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/brace-expansion",
"author": {
"name": "Julian Gruber",
"email": "mail@juliangruber.com",
diff --git a/node_modules/base64-js/package.json b/node_modules/base64-js/package.json
index 73e3e47..3b8e92d 100644
--- a/node_modules/base64-js/package.json
+++ b/node_modules/base64-js/package.json
@@ -10,13 +10,12 @@
"spec": "0.0.8",
"type": "version"
},
- "d:\\cordova\\cordova-windows\\node_modules\\plist"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/plist"
]
],
"_from": "base64-js@0.0.8",
"_id": "base64-js@0.0.8",
"_inCache": true,
- "_installable": true,
"_location": "/base64-js",
"_nodeVersion": "0.10.35",
"_npmUser": {
@@ -41,7 +40,7 @@
"_shasum": "1101e9544f4a76b1bc3b26d452ca96d7a35e7978",
"_shrinkwrap": null,
"_spec": "base64-js@0.0.8",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\plist",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/plist",
"author": {
"name": "T. Jameson Little",
"email": "t.jameson.little@gmail.com"
diff --git a/node_modules/big-integer/BigInteger.js b/node_modules/big-integer/BigInteger.js
index ec9b6d1..ad29f97 100644
--- a/node_modules/big-integer/BigInteger.js
+++ b/node_modules/big-integer/BigInteger.js
@@ -301,7 +301,7 @@
function multiplyKaratsuba(x, y) {
var n = Math.max(x.length, y.length);
-
+
if (n <= 30) return multiplyLong(x, y);
n = Math.ceil(n / 2);
@@ -822,6 +822,25 @@
};
SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime;
+ BigInteger.prototype.modInv = function (n) {
+ var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR;
+ while (!newR.equals(bigInt.zero)) {
+ q = r.divide(newR);
+ lastT = t;
+ lastR = r;
+ t = newT;
+ r = newR;
+ newT = lastT.subtract(q.multiply(newT));
+ newR = lastR.subtract(q.multiply(newR));
+ }
+ if (!r.equals(1)) throw new Error(this.toString() + " and " + n.toString() + " are not co-prime");
+ if (t.compare(0) === -1) {
+ t = t.add(n);
+ }
+ return t;
+ }
+ SmallInteger.prototype.modInv = BigInteger.prototype.modInv;
+
BigInteger.prototype.next = function () {
var value = this.value;
if (this.sign) {
@@ -1114,7 +1133,7 @@
return this.value;
};
SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf;
-
+
function parseStringValue(v) {
if (isPrecise(+v)) {
var x = +v;
@@ -1153,7 +1172,7 @@
trim(r);
return new BigInteger(r, sign);
}
-
+
function parseNumberValue(v) {
if (isPrecise(v)) {
if (v !== truncate(v)) throw new Error(v + " is not an integer.");
diff --git a/node_modules/big-integer/BigInteger.min.js b/node_modules/big-integer/BigInteger.min.js
index a9d12de..908d242 100644
--- a/node_modules/big-integer/BigInteger.min.js
+++ b/node_modules/big-integer/BigInteger.min.js
@@ -1,33 +1 @@
-var bigInt=function(E){function k(a,b){if("undefined"===typeof a)return k[0];if("undefined"!==typeof b){var c;if(10===+b)c=l(a);else{c=b;var n=k[0],f=k[1],d=a.length;if(2<=c&&36>=c&&d<=ga/Math.log(c))c=new e(parseInt(a,c));else{c=l(c);var d=[],g,h="-"===a[0];for(g=h?1:0;g<a.length;g++){var q=a[g].toLowerCase(),u=q.charCodeAt(0);if(48<=u&&57>=u)d.push(l(q));else if(97<=u&&122>=u)d.push(l(q.charCodeAt(0)-87));else if("<"===q){q=g;do g++;while(">"!==a[g]);d.push(l(a.slice(q+1,g)))}else throw Error(q+
-" is not a valid character");}d.reverse();for(g=0;g<d.length;g++)n=n.add(d[g].times(f)),f=f.times(c);c=h?n.negate():n}}return c}return l(a)}function d(a,b){this.value=a;this.sign=b;this.isSmall=!1}function e(a){this.value=a;this.sign=0>a;this.isSmall=!0}function w(a){return-9007199254740992<a&&9007199254740992>a}function z(a){return 1E7>a?[a]:1E14>a?[a%1E7,Math.floor(a/1E7)]:[a%1E7,Math.floor(a/1E7)%1E7,Math.floor(a/1E14)]}function y(a){D(a);var b=a.length;if(4>b&&0>A(a,P))switch(b){case 0:return 0;
-case 1:return a[0];case 2:return a[0]+1E7*a[1];default:return a[0]+1E7*(a[1]+1E7*a[2])}return a}function D(a){for(var b=a.length;0===a[--b];);a.length=b+1}function K(a){for(var b=Array(a),c=-1;++c<a;)b[c]=0;return b}function B(a){return 0<a?Math.floor(a):Math.ceil(a)}function S(a,b){var c=a.length,d=b.length,f=Array(c),m=0,g,e;for(e=0;e<d;e++)g=a[e]+b[e]+m,m=1E7<=g?1:0,f[e]=g-1E7*m;for(;e<c;)g=a[e]+m,m=1E7===g?1:0,f[e++]=g-1E7*m;0<m&&f.push(m);return f}function F(a,b){return a.length>=b.length?S(a,
-b):S(b,a)}function L(a,b){var c=a.length,d=Array(c),f,e;for(e=0;e<c;e++)f=a[e]-1E7+b,b=Math.floor(f/1E7),d[e]=f-1E7*b,b+=1;for(;0<b;)d[e++]=b%1E7,b=Math.floor(b/1E7);return d}function G(a,b){var c=a.length,d=b.length,f=Array(c),e=0,g,h;for(g=0;g<d;g++)h=a[g]-e-b[g],0>h?(h+=1E7,e=1):e=0,f[g]=h;for(g=d;g<c;g++){h=a[g]-e;if(0>h)h+=1E7;else{f[g++]=h;break}f[g]=h}for(;g<c;g++)f[g]=a[g];D(f);return f}function M(a,b,c){var n=a.length,f=Array(n);b=-b;var m,g;for(m=0;m<n;m++)g=a[m]+b,b=Math.floor(g/1E7),g%=
-1E7,f[m]=0>g?g+1E7:g;f=y(f);return"number"===typeof f?(c&&(f=-f),new e(f)):new d(f,c)}function Q(a,b){var c=a.length,d=b.length,f=K(c+d),e,g,h,k;for(h=0;h<c;++h){k=a[h];for(var l=0;l<d;++l)e=b[l],e=k*e+f[h+l],g=Math.floor(e/1E7),f[h+l]=e-1E7*g,f[h+l+1]+=g}D(f);return f}function H(a,b){var c=a.length,d=Array(c),f=0,e,g;for(g=0;g<c;g++)e=a[g]*b+f,f=Math.floor(e/1E7),d[g]=e-1E7*f;for(;0<f;)d[g++]=f%1E7,f=Math.floor(f/1E7);return d}function T(a,b){for(var c=[];0<b--;)c.push(0);return c.concat(a)}function N(a,
-b){var c=Math.max(a.length,b.length);if(30>=c)return Q(a,b);var c=Math.ceil(c/2),d=a.slice(c),f=a.slice(0,c),e=b.slice(c),g=b.slice(0,c),h=N(f,g),k=N(d,e),d=N(F(f,d),F(g,e)),c=F(F(h,T(G(G(d,h),k),c)),T(k,2*c));D(c);return c}function U(a,b,c){return 1E7>a?new d(H(b,a),c):new d(Q(b,z(a)),c)}function V(a){var b=a.length,c=K(b+b),d,f,e,g;for(e=0;e<b;e++){g=a[e];for(var h=0;h<b;h++)d=a[h],d=g*d+c[e+h],f=Math.floor(d/1E7),c[e+h]=d-1E7*f,c[e+h+1]+=f}D(c);return c}function W(a,b){var c=a.length,d=K(c),f,
-e;e=0;for(--c;0<=c;--c)e=1E7*e+a[c],f=B(e/b),e-=f*b,d[c]=f|0;return[d,e|0]}function I(a,b){var c,n=l(b),f=a.value;c=n.value;if(0===c)throw Error("Cannot divide by zero");if(a.isSmall)return n.isSmall?[new e(B(f/c)),new e(f%c)]:[k[0],a];if(n.isSmall){if(1===c)return[a,k[0]];if(-1==c)return[a.negate(),k[0]];c=Math.abs(c);if(1E7>c)return c=W(f,c),f=y(c[0]),c=c[1],a.sign&&(c=-c),"number"===typeof f?(a.sign!==n.sign&&(f=-f),[new e(f),new e(c)]):[new d(f,a.sign!==n.sign),new e(c)];c=z(c)}var m=A(f,c);if(-1===
-m)return[k[0],a];if(0===m)return[k[a.sign===n.sign?1:-1],k[0]];if(200>=f.length+c.length){var g=c,h=f.length;c=g.length;var m=K(g.length),q=g[c-1],u=Math.ceil(1E7/(2*q)),f=H(f,u),g=H(g,u),p,r,x,t,v,w;f.length<=h&&f.push(0);g.push(0);q=g[c-1];for(p=h-c;0<=p;p--){h=9999999;f[p+c]!==q&&(h=Math.floor((1E7*f[p+c]+f[p+c-1])/q));x=r=0;v=g.length;for(t=0;t<v;t++)r+=h*g[t],w=Math.floor(r/1E7),x+=f[p+t]-(r-1E7*w),r=w,0>x?(f[p+t]=x+1E7,x=-1):(f[p+t]=x,x=0);for(;0!==x;){--h;for(t=r=0;t<v;t++)r+=f[p+t]-1E7+g[t],
-0>r?(f[p+t]=r+1E7,r=0):(f[p+t]=r,r=1);x+=r}m[p]=h}f=W(f,u)[0];c=[y(m),y(f)]}else{m=f.length;q=c.length;u=[];for(g=[];m;)if(g.unshift(f[--m]),0>A(g,c))u.push(0);else{h=g.length;p=1E7*g[h-1]+g[h-2];r=1E7*c[q-1]+c[q-2];h>q&&(p=1E7*(p+1));h=Math.ceil(p/r);do{p=H(c,h);if(0>=A(p,g))break;h--}while(h);u.push(h);g=G(g,p)}u.reverse();c=[y(u),y(g)]}f=c[0];n=a.sign!==n.sign;c=c[1];m=a.sign;"number"===typeof f?(n&&(f=-f),f=new e(f)):f=new d(f,n);"number"===typeof c?(m&&(c=-c),c=new e(c)):c=new d(c,m);return[f,
-c]}function A(a,b){if(a.length!==b.length)return a.length>b.length?1:-1;for(var c=a.length-1;0<=c;c--)if(a[c]!==b[c])return a[c]>b[c]?1:-1;return 0}function X(a){a=a.abs();if(a.isUnit())return!1;if(a.equals(2)||a.equals(3)||a.equals(5))return!0;if(a.isEven()||a.isDivisibleBy(3)||a.isDivisibleBy(5))return!1;if(a.lesser(25))return!0}function Y(a){return("number"===typeof a||"string"===typeof a)&&1E7>=+Math.abs(a)||a instanceof d&&1>=a.value.length}function R(a,b,c){b=l(b);var d=a.isNegative(),e=b.isNegative(),
-m=d?a.not():a,g=e?b.not():b;b=[];a=[];for(var h=!1,k=!1;!h||!k;)m.isZero()?(h=!0,b.push(d?1:0)):d?b.push(m.isEven()?1:0):b.push(m.isEven()?0:1),g.isZero()?(k=!0,a.push(e?1:0)):e?a.push(g.isEven()?1:0):a.push(g.isEven()?0:1),m=m.over(2),g=g.over(2);d=[];for(e=0;e<b.length;e++)d.push(c(b[e],a[e]));for(c=bigInt(d.pop()).negate().times(bigInt(2).pow(d.length));d.length;)c=c.add(bigInt(d.pop()).times(bigInt(2).pow(d.length)));return c}function O(a){a=a.value;a="number"===typeof a?a|1073741824:a[0]+1E7*
-a[1]|1073758208;return a&-a}function Z(a,b){a=l(a);b=l(b);return a.greater(b)?a:b}function aa(a,b){a=l(a);b=l(b);return a.lesser(b)?a:b}function ba(a,b){a=l(a).abs();b=l(b).abs();if(a.equals(b))return a;if(a.isZero())return b;if(b.isZero())return a;for(var c=k[1],d;a.isEven()&&b.isEven();)d=Math.min(O(a),O(b)),a=a.divide(d),b=b.divide(d),c=c.multiply(d);for(;a.isEven();)a=a.divide(O(a));do{for(;b.isEven();)b=b.divide(O(b));a.greater(b)&&(d=b,b=a,a=d);b=b.subtract(a)}while(!b.isZero());return c.isUnit()?
-a:a.multiply(c)}function ca(a){a=a.value;"number"===typeof a&&(a=[a]);return 1===a.length&&35>=a[0]?"0123456789abcdefghijklmnopqrstuvwxyz".charAt(a[0]):"<"+a+">"}function da(a,b){b=bigInt(b);if(b.isZero()){if(a.isZero())return"0";throw Error("Cannot convert nonzero numbers to base 0.");}if(b.equals(-1))return a.isZero()?"0":a.isNegative()?Array(1-a).join("10"):"1"+Array(+a).join("01");var c="";a.isNegative()&&b.isPositive()&&(c="-",a=a.abs());if(b.equals(1))return a.isZero()?"0":c+Array(+a+1).join(1);
-for(var d=[],e=a,k;e.isNegative()||0<=e.compareAbs(b);)k=e.divmod(b),e=k.quotient,k=k.remainder,k.isNegative()&&(k=b.minus(k).abs(),e=e.next()),d.push(ca(k));d.push(ca(e));return c+d.reverse().join("")}function ea(a){if(w(+a)){var b=+a;if(b===B(b))return new e(b);throw"Invalid integer: "+a;}(b="-"===a[0])&&(a=a.slice(1));var c=a.split(/e/i);if(2<c.length)throw Error("Invalid integer: "+c.join("e"));if(2===c.length){a=c[1];"+"===a[0]&&(a=a.slice(1));a=+a;if(a!==B(a)||!w(a))throw Error("Invalid integer: "+
-a+" is not a valid exponent.");var c=c[0],n=c.indexOf(".");0<=n&&(a-=c.length-n-1,c=c.slice(0,n)+c.slice(n+1));if(0>a)throw Error("Cannot include negative exponent part for integers");a=c+=Array(a+1).join("0")}if(!/^([0-9][0-9]*)$/.test(a))throw Error("Invalid integer: "+a);for(var c=[],n=a.length,f=n-7;0<n;)c.push(+a.slice(f,n)),f-=7,0>f&&(f=0),n-=7;D(c);return new d(c,b)}function l(a){if("number"===typeof a){if(w(a)){if(a!==B(a))throw Error(a+" is not an integer.");a=new e(a)}else a=ea(a.toString());
-return a}return"string"===typeof a?ea(a):a}var P=z(9007199254740992),ga=Math.log(9007199254740992);d.prototype=Object.create(k.prototype);e.prototype=Object.create(k.prototype);d.prototype.add=function(a){a=l(a);if(this.sign!==a.sign)return this.subtract(a.negate());var b=this.value,c=a.value;return a.isSmall?new d(L(b,Math.abs(c)),this.sign):new d(F(b,c),this.sign)};d.prototype.plus=d.prototype.add;e.prototype.add=function(a){a=l(a);var b=this.value;if(0>b!==a.sign)return this.subtract(a.negate());
-var c=a.value;if(a.isSmall){if(w(b+c))return new e(b+c);c=z(Math.abs(c))}return new d(L(c,Math.abs(b)),0>b)};e.prototype.plus=e.prototype.add;d.prototype.subtract=function(a){var b=l(a);if(this.sign!==b.sign)return this.add(b.negate());a=this.value;var c=b.value;if(b.isSmall)return M(a,Math.abs(c),this.sign);b=this.sign;0<=A(a,c)?a=G(a,c):(a=G(c,a),b=!b);a=y(a);"number"===typeof a?(b&&(a=-a),a=new e(a)):a=new d(a,b);return a};d.prototype.minus=d.prototype.subtract;e.prototype.subtract=function(a){a=
-l(a);var b=this.value;if(0>b!==a.sign)return this.add(a.negate());var c=a.value;return a.isSmall?new e(b-c):M(c,Math.abs(b),0<=b)};e.prototype.minus=e.prototype.subtract;d.prototype.negate=function(){return new d(this.value,!this.sign)};e.prototype.negate=function(){var a=this.sign,b=new e(-this.value);b.sign=!a;return b};d.prototype.abs=function(){return new d(this.value,!1)};e.prototype.abs=function(){return new e(Math.abs(this.value))};d.prototype.multiply=function(a){var b=l(a);a=this.value;var c=
-b.value,e=this.sign!==b.sign;if(b.isSmall){if(0===c)return k[0];if(1===c)return this;if(-1===c)return this.negate();c=Math.abs(c);if(1E7>c)return new d(H(a,c),e);c=z(c)}var b=a.length,f=c.length;return 0<-.012*b-.012*f+1.5E-5*b*f?new d(N(a,c),e):new d(Q(a,c),e)};d.prototype.times=d.prototype.multiply;e.prototype._multiplyBySmall=function(a){return w(a.value*this.value)?new e(a.value*this.value):U(Math.abs(a.value),z(Math.abs(this.value)),this.sign!==a.sign)};d.prototype._multiplyBySmall=function(a){return 0===
-a.value?k[0]:1===a.value?this:-1===a.value?this.negate():U(Math.abs(a.value),this.value,this.sign!==a.sign)};e.prototype.multiply=function(a){return l(a)._multiplyBySmall(this)};e.prototype.times=e.prototype.multiply;d.prototype.square=function(){return new d(V(this.value),!1)};e.prototype.square=function(){var a=this.value*this.value;return w(a)?new e(a):new d(V(z(Math.abs(this.value))),!1)};d.prototype.divmod=function(a){a=I(this,a);return{quotient:a[0],remainder:a[1]}};e.prototype.divmod=d.prototype.divmod;
-d.prototype.divide=function(a){return I(this,a)[0]};e.prototype.over=e.prototype.divide=d.prototype.over=d.prototype.divide;d.prototype.mod=function(a){return I(this,a)[1]};e.prototype.remainder=e.prototype.mod=d.prototype.remainder=d.prototype.mod;d.prototype.pow=function(a){var b=l(a),c=this.value;a=b.value;var d;if(0===a)return k[1];if(0===c)return k[0];if(1===c)return k[1];if(-1===c)return b.isEven()?k[1]:k[-1];if(b.sign)return k[0];if(!b.isSmall)throw Error("The exponent "+b.toString()+" is too large.");
-if(this.isSmall&&w(d=Math.pow(c,a)))return new e(B(d));d=this;for(b=k[1];;){a&1&&(b=b.times(d),--a);if(0===a)break;a/=2;d=d.square()}return b};e.prototype.pow=d.prototype.pow;d.prototype.modPow=function(a,b){a=l(a);b=l(b);if(b.isZero())throw Error("Cannot take modPow with modulus 0");for(var c=k[1],d=this.mod(b);a.isPositive();){if(d.isZero())return k[0];a.isOdd()&&(c=c.multiply(d).mod(b));a=a.divide(2);d=d.square().mod(b)}return c};e.prototype.modPow=d.prototype.modPow;d.prototype.compareAbs=function(a){a=
-l(a);return a.isSmall?1:A(this.value,a.value)};e.prototype.compareAbs=function(a){a=l(a);var b=Math.abs(this.value),c=a.value;return a.isSmall?(c=Math.abs(c),b===c?0:b>c?1:-1):-1};d.prototype.compare=function(a){if(Infinity===a)return-1;if(-Infinity===a)return 1;a=l(a);return this.sign!==a.sign?a.sign?1:-1:a.isSmall?this.sign?-1:1:A(this.value,a.value)*(this.sign?-1:1)};d.prototype.compareTo=d.prototype.compare;e.prototype.compare=function(a){if(Infinity===a)return-1;if(-Infinity===a)return 1;a=l(a);
-var b=this.value,c=a.value;return a.isSmall?b==c?0:b>c?1:-1:0>b!==a.sign?0>b?-1:1:0>b?1:-1};e.prototype.compareTo=e.prototype.compare;d.prototype.equals=function(a){return 0===this.compare(a)};e.prototype.eq=e.prototype.equals=d.prototype.eq=d.prototype.equals;d.prototype.notEquals=function(a){return 0!==this.compare(a)};e.prototype.neq=e.prototype.notEquals=d.prototype.neq=d.prototype.notEquals;d.prototype.greater=function(a){return 0<this.compare(a)};e.prototype.gt=e.prototype.greater=d.prototype.gt=
-d.prototype.greater;d.prototype.lesser=function(a){return 0>this.compare(a)};e.prototype.lt=e.prototype.lesser=d.prototype.lt=d.prototype.lesser;d.prototype.greaterOrEquals=function(a){return 0<=this.compare(a)};e.prototype.geq=e.prototype.greaterOrEquals=d.prototype.geq=d.prototype.greaterOrEquals;d.prototype.lesserOrEquals=function(a){return 0>=this.compare(a)};e.prototype.leq=e.prototype.lesserOrEquals=d.prototype.leq=d.prototype.lesserOrEquals;d.prototype.isEven=function(){return 0===(this.value[0]&
-1)};e.prototype.isEven=function(){return 0===(this.value&1)};d.prototype.isOdd=function(){return 1===(this.value[0]&1)};e.prototype.isOdd=function(){return 1===(this.value&1)};d.prototype.isPositive=function(){return!this.sign};e.prototype.isPositive=function(){return 0<this.value};d.prototype.isNegative=function(){return this.sign};e.prototype.isNegative=function(){return 0>this.value};d.prototype.isUnit=function(){return!1};e.prototype.isUnit=function(){return 1===Math.abs(this.value)};d.prototype.isZero=
-function(){return!1};e.prototype.isZero=function(){return 0===this.value};d.prototype.isDivisibleBy=function(a){a=l(a);var b=a.value;return 0===b?!1:1===b?!0:2===b?this.isEven():this.mod(a).equals(k[0])};e.prototype.isDivisibleBy=d.prototype.isDivisibleBy;d.prototype.isPrime=function(){var a=X(this);if(a!==E)return a;for(var a=this.abs(),b=a.prev(),c=[2,3,5,7,11,13,17,19],d=b,e,l,g,h;d.isEven();)d=d.divide(2);for(g=0;g<c.length;g++)if(h=bigInt(c[g]).modPow(d,a),!h.equals(k[1])&&!h.equals(b)){l=!0;
-for(e=d;l&&e.lesser(b);e=e.multiply(2))h=h.square().mod(a),h.equals(b)&&(l=!1);if(l)return!1}return!0};e.prototype.isPrime=d.prototype.isPrime;d.prototype.isProbablePrime=function(a){var b=X(this);if(b!==E)return b;b=this.abs();a=a===E?5:a;for(var c=0;c<a;c++)if(!bigInt.randBetween(2,b.minus(2)).modPow(b.prev(),b).isUnit())return!1;return!0};e.prototype.isProbablePrime=d.prototype.isProbablePrime;d.prototype.next=function(){var a=this.value;return this.sign?M(a,1,this.sign):new d(L(a,1),this.sign)};
-e.prototype.next=function(){var a=this.value;return 9007199254740992>a+1?new e(a+1):new d(P,!1)};d.prototype.prev=function(){var a=this.value;return this.sign?new d(L(a,1),!0):M(a,1,this.sign)};e.prototype.prev=function(){var a=this.value;return-9007199254740992<a-1?new e(a-1):new d(P,!0)};for(var v=[1];1E7>=v[v.length-1];)v.push(2*v[v.length-1]);var J=v.length,fa=v[J-1];d.prototype.shiftLeft=function(a){if(!Y(a))throw Error(String(a)+" is too large for shifting.");a=+a;if(0>a)return this.shiftRight(-a);
-for(var b=this;a>=J;)b=b.multiply(fa),a-=J-1;return b.multiply(v[a])};e.prototype.shiftLeft=d.prototype.shiftLeft;d.prototype.shiftRight=function(a){var b;if(!Y(a))throw Error(String(a)+" is too large for shifting.");a=+a;if(0>a)return this.shiftLeft(-a);for(b=this;a>=J;){if(b.isZero())return b;b=I(b,fa);b=b[1].isNegative()?b[0].prev():b[0];a-=J-1}b=I(b,v[a]);return b[1].isNegative()?b[0].prev():b[0]};e.prototype.shiftRight=d.prototype.shiftRight;d.prototype.not=function(){return this.negate().prev()};
-e.prototype.not=d.prototype.not;d.prototype.and=function(a){return R(this,a,function(a,c){return a&c})};e.prototype.and=d.prototype.and;d.prototype.or=function(a){return R(this,a,function(a,c){return a|c})};e.prototype.or=d.prototype.or;d.prototype.xor=function(a){return R(this,a,function(a,c){return a^c})};e.prototype.xor=d.prototype.xor;d.prototype.toString=function(a){a===E&&(a=10);if(10!==a)return da(this,a);a=this.value;for(var b=a.length,c=String(a[--b]),d;0<=--b;)d=String(a[b]),c+="0000000".slice(d.length)+
-d;return(this.sign?"-":"")+c};e.prototype.toString=function(a){a===E&&(a=10);return 10!=a?da(this,a):String(this.value)};d.prototype.valueOf=function(){return+this.toString()};d.prototype.toJSNumber=d.prototype.valueOf;e.prototype.valueOf=function(){return this.value};e.prototype.toJSNumber=e.prototype.valueOf;for(var C=0;1E3>C;C++)k[C]=new e(C),0<C&&(k[-C]=new e(-C));k.one=k[1];k.zero=k[0];k.minusOne=k[-1];k.max=Z;k.min=aa;k.gcd=ba;k.lcm=function(a,b){a=l(a).abs();b=l(b).abs();return a.divide(ba(a,
-b)).multiply(b)};k.isInstance=function(a){return a instanceof d||a instanceof e};k.randBetween=function(a,b){a=l(a);b=l(b);var c=aa(a,b),k=Z(a,b).subtract(c);if(k.isSmall)return c.add(Math.round(Math.random()*k));for(var f=[],m=!0,g=k.value.length-1;0<=g;g--){var h=m?k.value[g]:1E7,q=B(Math.random()*h);f.unshift(q);q<h&&(m=!1)}f=y(f);return c.add("number"===typeof f?new e(f):new d(f,!1))};return k}();"undefined"!==typeof module&&module.hasOwnProperty("exports")&&(module.exports=bigInt);
\ No newline at end of file
+var bigInt=function(e){"use strict";function o(e,t){return typeof e=="undefined"?o[0]:typeof t!="undefined"?+t===10?Y(e):$(e,t):Y(e)}function u(e,t){this.value=e,this.sign=t,this.isSmall=!1}function a(e){this.value=e,this.sign=e<0,this.isSmall=!0}function f(e){return-r<e&&e<r}function l(e){return e<1e7?[e]:e<1e14?[e%1e7,Math.floor(e/1e7)]:[e%1e7,Math.floor(e/1e7)%1e7,Math.floor(e/1e14)]}function c(e){h(e);var n=e.length;if(n<4&&_(e,i)<0)switch(n){case 0:return 0;case 1:return e[0];case 2:return e[0]+e[1]*t;default:return e[0]+(e[1]+e[2]*t)*t}return e}function h(e){var t=e.length;while(e[--t]===0);e.length=t+1}function p(e){var t=new Array(e),n=-1;while(++n<e)t[n]=0;return t}function d(e){return e>0?Math.floor(e):Math.ceil(e)}function v(e,n){var r=e.length,i=n.length,s=new Array(r),o=0,u=t,a,f;for(f=0;f<i;f++)a=e[f]+n[f]+o,o=a>=u?1:0,s[f]=a-o*u;while(f<r)a=e[f]+o,o=a===u?1:0,s[f++]=a-o*u;return o>0&&s.push(o),s}function m(e,t){return e.length>=t.length?v(e,t):v(t,e)}function g(e,n){var r=e.length,i=new Array(r),s=t,o,u;for(u=0;u<r;u++)o=e[u]-s+n,n=Math.floor(o/s),i[u]=o-n*s,n+=1;while(n>0)i[u++]=n%s,n=Math.floor(n/s);return i}function y(e,n){var r=e.length,i=n.length,s=new Array(r),o=0,u=t,a,f;for(a=0;a<i;a++)f=e[a]-o-n[a],f<0?(f+=u,o=1):o=0,s[a]=f;for(a=i;a<r;a++){f=e[a]-o;if(!(f<0)){s[a++]=f;break}f+=u,s[a]=f}for(;a<r;a++)s[a]=e[a];return h(s),s}function b(e,t,n){var r,i;return _(e,t)>=0?r=y(e,t):(r=y(t,e),n=!n),r=c(r),typeof r=="number"?(n&&(r=-r),new a(r)):new u(r,n)}function w(e,n,r){var i=e.length,s=new Array(i),o=-n,f=t,l,h;for(l=0;l<i;l++)h=e[l]+o,o=Math.floor(h/f),h%=f,s[l]=h<0?h+f:h;return s=c(s),typeof s=="number"?(r&&(s=-s),new a(s)):new u(s,r)}function E(e,n){var r=e.length,i=n.length,s=r+i,o=p(s),u=t,a,f,l,c,d;for(l=0;l<r;++l){c=e[l];for(var v=0;v<i;++v)d=n[v],a=c*d+o[l+v],f=Math.floor(a/u),o[l+v]=a-f*u,o[l+v+1]+=f}return h(o),o}function S(e,n){var r=e.length,i=new Array(r),s=t,o=0,u,a;for(a=0;a<r;a++)u=e[a]*n+o,o=Math.floor(u/s),i[a]=u-o*s;while(o>0)i[a++]=o%s,o=Math.floor(o/s);return i}function x(e,t){var n=[];while(t-->0)n.push(0);return n.concat(e)}function T(e,t){var n=Math.max(e.length,t.length);if(n<=30)return E(e,t);n=Math.ceil(n/2);var r=e.slice(n),i=e.slice(0,n),s=t.slice(n),o=t.slice(0,n),u=T(i,o),a=T(r,s),f=T(m(i,r),m(o,s)),l=m(m(u,x(y(y(f,u),a),n)),x(a,2*n));return h(l),l}function N(e,t){return-0.012*e-.012*t+15e-6*e*t>0}function C(e,n,r){return e<t?new u(S(n,e),r):new u(E(n,l(e)),r)}function k(e){var n=e.length,r=p(n+n),i=t,s,o,u,a,f;for(u=0;u<n;u++){a=e[u];for(var l=0;l<n;l++)f=e[l],s=a*f+r[u+l],o=Math.floor(s/i),r[u+l]=s-o*i,r[u+l+1]+=o}return h(r),r}function L(e,n){var r=e.length,i=n.length,s=t,o=p(n.length),u=n[i-1],a=Math.ceil(s/(2*u)),f=S(e,a),l=S(n,a),h,d,v,m,g,y,b;f.length<=r&&f.push(0),l.push(0),u=l[i-1];for(d=r-i;d>=0;d--){h=s-1,f[d+i]!==u&&(h=Math.floor((f[d+i]*s+f[d+i-1])/u)),v=0,m=0,y=l.length;for(g=0;g<y;g++)v+=h*l[g],b=Math.floor(v/s),m+=f[d+g]-(v-b*s),v=b,m<0?(f[d+g]=m+s,m=-1):(f[d+g]=m,m=0);while(m!==0){h-=1,v=0;for(g=0;g<y;g++)v+=f[d+g]-s+l[g],v<0?(f[d+g]=v+s,v=0):(f[d+g]=v,v=1);m+=v}o[d]=h}return f=O(f,a)[0],[c(o),c(f)]}function A(e,n){var r=e.length,i=n.length,s=[],o=[],u=t,a,f,l,h,p;while(r){o.unshift(e[--r]);if(_(o,n)<0){s.push(0);continue}f=o.length,l=o[f-1]*u+o[f-2],h=n[i-1]*u+n[i-2],f>i&&(l=(l+1)*u),a=Math.ceil(l/h);do{p=S(n,a);if(_(p,o)<=0)break;a--}while(a);s.push(a),o=y(o,p)}return s.reverse(),[c(s),c(o)]}function O(e,n){var r=e.length,i=p(r),s=t,o,u,a,f;a=0;for(o=r-1;o>=0;--o)f=a*s+e[o],u=d(f/n),a=f-u*n,i[o]=u|0;return[i,a|0]}function M(e,n){var r,i=Y(n),s=e.value,f=i.value,h;if(f===0)throw new Error("Cannot divide by zero");if(e.isSmall)return i.isSmall?[new a(d(s/f)),new a(s%f)]:[o[0],e];if(i.isSmall){if(f===1)return[e,o[0]];if(f==-1)return[e.negate(),o[0]];var p=Math.abs(f);if(p<t){r=O(s,p),h=c(r[0]);var v=r[1];return e.sign&&(v=-v),typeof h=="number"?(e.sign!==i.sign&&(h=-h),[new a(h),new a(v)]):[new u(h,e.sign!==i.sign),new a(v)]}f=l(p)}var m=_(s,f);if(m===-1)return[o[0],e];if(m===0)return[o[e.sign===i.sign?1:-1],o[0]];s.length+f.length<=200?r=L(s,f):r=A(s,f),h=r[0];var g=e.sign!==i.sign,y=r[1],b=e.sign;return typeof h=="number"?(g&&(h=-h),h=new a(h)):h=new u(h,g),typeof y=="number"?(b&&(y=-y),y=new a(y)):y=new u(y,b),[h,y]}function _(e,t){if(e.length!==t.length)return e.length>t.length?1:-1;for(var n=e.length-1;n>=0;n--)if(e[n]!==t[n])return e[n]>t[n]?1:-1;return 0}function D(e){var t=e.abs();if(t.isUnit())return!1;if(t.equals(2)||t.equals(3)||t.equals(5))return!0;if(t.isEven()||t.isDivisibleBy(3)||t.isDivisibleBy(5))return!1;if(t.lesser(25))return!0}function j(e){return(typeof e=="number"||typeof e=="string")&&+Math.abs(e)<=t||e instanceof u&&e.value.length<=1}function F(e,t,n){t=Y(t);var r=e.isNegative(),i=t.isNegative(),s=r?e.not():e,o=i?t.not():t,u=[],a=[],f=!1,l=!1;while(!f||!l)s.isZero()?(f=!0,u.push(r?1:0)):r?u.push(s.isEven()?1:0):u.push(s.isEven()?0:1),o.isZero()?(l=!0,a.push(i?1:0)):i?a.push(o.isEven()?1:0):a.push(o.isEven()?0:1),s=s.over(2),o=o.over(2);var c=[];for(var h=0;h<u.length;h++)c.push(n(u[h],a[h]));var p=bigInt(c.pop()).negate().times(bigInt(2).pow(c.length));while(c.length)p=p.add(bigInt(c.pop()).times(bigInt(2).pow(c.length)));return p}function R(e){var n=e.value,r=typeof n=="number"?n|I:n[0]+n[1]*t|q;return r&-r}function U(e,t){return e=Y(e),t=Y(t),e.greater(t)?e:t}function z(e,t){return e=Y(e),t=Y(t),e.lesser(t)?e:t}function W(e,t){e=Y(e).abs(),t=Y(t).abs();if(e.equals(t))return e;if(e.isZero())return t;if(t.isZero())return e;var n=o[1],r,i;while(e.isEven()&&t.isEven())r=Math.min(R(e),R(t)),e=e.divide(r),t=t.divide(r),n=n.multiply(r);while(e.isEven())e=e.divide(R(e));do{while(t.isEven())t=t.divide(R(t));e.greater(t)&&(i=t,t=e,e=i),t=t.subtract(e)}while(!t.isZero());return n.isUnit()?e:e.multiply(n)}function X(e,t){return e=Y(e).abs(),t=Y(t).abs(),e.divide(W(e,t)).multiply(t)}function V(e,n){e=Y(e),n=Y(n);var r=z(e,n),i=U(e,n),s=i.subtract(r);if(s.isSmall)return r.add(Math.round(Math.random()*s));var o=s.value.length-1,f=[],l=!0;for(var h=o;h>=0;h--){var p=l?s.value[h]:t,v=d(Math.random()*p);f.unshift(v),v<p&&(l=!1)}return f=c(f),r.add(typeof f=="number"?new a(f):new u(f,!1))}function J(e){var t=e.value;return typeof t=="number"&&(t=[t]),t.length===1&&t[0]<=35?"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t[0]):"<"+t+">"}function K(e,t){t=bigInt(t);if(t.isZero()){if(e.isZero())return"0";throw new Error("Cannot convert nonzero numbers to base 0.")}if(t.equals(-1))return e.isZero()?"0":e.isNegative()?(new Array(1-e)).join("10"):"1"+(new Array(+e)).join("01");var n="";e.isNegative()&&t.isPositive()&&(n="-",e=e.abs());if(t.equals(1))return e.isZero()?"0":n+(new Array(+e+1)).join(1);var r=[],i=e,s;while(i.isNegative()||i.compareAbs(t)>=0){s=i.divmod(t),i=s.quotient;var o=s.remainder;o.isNegative()&&(o=t.minus(o).abs(),i=i.next()),r.push(J(o))}return r.push(J(i)),n+r.reverse().join("")}function Q(e){if(f(+e)){var t=+e;if(t===d(t))return new a(t);throw"Invalid integer: "+e}var r=e[0]==="-";r&&(e=e.slice(1));var i=e.split(/e/i);if(i.length>2)throw new Error("Invalid integer: "+i.join("e"));if(i.length===2){var s=i[1];s[0]==="+"&&(s=s.slice(1)),s=+s;if(s!==d(s)||!f(s))throw new Error("Invalid integer: "+s+" is not a valid exponent.");var o=i[0],l=o.indexOf(".");l>=0&&(s-=o.length-l-1,o=o.slice(0,l)+o.slice(l+1));if(s<0)throw new Error("Cannot include negative exponent part for integers");o+=(new Array(s+1)).join("0"),e=o}var c=/^([0-9][0-9]*)$/.test(e);if(!c)throw new Error("Invalid integer: "+e);var p=[],v=e.length,m=n,g=v-m;while(v>0)p.push(+e.slice(g,v)),g-=m,g<0&&(g=0),v-=m;return h(p),new u(p,r)}function G(e){if(f(e)){if(e!==d(e))throw new Error(e+" is not an integer.");return new a(e)}return Q(e.toString())}function Y(e){return typeof e=="number"?G(e):typeof e=="string"?Q(e):e}var t=1e7,n=7,r=9007199254740992,i=l(r),s=Math.log(r);u.prototype=Object.create(o.prototype),a.prototype=Object.create(o.prototype),u.prototype.add=function(e){var t,n=Y(e);if(this.sign!==n.sign)return this.subtract(n.negate());var r=this.value,i=n.value;return n.isSmall?new u(g(r,Math.abs(i)),this.sign):new u(m(r,i),this.sign)},u.prototype.plus=u.prototype.add,a.prototype.add=function(e){var t=Y(e),n=this.value;if(n<0!==t.sign)return this.subtract(t.negate());var r=t.value;if(t.isSmall){if(f(n+r))return new a(n+r);r=l(Math.abs(r))}return new u(g(r,Math.abs(n)),n<0)},a.prototype.plus=a.prototype.add,u.prototype.subtract=function(e){var t=Y(e);if(this.sign!==t.sign)return this.add(t.negate());var n=this.value,r=t.value;return t.isSmall?w(n,Math.abs(r),this.sign):b(n,r,this.sign)},u.prototype.minus=u.prototype.subtract,a.prototype.subtract=function(e){var t=Y(e),n=this.value;if(n<0!==t.sign)return this.add(t.negate());var r=t.value;return t.isSmall?new a(n-r):w(r,Math.abs(n),n>=0)},a.prototype.minus=a.prototype.subtract,u.prototype.negate=function(){return new u(this.value,!this.sign)},a.prototype.negate=function(){var e=this.sign,t=new a(-this.value);return t.sign=!e,t},u.prototype.abs=function(){return new u(this.value,!1)},a.prototype.abs=function(){return new a(Math.abs(this.value))},u.prototype.multiply=function(e){var n,r=Y(e),i=this.value,s=r.value,a=this.sign!==r.sign,f;if(r.isSmall){if(s===0)return o[0];if(s===1)return this;if(s===-1)return this.negate();f=Math.abs(s);if(f<t)return new u(S(i,f),a);s=l(f)}return N(i.length,s.length)?new u(T(i,s),a):new u(E(i,s),a)},u.prototype.times=u.prototype.multiply,a.prototype._multiplyBySmall=function(e){return f(e.value*this.value)?new a(e.value*this.value):C(Math.abs(e.value),l(Math.abs(this.value)),this.sign!==e.sign)},u.prototype._multiplyBySmall=function(e){return e.value===0?o[0]:e.value===1?this:e.value===-1?this.negate():C(Math.abs(e.value),this.value,this.sign!==e.sign)},a.prototype.multiply=function(e){return Y(e)._multiplyBySmall(this)},a.prototype.times=a.prototype.multiply,u.prototype.square=function(){return new u(k(this.value),!1)},a.prototype.square=function(){var e=this.value*this.value;return f(e)?new a(e):new u(k(l(Math.abs(this.value))),!1)},u.prototype.divmod=function(e){var t=M(this,e);return{quotient:t[0],remainder:t[1]}},a.prototype.divmod=u.prototype.divmod,u.prototype.divide=function(e){return M(this,e)[0]},a.prototype.over=a.prototype.divide=u.prototype.over=u.prototype.divide,u.prototype.mod=function(e){return M(this,e)[1]},a.prototype.remainder=a.prototype.mod=u.prototype.remainder=u.prototype.mod,u.prototype.pow=function(e){var t=Y(e),n=this.value,r=t.value,i,s,u;if(r===0)return o[1];if(n===0)return o[0];if(n===1)return o[1];if(n===-1)return t.isEven()?o[1]:o[-1];if(t.sign)return o[0];if(!t.isSmall)throw new Error("The exponent "+t.toString()+" is too large.");if(this.isSmall&&f(i=Math.pow(n,r)))return new a(d(i));s=this,u=o[1];for(;;){r&!0&&(u=u.times(s),--r);if(r===0)break;r/=2,s=s.square()}return u},a.prototype.pow=u.prototype.pow,u.prototype.modPow=function(e,t){e=Y(e),t=Y(t);if(t.isZero())throw new Error("Cannot take modPow with modulus 0");var n=o[1],r=this.mod(t);while(e.isPositive()){if(r.isZero())return o[0];e.isOdd()&&(n=n.multiply(r).mod(t)),e=e.divide(2),r=r.square().mod(t)}return n},a.prototype.modPow=u.prototype.modPow,u.prototype.compareAbs=function(e){var t=Y(e),n=this.value,r=t.value;return t.isSmall?1:_(n,r)},a.prototype.compareAbs=function(e){var t=Y(e),n=Math.abs(this.value),r=t.value;return t.isSmall?(r=Math.abs(r),n===r?0:n>r?1:-1):-1},u.prototype.compare=function(e){if(e===Infinity)return-1;if(e===-Infinity)return 1;var t=Y(e),n=this.value,r=t.value;return this.sign!==t.sign?t.sign?1:-1:t.isSmall?this.sign?-1:1:_(n,r)*(this.sign?-1:1)},u.prototype.compareTo=u.prototype.compare,a.prototype.compare=function(e){if(e===Infinity)return-1;if(e===-Infinity)return 1;var t=Y(e),n=this.value,r=t.value;return t.isSmall?n==r?0:n>r?1:-1:n<0!==t.sign?n<0?-1:1:n<0?1:-1},a.prototype.compareTo=a.prototype.compare,u.prototype.equals=function(e){return this.compare(e)===0},a.prototype.eq=a.prototype.equals=u.prototype.eq=u.prototype.equals,u.prototype.notEquals=function(e){return this.compare(e)!==0},a.prototype.neq=a.prototype.notEquals=u.prototype.neq=u.prototype.notEquals,u.prototype.greater=function(e){return this.compare(e)>0},a.prototype.gt=a.prototype.greater=u.prototype.gt=u.prototype.greater,u.prototype.lesser=function(e){return this.compare(e)<0},a.prototype.lt=a.prototype.lesser=u.prototype.lt=u.prototype.lesser,u.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},a.prototype.geq=a.prototype.greaterOrEquals=u.prototype.geq=u.prototype.greaterOrEquals,u.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},a.prototype.leq=a.prototype.lesserOrEquals=u.prototype.leq=u.prototype.lesserOrEquals,u.prototype.isEven=function(){return(this.value[0]&1)===0},a.prototype.isEven=function(){return(this.value&1)===0},u.prototype.isOdd=function(){return(this.value[0]&1)===1},a.prototype.isOdd=function(){return(this.value&1)===1},u.prototype.isPositive=function(){return!this.sign},a.prototype.isPositive=function(){return this.value>0},u.prototype.isNegative=function(){return this.sign},a.prototype.isNegative=function(){return this.value<0},u.prototype.isUnit=function(){return!1},a.prototype.isUnit=function(){return Math.abs(this.value)===1},u.prototype.isZero=function(){return!1},a.prototype.isZero=function(){return this.value===0},u.prototype.isDivisibleBy=function(e){var t=Y(e),n=t.value;return n===0?!1:n===1?!0:n===2?this.isEven():this.mod(t).equals(o[0])},a.prototype.isDivisibleBy=u.prototype.isDivisibleBy,u.prototype.isPrime=function(){var t=D(this);if(t!==e)return t;var n=this.abs(),r=n.prev(),i=[2,3,5,7,11,13,17,19],s=r,u,a,f,l;while(s.isEven())s=s.divide(2);for(f=0;f<i.length;f++){l=bigInt(i[f]).modPow(s,n);if(l.equals(o[1])||l.equals(r))continue;for(a=!0,u=s;a&&u.lesser(r);u=u.multiply(2))l=l.square().mod(n),l.equals(r)&&(a=!1);if(a)return!1}return!0},a.prototype.isPrime=u.prototype.isPrime,u.prototype.isProbablePrime=function(t){var n=D(this);if(n!==e)return n;var r=this.abs(),i=t===e?5:t;for(var s=0;s<i;s++){var o=bigInt.randBetween(2,r.minus(2));if(!o.modPow(r.prev(),r).isUnit())return!1}return!0},a.prototype.isProbablePrime=u.prototype.isProbablePrime,u.prototype.modInv=function(e){var t=bigInt.zero,n=bigInt.one,r=Y(e),i=this.abs(),s,o,u;while(!i.equals(bigInt.zero))s=r.divide(i),o=t,u=r,t=n,r=i,n=o.subtract(s.multiply(n)),i=u.subtract(s.multiply(i));if(!r.equals(1))throw new Error(this.toString()+" and "+e.toString()+" are not co-prime");return t.compare(0)===-1&&(t=t.add(e)),t},a.prototype.modInv=u.prototype.modInv,u.prototype.next=function(){var e=this.value;return this.sign?w(e,1,this.sign):new u(g(e,1),this.sign)},a.prototype.next=function(){var e=this.value;return e+1<r?new a(e+1):new u(i,!1)},u.prototype.prev=function(){var e=this.value;return this.sign?new u(g(e,1),!0):w(e,1,this.sign)},a.prototype.prev=function(){var e=this.value;return e-1>-r?new a(e-1):new u(i,!0)};var P=[1];while(P[P.length-1]<=t)P.push(2*P[P.length-1]);var H=P.length,B=P[H-1];u.prototype.shiftLeft=function(e){if(!j(e))throw new Error(String(e)+" is too large for shifting.");e=+e;if(e<0)return this.shiftRight(-e);var t=this;while(e>=H)t=t.multiply(B),e-=H-1;return t.multiply(P[e])},a.prototype.shiftLeft=u.prototype.shiftLeft,u.prototype.shiftRight=function(e){var t;if(!j(e))throw new Error(String(e)+" is too large for shifting.");e=+e;if(e<0)return this.shiftLeft(-e);var n=this;while(e>=H){if(n.isZero())return n;t=M(n,B),n=t[1].isNegative()?t[0].prev():t[0],e-=H-1}return t=M(n,P[e]),t[1].isNegative()?t[0].prev():t[0]},a.prototype.shiftRight=u.prototype.shiftRight,u.prototype.not=function(){return this.negate().prev()},a.prototype.not=u.prototype.not,u.prototype.and=function(e){return F(this,e,function(e,t){return e&t})},a.prototype.and=u.prototype.and,u.prototype.or=function(e){return F(this,e,function(e,t){return e|t})},a.prototype.or=u.prototype.or,u.prototype.xor=function(e){return F(this,e,function(e,t){return e^t})},a.prototype.xor=u.prototype.xor;var I=1<<30,q=(t&-t)*(t&-t)|I,$=function(e,t){var n=o[0],r=o[1],i=e.length;if(2<=t&&t<=36&&i<=s/Math.log(t))return new a(parseInt(e,t));t=Y(t);var u=[],f,l=e[0]==="-";for(f=l?1:0;f<e.length;f++){var c=e[f].toLowerCase(),h=c.charCodeAt(0);if(48<=h&&h<=57)u.push(Y(c));else if(97<=h&&h<=122)u.push(Y(c.charCodeAt(0)-87));else{if(c!=="<")throw new Error(c+" is not a valid character");var p=f;do f++;while(e[f]!==">");u.push(Y(e.slice(p+1,f)))}}u.reverse();for(f=0;f<u.length;f++)n=n.add(u[f].times(r)),r=r.times(t);return l?n.negate():n};u.prototype.toString=function(t){t===e&&(t=10);if(t!==10)return K(this,t);var n=this.value,r=n.length,i=String(n[--r]),s="0000000",o;while(--r>=0)o=String(n[r]),i+=s.slice(o.length)+o;var u=this.sign?"-":"";return u+i},a.prototype.toString=function(t){return t===e&&(t=10),t!=10?K(this,t):String(this.value)},u.prototype.valueOf=function(){return+this.toString()},u.prototype.toJSNumber=u.prototype.valueOf,a.prototype.valueOf=function(){return this.value},a.prototype.toJSNumber=a.prototype.valueOf;for(var Z=0;Z<1e3;Z++)o[Z]=new a(Z),Z>0&&(o[-Z]=new a(-Z));return o.one=o[1],o.zero=o[0],o.minusOne=o[-1],o.max=U,o.min=z,o.gcd=W,o.lcm=X,o.isInstance=function(e){return e instanceof u||e instanceof a},o.randBetween=V,o}();typeof module!="undefined"&&module.hasOwnProperty("exports")&&(module.exports=bigInt);
\ No newline at end of file
diff --git a/node_modules/big-integer/README.md b/node_modules/big-integer/README.md
index 6d9ee85..51eb657 100644
--- a/node_modules/big-integer/README.md
+++ b/node_modules/big-integer/README.md
@@ -280,6 +280,13 @@
[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division)
+#### `modInv(mod)`
+
+Finds the [multiplicative inverse](https://en.wikipedia.org/wiki/Modular_multiplicative_inverse) of the number modulo `mod`.
+
+ - `bigInt(3).modInv(11)` => `4`
+ - `bigInt(42).modInv(2017)` => `1969`
+
#### `modPow(exp, mod)`
Takes the number to the power `exp` modulo `mod`.
diff --git a/node_modules/big-integer/bower.json b/node_modules/big-integer/bower.json
new file mode 100644
index 0000000..c7c7291
--- /dev/null
+++ b/node_modules/big-integer/bower.json
@@ -0,0 +1,30 @@
+{
+ "name": "big-integer",
+ "description": "An arbitrary length integer library for Javascript",
+ "main": "./BigInteger.js",
+ "authors": [
+ "Peter Olson"
+ ],
+ "license": "Unlicense",
+ "keywords": [
+ "math",
+ "big",
+ "bignum",
+ "bigint",
+ "biginteger",
+ "integer",
+ "arbitrary",
+ "precision",
+ "arithmetic"
+ ],
+ "homepage": "https://github.com/peterolson/BigInteger.js",
+ "ignore": [
+ "**/.*",
+ "node_modules",
+ "bower_components",
+ "test",
+ "coverage",
+ "spec",
+ "tests"
+ ]
+}
diff --git a/node_modules/big-integer/package.json b/node_modules/big-integer/package.json
index fc85923..b6ab5a2 100644
--- a/node_modules/big-integer/package.json
+++ b/node_modules/big-integer/package.json
@@ -10,24 +10,23 @@
"spec": ">=1.6.7 <2.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\bplist-parser"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/bplist-parser"
]
],
"_from": "big-integer@>=1.6.7 <2.0.0",
- "_id": "big-integer@1.6.15",
+ "_id": "big-integer@1.6.17",
"_inCache": true,
- "_installable": true,
"_location": "/big-integer",
- "_nodeVersion": "0.12.3",
+ "_nodeVersion": "4.4.5",
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
- "tmp": "tmp/big-integer-1.6.15.tgz_1460079231162_0.7087579960934818"
+ "tmp": "tmp/big-integer-1.6.17.tgz_1478721202721_0.8068355675786734"
},
"_npmUser": {
"name": "peterolson",
"email": "peter.e.c.olson+npm@gmail.com"
},
- "_npmVersion": "2.9.1",
+ "_npmVersion": "2.15.5",
"_phantomChildren": {},
"_requested": {
"raw": "big-integer@^1.6.7",
@@ -41,11 +40,11 @@
"_requiredBy": [
"/bplist-parser"
],
- "_resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.15.tgz",
- "_shasum": "33d27d3b7388dfcc4b86d3130c10740cec01fb9e",
+ "_resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.17.tgz",
+ "_shasum": "f0dcf5109a949e42a993ee3e8fb2070452817b51",
"_shrinkwrap": null,
"_spec": "big-integer@^1.6.7",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\bplist-parser",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/bplist-parser",
"author": {
"name": "Peter Olson",
"email": "peter.e.c.olson+npm@gmail.com"
@@ -68,13 +67,13 @@
},
"directories": {},
"dist": {
- "shasum": "33d27d3b7388dfcc4b86d3130c10740cec01fb9e",
- "tarball": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.15.tgz"
+ "shasum": "f0dcf5109a949e42a993ee3e8fb2070452817b51",
+ "tarball": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.17.tgz"
},
"engines": {
"node": ">=0.6"
},
- "gitHead": "cda5bcce74c3a4eb34951201d50c1b8776a56eca",
+ "gitHead": "d25d0bfcd96f31001ec8572c8d01de4770d99e63",
"homepage": "https://github.com/peterolson/BigInteger.js#readme",
"keywords": [
"math",
@@ -105,5 +104,5 @@
"scripts": {
"test": "karma start my.conf.js"
},
- "version": "1.6.15"
+ "version": "1.6.17"
}
diff --git a/node_modules/bplist-parser/package.json b/node_modules/bplist-parser/package.json
index 90562fc..50399ab 100644
--- a/node_modules/bplist-parser/package.json
+++ b/node_modules/bplist-parser/package.json
@@ -10,13 +10,12 @@
"spec": ">=0.1.0 <0.2.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\cordova-common"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/cordova-common"
]
],
"_from": "bplist-parser@>=0.1.0 <0.2.0",
"_id": "bplist-parser@0.1.1",
"_inCache": true,
- "_installable": true,
"_location": "/bplist-parser",
"_nodeVersion": "5.1.0",
"_npmUser": {
@@ -41,7 +40,7 @@
"_shasum": "d60d5dcc20cba6dc7e1f299b35d3e1f95dafbae6",
"_shrinkwrap": null,
"_spec": "bplist-parser@^0.1.0",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\cordova-common",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/cordova-common",
"author": {
"name": "Joe Ferner",
"email": "joe.ferner@nearinfinity.com"
diff --git a/node_modules/bplist-parser/test/utf16_chinese.plist b/node_modules/bplist-parser/test/utf16_chinese.plist
old mode 100644
new mode 100755
Binary files differ
diff --git a/node_modules/brace-expansion/package.json b/node_modules/brace-expansion/package.json
index 1b5d417..a867fd2 100644
--- a/node_modules/brace-expansion/package.json
+++ b/node_modules/brace-expansion/package.json
@@ -10,13 +10,12 @@
"spec": ">=1.0.0 <2.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\minimatch"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/minimatch"
]
],
"_from": "brace-expansion@>=1.0.0 <2.0.0",
"_id": "brace-expansion@1.1.6",
"_inCache": true,
- "_installable": true,
"_location": "/brace-expansion",
"_nodeVersion": "4.4.7",
"_npmOperationalInternal": {
@@ -45,7 +44,7 @@
"_shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9",
"_shrinkwrap": null,
"_spec": "brace-expansion@^1.0.0",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\minimatch",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/minimatch",
"author": {
"name": "Julian Gruber",
"email": "mail@juliangruber.com",
diff --git a/node_modules/concat-map/package.json b/node_modules/concat-map/package.json
index c2fea30..56e45ac 100644
--- a/node_modules/concat-map/package.json
+++ b/node_modules/concat-map/package.json
@@ -10,13 +10,12 @@
"spec": "0.0.1",
"type": "version"
},
- "d:\\cordova\\cordova-windows\\node_modules\\brace-expansion"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/brace-expansion"
]
],
"_from": "concat-map@0.0.1",
"_id": "concat-map@0.0.1",
"_inCache": true,
- "_installable": true,
"_location": "/concat-map",
"_npmUser": {
"name": "substack",
@@ -40,7 +39,7 @@
"_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b",
"_shrinkwrap": null,
"_spec": "concat-map@0.0.1",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\brace-expansion",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/brace-expansion",
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
diff --git a/node_modules/cordova-common/.ratignore b/node_modules/cordova-common/.ratignore
index 26f7205..d9f5e52 100644
--- a/node_modules/cordova-common/.ratignore
+++ b/node_modules/cordova-common/.ratignore
@@ -1,2 +1,3 @@
fixtures
coverage
+jasmine.json
diff --git a/node_modules/cordova-common/RELEASENOTES.md b/node_modules/cordova-common/RELEASENOTES.md
index 71ad1ea..3aca768 100644
--- a/node_modules/cordova-common/RELEASENOTES.md
+++ b/node_modules/cordova-common/RELEASENOTES.md
@@ -20,6 +20,33 @@
-->
# Cordova-common Release Notes
+### 2.0.0 (Jan 17, 2017)
+* [CB-8978](https://issues.apache.org/jira/browse/CB-8978) Add `resource-file` parsing to `config.xml`
+* [CB-12018](https://issues.apache.org/jira/browse/CB-12018): updated `jshint` and updated tests to work with `jasmine@2` instead of `jasmine-node`
+* [CB-12163](https://issues.apache.org/jira/browse/CB-12163) Add reference attrib to `resource-file` for **Windows**
+* Move windows-specific logic to `cordova-windows`
+* [CB-12189](https://issues.apache.org/jira/browse/CB-12189) Add implementation attribute to framework
+
+### 1.5.1 (Oct 12, 2016)
+* [CB-12002](https://issues.apache.org/jira/browse/CB-12002) Add `getAllowIntents()` to `ConfigParser`
+* [CB-11998](https://issues.apache.org/jira/browse/CB-11998) `cordova platform add` error with `cordova-common@1.5.0`
+
+### 1.5.0 (Oct 06, 2016)
+* [CB-11776](https://issues.apache.org/jira/browse/CB-11776) Add test case for different `edit-config` targets
+* [CB-11908](https://issues.apache.org/jira/browse/CB-11908) Add `edit-config` to `config.xml`
+* [CB-11936](https://issues.apache.org/jira/browse/CB-11936) Support four new **App Transport Security (ATS)** keys
+* update `config.xml` location if it is a **Android Studio** project.
+* use `array` methods and `object.keys` for iterating. avoiding `for-in` loops
+* [CB-11517](https://issues.apache.org/jira/browse/CB-11517) Allow `.folder` matches
+* [CB-11776](https://issues.apache.org/jira/browse/CB-11776) check `edit-config` target exists
+
+### 1.4.1 (Aug 09, 2016)
+* Add general purpose `ConfigParser.getAttribute` API
+* [CB-11653](https://issues.apache.org/jira/browse/CB-11653) moved `findProjectRoot` from `cordova-lib` to `cordova-common`
+* [CB-11636](https://issues.apache.org/jira/browse/CB-11636) Handle attributes with quotes correctly
+* [CB-11645](https://issues.apache.org/jira/browse/CB-11645) added check to see if `getEditConfig` exists before trying to use it
+* [CB-9825](https://issues.apache.org/jira/browse/CB-9825) framework tag spec parsing
+
### 1.4.0 (Jul 12, 2016)
* [CB-11023](https://issues.apache.org/jira/browse/CB-11023) Add edit-config functionality
diff --git a/node_modules/cordova-common/cordova-common.js b/node_modules/cordova-common/cordova-common.js
index dcaf7a4..801d510 100644
--- a/node_modules/cordova-common/cordova-common.js
+++ b/node_modules/cordova-common/cordova-common.js
@@ -27,6 +27,7 @@
addProperty(module, 'ActionStack', './src/ActionStack');
addProperty(module, 'CordovaError', './src/CordovaError/CordovaError');
addProperty(module, 'CordovaLogger', './src/CordovaLogger');
+addProperty(module, 'CordovaCheck', './src/CordovaCheck');
addProperty(module, 'CordovaExternalToolErrorContext', './src/CordovaError/CordovaExternalToolErrorContext');
addProperty(module, 'PlatformJson', './src/PlatformJson');
addProperty(module, 'ConfigParser', './src/ConfigParser/ConfigParser');
diff --git a/node_modules/cordova-common/package.json b/node_modules/cordova-common/package.json
index 6543ba3..b11116a 100644
--- a/node_modules/cordova-common/package.json
+++ b/node_modules/cordova-common/package.json
@@ -2,50 +2,50 @@
"_args": [
[
{
- "raw": "cordova-common@^1.4.0",
+ "raw": "cordova-common@*",
"scope": null,
"escapedName": "cordova-common",
"name": "cordova-common",
- "rawSpec": "^1.4.0",
- "spec": ">=1.4.0 <2.0.0",
+ "rawSpec": "*",
+ "spec": "*",
"type": "range"
},
- "d:\\cordova\\cordova-windows"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows"
]
],
- "_from": "cordova-common@>=1.4.0 <2.0.0",
- "_id": "cordova-common@1.4.0",
+ "_from": "cordova-common@*",
+ "_id": "cordova-common@2.0.0",
"_inCache": true,
- "_installable": true,
"_location": "/cordova-common",
- "_nodeVersion": "6.3.0",
+ "_nodeVersion": "6.6.0",
"_npmOperationalInternal": {
- "host": "packages-16-east.internal.npmjs.com",
- "tmp": "tmp/cordova-common-1.4.0.tgz_1469092638680_0.9961137105710804"
+ "host": "packages-18-east.internal.npmjs.com",
+ "tmp": "tmp/cordova-common-2.0.0.tgz_1485216738805_0.9605799505952746"
},
"_npmUser": {
- "name": "kotikov.vladimir",
- "email": "kotikov.vladimir@gmail.com"
+ "name": "stevegill",
+ "email": "stevengill97@gmail.com"
},
- "_npmVersion": "3.10.5",
+ "_npmVersion": "4.1.1",
"_phantomChildren": {},
"_requested": {
- "raw": "cordova-common@^1.4.0",
+ "raw": "cordova-common@*",
"scope": null,
"escapedName": "cordova-common",
"name": "cordova-common",
- "rawSpec": "^1.4.0",
- "spec": ">=1.4.0 <2.0.0",
+ "rawSpec": "*",
+ "spec": "*",
"type": "range"
},
"_requiredBy": [
+ "#USER",
"/"
],
- "_resolved": "file:cordova-common-1.4.0.tgz",
- "_shasum": "b3ba73595caa34fe8250ac11f20a4ed44e7c84e4",
+ "_resolved": "https://registry.npmjs.org/cordova-common/-/cordova-common-2.0.0.tgz",
+ "_shasum": "125097eb4b50b7353cec226ed21649192293ae97",
"_shrinkwrap": null,
- "_spec": "cordova-common@^1.4.0",
- "_where": "d:\\cordova\\cordova-windows",
+ "_spec": "cordova-common@*",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows",
"author": {
"name": "Apache Software Foundation"
},
@@ -71,18 +71,17 @@
},
"description": "Apache Cordova tools and platforms shared routines",
"devDependencies": {
- "istanbul": "^0.3.17",
- "jasmine-node": "^1.14.5",
+ "istanbul": "^0.4.5",
+ "jasmine": "^2.5.2",
"jshint": "^2.8.0",
"promise-matchers": "^0.9.6",
"rewire": "^2.5.1"
},
"directories": {},
"dist": {
- "shasum": "b3ba73595caa34fe8250ac11f20a4ed44e7c84e4",
- "tarball": "https://registry.npmjs.org/cordova-common/-/cordova-common-1.4.0.tgz"
+ "shasum": "125097eb4b50b7353cec226ed21649192293ae97",
+ "tarball": "https://registry.npmjs.org/cordova-common/-/cordova-common-2.0.0.tgz"
},
- "engineStrict": true,
"engines": {
"node": ">=0.9.9"
},
@@ -94,6 +93,10 @@
"email": "bowserj@apache.org"
},
{
+ "name": "filmaj",
+ "email": "maj.fil@gmail.com"
+ },
+ {
"name": "kotikov.vladimir",
"email": "kotikov.vladimir@gmail.com"
},
@@ -122,10 +125,10 @@
"url": "git://git-wip-us.apache.org/repos/asf/cordova-common.git"
},
"scripts": {
- "cover": "node node_modules/istanbul/lib/cli.js cover --root src --print detail node_modules/jasmine-node/bin/jasmine-node -- spec",
- "jasmine": "node node_modules/jasmine-node/bin/jasmine-node --captureExceptions --color spec",
- "jshint": "node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint spec",
+ "cover": "istanbul cover --root src --print detail jasmine",
+ "jasmine": "jasmine --captureExceptions --color",
+ "jshint": "jshint src && jshint spec",
"test": "npm run jshint && npm run jasmine"
},
- "version": "1.4.0"
+ "version": "2.0.0"
}
diff --git a/node_modules/cordova-common/src/ConfigChanges/ConfigChanges.js b/node_modules/cordova-common/src/ConfigChanges/ConfigChanges.js
index a395c6d..4a58132 100644
--- a/node_modules/cordova-common/src/ConfigChanges/ConfigChanges.js
+++ b/node_modules/cordova-common/src/ConfigChanges/ConfigChanges.js
@@ -1,21 +1,21 @@
-/*
- *
- * Copyright 2013 Anis Kadri
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
/*
* This module deals with shared configuration / dependency "stuff". That is:
@@ -31,11 +31,8 @@
/* jshint sub:true */
-var fs = require('fs'),
- path = require('path'),
+var path = require('path'),
et = require('elementtree'),
- semver = require('semver'),
- events = require('../events'),
ConfigKeeper = require('./ConfigKeeper'),
CordovaLogger = require('../CordovaLogger');
@@ -97,7 +94,10 @@
var plugin_vars = is_top_level ?
platform_config.installed_plugins[pluginInfo.id] :
platform_config.dependent_plugins[pluginInfo.id];
- var edit_config_changes = pluginInfo.getEditConfigs(self.platform);
+ var edit_config_changes = null;
+ if(pluginInfo.getEditConfigs) {
+ edit_config_changes = pluginInfo.getEditConfigs(self.platform);
+ }
// get config munge, aka how did this plugin change various config files
var config_munge = self.generate_plugin_config_munge(pluginInfo, plugin_vars, edit_config_changes);
@@ -106,18 +106,6 @@
var munge = mungeutil.decrement_munge(global_munge, config_munge);
for (var file in munge.files) {
- // CB-6976 Windows Universal Apps. Compatibility fix for existing plugins.
- if (self.platform == 'windows' && file == 'package.appxmanifest' &&
- !fs.existsSync(path.join(self.project_dir, 'package.appxmanifest'))) {
- // New windows template separate manifest files for Windows10, Windows8.1 and WP8.1
- var substs = ['package.phone.appxmanifest', 'package.windows.appxmanifest', 'package.windows10.appxmanifest'];
- /* jshint loopfunc:true */
- substs.forEach(function(subst) {
- events.emit('verbose', 'Applying munge to ' + subst);
- self.apply_file_munge(subst, munge.files[file], true);
- });
- /* jshint loopfunc:false */
- }
self.apply_file_munge(file, munge.files[file], /* remove = */ true);
}
@@ -131,7 +119,12 @@
function add_plugin_changes(pluginInfo, plugin_vars, is_top_level, should_increment, plugin_force) {
var self = this;
var platform_config = self.platformJson.root;
- var edit_config_changes = pluginInfo.getEditConfigs(self.platform);
+
+ var edit_config_changes = null;
+ if(pluginInfo.getEditConfigs) {
+ edit_config_changes = pluginInfo.getEditConfigs(self.platform);
+ }
+
var config_munge;
if (!edit_config_changes || edit_config_changes.length === 0) {
@@ -140,6 +133,11 @@
}
else {
var isConflictingInfo = is_conflicting(edit_config_changes, platform_config.config_munge, self, plugin_force);
+
+ if (isConflictingInfo.conflictWithConfigxml) {
+ throw new Error(pluginInfo.id +
+ ' cannot be added. <edit-config> changes in this plugin conflicts with <edit-config> changes in config.xml. Conflicts must be resolved before plugin can be added.');
+ }
if (plugin_force) {
CordovaLogger.get().log(CordovaLogger.WARN, '--force is used. edit-config will overwrite conflicts if any. Conflicting plugins may not work as expected.');
@@ -162,7 +160,67 @@
config_munge = self.generate_plugin_config_munge(pluginInfo, plugin_vars, edit_config_changes);
}
}
- // global munge looks at all plugins' changes to config files
+
+ self = munge_helper(should_increment, self, platform_config, config_munge);
+
+ // Move to installed/dependent_plugins
+ self.platformJson.addPlugin(pluginInfo.id, plugin_vars || {}, is_top_level);
+ return self;
+}
+
+
+// Handle edit-config changes from config.xml
+PlatformMunger.prototype.add_config_changes = add_config_changes;
+function add_config_changes(config, should_increment) {
+ var self = this;
+ var platform_config = self.platformJson.root;
+
+ var config_munge;
+ var edit_config_changes = null;
+ if(config.getEditConfigs) {
+ edit_config_changes = config.getEditConfigs(self.platform);
+ }
+
+ if (!edit_config_changes || edit_config_changes.length === 0) {
+ // There are no edit-config changes to add, return here
+ return self;
+ }
+ else {
+ var isConflictingInfo = is_conflicting(edit_config_changes, platform_config.config_munge, self, true /*always force overwrite other edit-config*/);
+
+ if(isConflictingInfo.conflictFound) {
+ var conflict_munge;
+ var conflict_file;
+
+ if (Object.keys(isConflictingInfo.configxmlMunge.files).length !== 0) {
+ // silently remove conflicting config.xml munges so new munges can be added
+ conflict_munge = mungeutil.decrement_munge(platform_config.config_munge, isConflictingInfo.configxmlMunge);
+ for (conflict_file in conflict_munge.files) {
+ self.apply_file_munge(conflict_file, conflict_munge.files[conflict_file], /* remove = */ true);
+ }
+ }
+ if (Object.keys(isConflictingInfo.conflictingMunge.files).length !== 0) {
+ CordovaLogger.get().log(CordovaLogger.WARN, 'Conflict found, edit-config changes from config.xml will overwrite plugin.xml changes');
+
+ // remove conflicting plugin.xml munges
+ conflict_munge = mungeutil.decrement_munge(platform_config.config_munge, isConflictingInfo.conflictingMunge);
+ for (conflict_file in conflict_munge.files) {
+ self.apply_file_munge(conflict_file, conflict_munge.files[conflict_file], /* remove = */ true);
+ }
+ }
+ }
+ // Add config.xml edit-config munges
+ config_munge = self.generate_config_xml_munge(config, edit_config_changes, 'config.xml');
+ }
+
+ self = munge_helper(should_increment, self, platform_config, config_munge);
+
+ // Move to installed/dependent_plugins
+ return self;
+}
+
+function munge_helper(should_increment, self, platform_config, config_munge) {
+ // global munge looks at all changes to config files
// TODO: The should_increment param is only used by cordova-cli and is going away soon.
// If should_increment is set to false, avoid modifying the global_munge (use clone)
@@ -177,22 +235,9 @@
}
for (var file in munge.files) {
- // CB-6976 Windows Universal Apps. Compatibility fix for existing plugins.
- if (self.platform == 'windows' && file == 'package.appxmanifest' &&
- !fs.existsSync(path.join(self.project_dir, 'package.appxmanifest'))) {
- var substs = ['package.phone.appxmanifest', 'package.windows.appxmanifest', 'package.windows10.appxmanifest'];
- /* jshint loopfunc:true */
- substs.forEach(function(subst) {
- events.emit('verbose', 'Applying munge to ' + subst);
- self.apply_file_munge(subst, munge.files[file]);
- });
- /* jshint loopfunc:false */
- }
self.apply_file_munge(file, munge.files[file]);
}
- // Move to installed/dependent_plugins
- self.platformJson.addPlugin(pluginInfo.id, plugin_vars || {}, is_top_level);
return self;
}
@@ -213,6 +258,39 @@
return self;
}
+// generate_plugin_config_munge
+// Generate the munge object from config.xml
+PlatformMunger.prototype.generate_config_xml_munge = generate_config_xml_munge;
+function generate_config_xml_munge(config, edit_config_changes, type) {
+
+ var munge = { files: {} };
+ var changes = edit_config_changes;
+ var id;
+
+ if(!changes) {
+ return munge;
+ }
+
+ if (type === 'config.xml') {
+ id = type;
+ }
+ else {
+ id = config.id;
+ }
+
+ changes.forEach(function(change) {
+ change.xmls.forEach(function(xml) {
+ // 1. stringify each xml
+ var stringified = (new et.ElementTree(xml)).write({xml_declaration:false});
+ // 2. add into munge
+ if (change.mode) {
+ mungeutil.deep_add(munge, change.file, change.target, { xml: stringified, count: 1, mode: change.mode, id: id });
+ }
+ });
+ });
+ return munge;
+}
+
// generate_plugin_config_munge
// Generate the munge object from plugin.xml + vars
@@ -228,92 +306,6 @@
Array.prototype.push.apply(changes, edit_config_changes);
}
- // Demux 'package.appxmanifest' into relevant platform-specific appx manifests.
- // Only spend the cycles if there are version-specific plugin settings
- if (self.platform === 'windows' &&
- changes.some(function(change) {
- return ((typeof change.versions !== 'undefined') ||
- (typeof change.deviceTarget !== 'undefined'));
- }))
- {
- var manifests = {
- 'windows': {
- '8.1.0': 'package.windows.appxmanifest',
- '10.0.0': 'package.windows10.appxmanifest'
- },
- 'phone': {
- '8.1.0': 'package.phone.appxmanifest',
- '10.0.0': 'package.windows10.appxmanifest'
- },
- 'all': {
- '8.1.0': ['package.windows.appxmanifest', 'package.phone.appxmanifest'],
- '10.0.0': 'package.windows10.appxmanifest'
- }
- };
-
- var oldChanges = changes;
- changes = [];
-
- oldChanges.forEach(function(change, changeIndex) {
- // Only support semver/device-target demux for package.appxmanifest
- // Pass through in case something downstream wants to use it
- if (change.target !== 'package.appxmanifest') {
- changes.push(change);
- return;
- }
-
- var hasVersion = (typeof change.versions !== 'undefined');
- var hasTargets = (typeof change.deviceTarget !== 'undefined');
-
- // No semver/device-target for this config-file, pass it through
- if (!(hasVersion || hasTargets)) {
- changes.push(change);
- return;
- }
-
- var targetDeviceSet = hasTargets ? change.deviceTarget : 'all';
- if (['windows', 'phone', 'all'].indexOf(targetDeviceSet) === -1) {
- // target-device couldn't be resolved, fix it up here to a valid value
- targetDeviceSet = 'all';
- }
- var knownWindowsVersionsForTargetDeviceSet = Object.keys(manifests[targetDeviceSet]);
-
- // at this point, 'change' targets package.appxmanifest and has a version attribute
- knownWindowsVersionsForTargetDeviceSet.forEach(function(winver) {
- // This is a local function that creates the new replacement representing the
- // mutation. Used to save code further down.
- var createReplacement = function(manifestFile, originalChange) {
- var replacement = {
- target: manifestFile,
- parent: originalChange.parent,
- after: originalChange.after,
- xmls: originalChange.xmls,
- versions: originalChange.versions,
- deviceTarget: originalChange.deviceTarget
- };
- return replacement;
- };
-
- // version doesn't satisfy, so skip
- if (hasVersion && !semver.satisfies(winver, change.versions)) {
- return;
- }
-
- var versionSpecificManifests = manifests[targetDeviceSet][winver];
- if (versionSpecificManifests.constructor === Array) {
- // e.g. all['8.1.0'] === ['pkg.windows.appxmanifest', 'pkg.phone.appxmanifest']
- versionSpecificManifests.forEach(function(manifestFile) {
- changes.push(createReplacement(manifestFile, change));
- });
- }
- else {
- // versionSpecificManifests is actually a single string
- changes.push(createReplacement(versionSpecificManifests, change));
- }
- });
- });
- }
-
changes.forEach(function(change) {
change.xmls.forEach(function(xml) {
// 1. stringify each xml
@@ -327,7 +319,9 @@
}
// 2. add into munge
if (change.mode) {
- mungeutil.deep_add(munge, change.file, change.target, { xml: stringified, count: 1, mode: change.mode, plugin: pluginInfo.id });
+ if (change.mode !== 'remove') {
+ mungeutil.deep_add(munge, change.file, change.target, { xml: stringified, count: 1, mode: change.mode, plugin: pluginInfo.id });
+ }
}
else {
mungeutil.deep_add(munge, change.target, change.parent, { xml: stringified, count: 1, after: change.after });
@@ -340,7 +334,9 @@
function is_conflicting(editchanges, config_munge, self, force) {
var files = config_munge.files;
var conflictFound = false;
+ var conflictWithConfigxml = false;
var conflictingMunge = { files: {} };
+ var configxmlMunge = { files: {} };
var conflictingParent;
var conflictingPlugin;
@@ -370,23 +366,43 @@
conflictingParent = editchange.target;
}
- if (target.length !== 0) {
- // conflict has been found, exit and throw an error
+ if (target && target.length !== 0) {
+ // conflict has been found
conflictFound = true;
- if (!force) {
- // since there has been modifications to the attributes at this target,
- // the current plugin should not modify the attributes
- conflictingPlugin = target[0].plugin;
- return;
- }
- // need to find all conflicts when --force is used, track conflicting munges
- mungeutil.deep_add(conflictingMunge, editchange.file, conflictingParent, target[0]);
+ if (editchange.id === 'config.xml') {
+ if (target[0].id === 'config.xml') {
+ // Keep track of config.xml/config.xml edit-config conflicts
+ mungeutil.deep_add(configxmlMunge, editchange.file, conflictingParent, target[0]);
+ }
+ else {
+ // Keep track of config.xml x plugin.xml edit-config conflicts
+ mungeutil.deep_add(conflictingMunge, editchange.file, conflictingParent, target[0]);
+ }
+ }
+ else {
+ if (target[0].id === 'config.xml') {
+ // plugin.xml cannot overwrite config.xml changes even if --force is used
+ conflictWithConfigxml = true;
+ return;
+ }
+
+ if (force) {
+ // Need to find all conflicts when --force is used, track conflicting munges
+ mungeutil.deep_add(conflictingMunge, editchange.file, conflictingParent, target[0]);
+ }
+ else {
+ // plugin cannot overwrite other plugin changes without --force
+ conflictingPlugin = target[0].plugin;
+ return;
+ }
+ }
}
}
});
- return {conflictFound: conflictFound, conflictingPlugin: conflictingPlugin, conflictingMunge: conflictingMunge};
+ return {conflictFound: conflictFound, conflictingPlugin: conflictingPlugin, conflictingMunge: conflictingMunge,
+ configxmlMunge: configxmlMunge, conflictWithConfigxml:conflictWithConfigxml};
}
// Go over the prepare queue and apply the config munges for each plugin
diff --git a/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js b/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js
index 179d54d..4a58008 100644
--- a/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js
+++ b/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js
@@ -110,6 +110,9 @@
case 'overwrite':
result = modules.xml_helpers.graftXMLOverwrite(self.data, xml_to_graft, selector, xml_child);
break;
+ case 'remove':
+ result= true;
+ break;
default:
result = modules.xml_helpers.graftXML(self.data, xml_to_graft, selector, xml_child.after);
}
@@ -137,6 +140,9 @@
case 'overwrite':
result = modules.xml_helpers.pruneXMLRestore(self.data, selector, xml_child);
break;
+ case 'remove':
+ result = modules.xml_helpers.prunXMLRemove(self.data, selector, xml_to_graft);
+ break;
default:
result = modules.xml_helpers.pruneXML(self.data, xml_to_graft, selector);
}
@@ -193,6 +199,12 @@
return filepath;
}
+ // XXX this checks for android studio projects
+ // only if none of the options above are satisfied does this get called
+ if(platform === 'android' && !fs.existsSync(filepath)) {
+ filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'xml', 'config.xml');
+ }
+
// None of the special cases matched, returning project_dir/file.
return filepath;
}
diff --git a/node_modules/cordova-common/src/ConfigParser/ConfigParser.js b/node_modules/cordova-common/src/ConfigParser/ConfigParser.js
index aae59db..e477a89 100644
--- a/node_modules/cordova-common/src/ConfigParser/ConfigParser.js
+++ b/node_modules/cordova-common/src/ConfigParser/ConfigParser.js
@@ -90,20 +90,24 @@
}
ConfigParser.prototype = {
+ getAttribute: function(attr) {
+ return this.doc.getroot().attrib[attr];
+ },
+
packageName: function(id) {
- return this.doc.getroot().attrib['id'];
+ return this.getAttribute('id');
},
setPackageName: function(id) {
this.doc.getroot().attrib['id'] = id;
},
android_packageName: function() {
- return this.doc.getroot().attrib['android-packageName'];
+ return this.getAttribute('android-packageName');
},
android_activityName: function() {
- return this.doc.getroot().attrib['android-activityName'];
+ return this.getAttribute('android-activityName');
},
ios_CFBundleIdentifier: function() {
- return this.doc.getroot().attrib['ios-CFBundleIdentifier'];
+ return this.getAttribute('ios-CFBundleIdentifier');
},
name: function() {
return getNodeTextSafe(this.doc.find('name'));
@@ -120,16 +124,16 @@
el.text = text;
},
version: function() {
- return this.doc.getroot().attrib['version'];
+ return this.getAttribute('version');
},
windows_packageVersion: function() {
- return this.doc.getroot().attrib('windows-packageVersion');
+ return this.getAttribute('windows-packageVersion');
},
android_versionCode: function() {
- return this.doc.getroot().attrib['android-versionCode'];
+ return this.getAttribute('android-versionCode');
},
ios_CFBundleVersion: function() {
- return this.doc.getroot().attrib['ios-CFBundleVersion'];
+ return this.getAttribute('ios-CFBundleVersion');
},
setVersion: function(value) {
this.doc.getroot().attrib['version'] = value;
@@ -253,6 +257,30 @@
},
/**
+ * Returns all resource-files for a specific platform.
+ * @param {string} platform Platform name
+ * @return {Resource[]} Array of resource file objects.
+ */
+ getFileResources: function(platform) {
+ var fileResources = [];
+
+ if (platform) { // platform specific resources
+ fileResources = this.doc.findall('platform[@name=\'' + platform + '\']/resource-file').map(function(tag) {
+ return {
+ platform: platform,
+ src: tag.attrib.src,
+ target: tag.attrib.target,
+ versions: tag.attrib.versions,
+ deviceTarget: tag.attrib['device-target'],
+ arch: tag.attrib.arch
+ };
+ });
+ }
+
+ return fileResources;
+ },
+
+ /**
* Returns all hook scripts for the hook type specified.
* @param {String} hook The hook type.
* @param {Array} platforms Platforms to look for scripts into (root scripts will be included as well).
@@ -444,10 +472,19 @@
return accesses.map(function(access){
var minimum_tls_version = access.attrib['minimum-tls-version']; /* String */
var requires_forward_secrecy = access.attrib['requires-forward-secrecy']; /* Boolean */
+ var requires_certificate_transparency = access.attrib['requires-certificate-transparency']; /* Boolean */
+ var allows_arbitrary_loads_in_web_content = access.attrib['allows-arbitrary-loads-in-web-content']; /* Boolean */
+ var allows_arbitrary_loads_in_media = access.attrib['allows-arbitrary-loads-in-media']; /* Boolean */
+ var allows_local_networking = access.attrib['allows-local-networking']; /* Boolean */
+
return {
'origin': access.attrib.origin,
'minimum_tls_version': minimum_tls_version,
- 'requires_forward_secrecy' : requires_forward_secrecy
+ 'requires_forward_secrecy' : requires_forward_secrecy,
+ 'requires_certificate_transparency' : requires_certificate_transparency,
+ 'allows_arbitrary_loads_in_web_content' : allows_arbitrary_loads_in_web_content,
+ 'allows_arbitrary_loads_in_media' : allows_arbitrary_loads_in_media,
+ 'allows_local_networking' : allows_local_networking
};
});
},
@@ -457,13 +494,44 @@
return allow_navigations.map(function(allow_navigation){
var minimum_tls_version = allow_navigation.attrib['minimum-tls-version']; /* String */
var requires_forward_secrecy = allow_navigation.attrib['requires-forward-secrecy']; /* Boolean */
+ var requires_certificate_transparency = allow_navigation.attrib['requires-certificate-transparency']; /* Boolean */
+
return {
'href': allow_navigation.attrib.href,
'minimum_tls_version': minimum_tls_version,
- 'requires_forward_secrecy' : requires_forward_secrecy
+ 'requires_forward_secrecy' : requires_forward_secrecy,
+ 'requires_certificate_transparency' : requires_certificate_transparency
};
});
},
+ /* Get all the allow-intent tags */
+ getAllowIntents: function() {
+ var allow_intents = this.doc.findall('./allow-intent');
+ return allow_intents.map(function(allow_intent){
+ return {
+ 'href': allow_intent.attrib.href
+ };
+ });
+ },
+ /* Get all edit-config tags */
+ getEditConfigs: function(platform) {
+ var platform_tag = this.doc.find('./platform[@name="' + platform + '"]');
+ var platform_edit_configs = platform_tag ? platform_tag.findall('edit-config') : [];
+
+ var edit_configs = this.doc.findall('edit-config').concat(platform_edit_configs);
+
+ return edit_configs.map(function(tag) {
+ var editConfig =
+ {
+ file : tag.attrib['file'],
+ target : tag.attrib['target'],
+ mode : tag.attrib['mode'],
+ id : 'config.xml',
+ xmls : tag.getchildren()
+ };
+ return editConfig;
+ });
+ },
write:function() {
fs.writeFileSync(this.path, this.doc.write({indent: 4}), 'utf-8');
}
diff --git a/node_modules/cordova-common/src/CordovaCheck.js b/node_modules/cordova-common/src/CordovaCheck.js
new file mode 100644
index 0000000..46e733f
--- /dev/null
+++ b/node_modules/cordova-common/src/CordovaCheck.js
@@ -0,0 +1,76 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var fs = require('fs'),
+ path = require('path');
+
+function isRootDir(dir) {
+ if (fs.existsSync(path.join(dir, 'www'))) {
+ if (fs.existsSync(path.join(dir, 'config.xml'))) {
+ // For sure is.
+ if (fs.existsSync(path.join(dir, 'platforms'))) {
+ return 2;
+ } else {
+ return 1;
+ }
+ }
+ // Might be (or may be under platforms/).
+ if (fs.existsSync(path.join(dir, 'www', 'config.xml'))) {
+ return 1;
+ }
+ }
+ return 0;
+}
+
+// Runs up the directory chain looking for a .cordova directory.
+// IF it is found we are in a Cordova project.
+// Omit argument to use CWD.
+function isCordova(dir) {
+ if (!dir) {
+ // Prefer PWD over cwd so that symlinked dirs within your PWD work correctly (CB-5687).
+ var pwd = process.env.PWD;
+ var cwd = process.cwd();
+ if (pwd && pwd != cwd && pwd != 'undefined') {
+ return isCordova(pwd) || isCordova(cwd);
+ }
+ return isCordova(cwd);
+ }
+ var bestReturnValueSoFar = false;
+ for (var i = 0; i < 1000; ++i) {
+ var result = isRootDir(dir);
+ if (result === 2) {
+ return dir;
+ }
+ if (result === 1) {
+ bestReturnValueSoFar = dir;
+ }
+ var parentDir = path.normalize(path.join(dir, '..'));
+ // Detect fs root.
+ if (parentDir == dir) {
+ return bestReturnValueSoFar;
+ }
+ dir = parentDir;
+ }
+ console.error('Hit an unhandled case in CordovaCheck.isCordova');
+ return false;
+}
+
+module.exports = {
+ findProjectRoot : isCordova
+};
diff --git a/node_modules/cordova-common/src/FileUpdater.js b/node_modules/cordova-common/src/FileUpdater.js
index a09f39c..8b6876b 100644
--- a/node_modules/cordova-common/src/FileUpdater.js
+++ b/node_modules/cordova-common/src/FileUpdater.js
@@ -285,14 +285,14 @@
}
// Scan the files in each of the source directories.
- var sourceMaps = [];
- for (var i in sourceDirs) {
- var sourceFullPath = path.join(rootDir, sourceDirs[i]);
- if (!fs.existsSync(sourceFullPath)) {
- throw new Error("Source directory does not exist: " + sourceDirs[i]);
- }
- sourceMaps[i] = mapDirectory(rootDir, sourceDirs[i], include, exclude);
- }
+ var sourceMaps = sourceDirs.map(function (sourceDir) {
+ return path.join(rootDir, sourceDir);
+ }).map(function (sourcePath) {
+ if (!fs.existsSync(sourcePath)) {
+ throw new Error("Source directory does not exist: " + sourcePath);
+ }
+ return mapDirectory(rootDir, path.relative(rootDir, sourcePath), include, exclude);
+ });
// Scan the files in the target directory, if it exists.
var targetMap = {};
@@ -331,46 +331,40 @@
function mapSubdirectory(rootDir, subDir, relativeDir, include, exclude, dirMap) {
var itemMapped = false;
var items = fs.readdirSync(path.join(rootDir, subDir, relativeDir));
- for (var i in items) {
- var relativePath = path.join(relativeDir, items[i]);
- // Skip any files or directories (and everything under) that match an exclude glob.
- if (matchGlobArray(relativePath, exclude)) {
- continue;
- }
+ items.forEach(function(item) {
+ var relativePath = path.join(relativeDir, item);
+ if(!matchGlobArray(relativePath, exclude)) {
+ // Stats obtained here (required at least to know where to recurse in directories)
+ // are saved for later, where the modified times may also be used. This minimizes
+ // the number of file I/O operations performed.
+ var fullPath = path.join(rootDir, subDir, relativePath);
+ var stats = fs.statSync(fullPath);
- // Stats obtained here (required at least to know where to recurse in directories)
- // are saved for later, where the modified times may also be used. This minimizes
- // the number of file I/O operations performed.
- var fullPath = path.join(rootDir, subDir, relativePath);
- var stats = fs.statSync(fullPath);
-
- if (stats.isDirectory()) {
- // Directories are included if either something under them is included or they
- // match an include glob.
- if (mapSubdirectory(rootDir, subDir, relativePath, include, exclude, dirMap) ||
- matchGlobArray(relativePath, include)) {
- dirMap[relativePath] = { subDir: subDir, stats: stats };
- itemMapped = true;
- }
- } else if (stats.isFile()) {
- // Files are included only if they match an include glob.
- if (matchGlobArray(relativePath, include)) {
- dirMap[relativePath] = { subDir: subDir, stats: stats };
- itemMapped = true;
+ if (stats.isDirectory()) {
+ // Directories are included if either something under them is included or they
+ // match an include glob.
+ if (mapSubdirectory(rootDir, subDir, relativePath, include, exclude, dirMap) ||
+ matchGlobArray(relativePath, include)) {
+ dirMap[relativePath] = { subDir: subDir, stats: stats };
+ itemMapped = true;
+ }
+ } else if (stats.isFile()) {
+ // Files are included only if they match an include glob.
+ if (matchGlobArray(relativePath, include)) {
+ dirMap[relativePath] = { subDir: subDir, stats: stats };
+ itemMapped = true;
+ }
}
}
- }
+ });
return itemMapped;
}
function matchGlobArray(path, globs) {
- for (var i in globs) {
- if (minimatch(path, globs[i])) {
- return true;
- }
- }
- return false;
+ return globs.some(function(elem) {
+ return minimatch(path, elem, {dot:true});
+ });
}
}
@@ -384,7 +378,7 @@
// Target stats will be filled in below for targets that exist.
var pathMap = {};
sourceMaps.forEach(function (sourceMap) {
- for (var sourceSubPath in sourceMap) {
+ Object.keys(sourceMap).forEach(function(sourceSubPath){
var sourceEntry = sourceMap[sourceSubPath];
pathMap[sourceSubPath] = {
targetPath: path.join(targetDir, sourceSubPath),
@@ -392,12 +386,12 @@
sourcePath: path.join(sourceEntry.subDir, sourceSubPath),
sourceStats: sourceEntry.stats
};
- }
+ });
});
// Fill in target stats for targets that exist, and create entries
// for targets that don't have any corresponding sources.
- for (var subPath in targetMap) {
+ Object.keys(targetMap).forEach(function(subPath){
var entry = pathMap[subPath];
if (entry) {
entry.targetStats = targetMap[subPath].stats;
@@ -409,7 +403,7 @@
sourceStats: null
};
}
- }
+ });
return pathMap;
}
diff --git a/node_modules/cordova-common/src/PluginInfo/PluginInfo.js b/node_modules/cordova-common/src/PluginInfo/PluginInfo.js
index bf1f75b..44501fa 100644
--- a/node_modules/cordova-common/src/PluginInfo/PluginInfo.js
+++ b/node_modules/cordova-common/src/PluginInfo/PluginInfo.js
@@ -225,7 +225,8 @@
target: tag.attrib.target,
versions: tag.attrib.versions,
deviceTarget: tag.attrib['device-target'],
- arch: tag.attrib.arch
+ arch: tag.attrib.arch,
+ reference: tag.attrib.reference
};
});
return resourceFiles;
@@ -318,11 +319,13 @@
parent: el.attrib.parent,
custom: isStrTrue(el.attrib.custom),
src: el.attrib.src,
+ spec: el.attrib.spec,
weak: isStrTrue(el.attrib.weak),
versions: el.attrib.versions,
targetDir: el.attrib['target-dir'],
deviceTarget: el.attrib['device-target'] || el.attrib.target,
- arch: el.attrib.arch
+ arch: el.attrib.arch,
+ implementation: el.attrib.implementation
};
return ret;
});
diff --git a/node_modules/cordova-common/src/util/plist-helpers.js b/node_modules/cordova-common/src/util/plist-helpers.js
index 9dee5c6..38eb31b 100644
--- a/node_modules/cordova-common/src/util/plist-helpers.js
+++ b/node_modules/cordova-common/src/util/plist-helpers.js
@@ -1,21 +1,21 @@
-/*
- *
- * Copyright 2013 Brett Rudd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
// contains PLIST utility functions
var __ = require('underscore');
diff --git a/node_modules/cordova-common/src/util/xml-helpers.js b/node_modules/cordova-common/src/util/xml-helpers.js
index f16eaaf..b4b0490 100644
--- a/node_modules/cordova-common/src/util/xml-helpers.js
+++ b/node_modules/cordova-common/src/util/xml-helpers.js
@@ -1,21 +1,21 @@
-/*
- *
- * Copyright 2013 Anis Kadri
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
/* jshint sub:true, laxcomma:true */
@@ -44,23 +44,9 @@
return false;
}
- var oneAttribKeys = Object.keys(one.attrib),
- twoAttribKeys = Object.keys(two.attrib),
- i = 0, attribName;
+ if (!attribMatch(one, two)) return false;
- if (oneAttribKeys.length != twoAttribKeys.length) {
- return false;
- }
-
- for (i; i < oneAttribKeys.length; i++) {
- attribName = oneAttribKeys[i];
-
- if (one.attrib[attribName] != two.attrib[attribName]) {
- return false;
- }
- }
-
- for (i; i < one._children.length; i++) {
+ for (var i = 0; i < one._children.length; i++) {
if (!module.exports.equalNodes(one._children[i], two._children[i])) {
return false;
}
@@ -174,6 +160,23 @@
return true;
},
+ prunXMLRemove: function(doc, selector, nodes) {
+ var target = module.exports.resolveParent(doc, selector);
+ if (!target) return false;
+
+ nodes.forEach(function (node) {
+ var attributes = node.attrib;
+ for (var attribute in attributes) {
+ if (target.attrib[attribute]) {
+ delete target.attrib[attribute];
+ }
+ }
+ });
+
+ return true;
+
+ },
+
parseElementtreeSync: function (filename) {
var contents = fs.readFileSync(filename, 'utf-8');
@@ -287,33 +290,30 @@
query = srcTag + '',
shouldMerge = true;
- if (BLACKLIST.indexOf(srcTag) === -1) {
- if (SINGLETONS.indexOf(srcTag) !== -1) {
- foundChild = dest.find(query);
- if (foundChild) {
- destChild = foundChild;
- dest.remove(destChild);
- }
- } else {
- //Check for an exact match and if you find one don't add
- Object.getOwnPropertyNames(srcChild.attrib).forEach(function (attribute) {
- query += '[@' + attribute + '="' + srcChild.attrib[attribute] + '"]';
- });
- var foundChildren = dest.findall(query);
- for(var i = 0; i < foundChildren.length; i++) {
- foundChild = foundChildren[i];
- if (foundChild && textMatch(srcChild, foundChild) && (Object.keys(srcChild.attrib).length==Object.keys(foundChild.attrib).length)) {
- destChild = foundChild;
- dest.remove(destChild);
- shouldMerge = false;
- break;
- }
- }
- }
+ if (BLACKLIST.indexOf(srcTag) !== -1) return;
- mergeXml(srcChild, destChild, platform, clobber && shouldMerge);
- dest.append(destChild);
+ if (SINGLETONS.indexOf(srcTag) !== -1) {
+ foundChild = dest.find(query);
+ if (foundChild) {
+ destChild = foundChild;
+ dest.remove(destChild);
+ }
+ } else {
+ //Check for an exact match and if you find one don't add
+ var mergeCandidates = dest.findall(query)
+ .filter(function (foundChild) {
+ return foundChild && textMatch(srcChild, foundChild) && attribMatch(srcChild, foundChild);
+ });
+
+ if (mergeCandidates.length > 0) {
+ destChild = mergeCandidates[0];
+ dest.remove(destChild);
+ shouldMerge = false;
+ }
}
+
+ mergeXml(srcChild, destChild, platform, clobber && shouldMerge);
+ dest.append(destChild);
}
function removeDuplicatePreferences(xml) {
@@ -345,3 +345,22 @@
text2 = elm2.text ? elm2.text.replace(/\s+/, '') : '';
return (text1 === '' || text1 === text2);
}
+
+function attribMatch(one, two) {
+ var oneAttribKeys = Object.keys(one.attrib);
+ var twoAttribKeys = Object.keys(two.attrib);
+
+ if (oneAttribKeys.length != twoAttribKeys.length) {
+ return false;
+ }
+
+ for (var i = 0; i < oneAttribKeys.length; i++) {
+ var attribName = oneAttribKeys[i];
+
+ if (one.attrib[attribName] != two.attrib[attribName]) {
+ return false;
+ }
+ }
+
+ return true;
+}
diff --git a/node_modules/cordova-registry-mapper/package.json b/node_modules/cordova-registry-mapper/package.json
index efc11ba..033e444 100644
--- a/node_modules/cordova-registry-mapper/package.json
+++ b/node_modules/cordova-registry-mapper/package.json
@@ -10,13 +10,12 @@
"spec": ">=1.1.8 <2.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\cordova-common"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/cordova-common"
]
],
"_from": "cordova-registry-mapper@>=1.1.8 <2.0.0",
"_id": "cordova-registry-mapper@1.1.15",
"_inCache": true,
- "_installable": true,
"_location": "/cordova-registry-mapper",
"_nodeVersion": "5.4.1",
"_npmUser": {
@@ -41,7 +40,7 @@
"_shasum": "e244b9185b8175473bff6079324905115f83dc7c",
"_shrinkwrap": null,
"_spec": "cordova-registry-mapper@^1.1.8",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\cordova-common",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/cordova-common",
"author": {
"name": "Steve Gill"
},
diff --git a/node_modules/elementtree/Makefile b/node_modules/elementtree/Makefile
old mode 100644
new mode 100755
diff --git a/node_modules/elementtree/package.json b/node_modules/elementtree/package.json
index 460b831..f164ea7 100644
--- a/node_modules/elementtree/package.json
+++ b/node_modules/elementtree/package.json
@@ -10,7 +10,7 @@
"spec": ">=0.1.6 <0.2.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows"
+ "/Users/steveng/repo/cordova/cordova-windows"
]
],
"_from": "elementtree@>=0.1.6 <0.2.0",
@@ -37,11 +37,11 @@
"/",
"/cordova-common"
],
- "_resolved": "https://registry.npmjs.org/elementtree/-/elementtree-0.1.6.tgz",
+ "_resolved": "http://registry.npmjs.org/elementtree/-/elementtree-0.1.6.tgz",
"_shasum": "2ac4c46ea30516c8c4cbdb5e3ac7418e592de20c",
"_shrinkwrap": null,
"_spec": "elementtree@^0.1.6",
- "_where": "d:\\cordova\\cordova-windows",
+ "_where": "/Users/steveng/repo/cordova/cordova-windows",
"author": {
"name": "Rackspace US, Inc."
},
diff --git a/node_modules/glob/package.json b/node_modules/glob/package.json
index 4b56ba5..9b917aa 100644
--- a/node_modules/glob/package.json
+++ b/node_modules/glob/package.json
@@ -10,13 +10,12 @@
"spec": ">=5.0.13 <6.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\cordova-common"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/cordova-common"
]
],
"_from": "glob@>=5.0.13 <6.0.0",
"_id": "glob@5.0.15",
"_inCache": true,
- "_installable": true,
"_location": "/glob",
"_nodeVersion": "4.0.0",
"_npmUser": {
@@ -41,7 +40,7 @@
"_shasum": "1bc936b9e02f4a603fcc222ecf7633d30b8b93b1",
"_shrinkwrap": null,
"_spec": "glob@^5.0.13",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\cordova-common",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/cordova-common",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
diff --git a/node_modules/inflight/inflight.js b/node_modules/inflight/inflight.js
index 8bc96cb..48202b3 100644
--- a/node_modules/inflight/inflight.js
+++ b/node_modules/inflight/inflight.js
@@ -19,18 +19,28 @@
var cbs = reqs[key]
var len = cbs.length
var args = slice(arguments)
- for (var i = 0; i < len; i++) {
- cbs[i].apply(null, args)
- }
- if (cbs.length > len) {
- // added more in the interim.
- // de-zalgo, just in case, but don't call again.
- cbs.splice(0, len)
- process.nextTick(function () {
- RES.apply(null, args)
- })
- } else {
- delete reqs[key]
+
+ // XXX It's somewhat ambiguous whether a new callback added in this
+ // pass should be queued for later execution if something in the
+ // list of callbacks throws, or if it should just be discarded.
+ // However, it's such an edge case that it hardly matters, and either
+ // choice is likely as surprising as the other.
+ // As it happens, we do go ahead and schedule it for later execution.
+ try {
+ for (var i = 0; i < len; i++) {
+ cbs[i].apply(null, args)
+ }
+ } finally {
+ if (cbs.length > len) {
+ // added more in the interim.
+ // de-zalgo, just in case, but don't call again.
+ cbs.splice(0, len)
+ process.nextTick(function () {
+ RES.apply(null, args)
+ })
+ } else {
+ delete reqs[key]
+ }
}
})
}
diff --git a/node_modules/inflight/package.json b/node_modules/inflight/package.json
index 6c53c7b..eb83c6a 100644
--- a/node_modules/inflight/package.json
+++ b/node_modules/inflight/package.json
@@ -10,24 +10,23 @@
"spec": ">=1.0.4 <2.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\glob"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/glob"
]
],
"_from": "inflight@>=1.0.4 <2.0.0",
- "_id": "inflight@1.0.5",
+ "_id": "inflight@1.0.6",
"_inCache": true,
- "_installable": true,
"_location": "/inflight",
- "_nodeVersion": "5.10.1",
+ "_nodeVersion": "6.5.0",
"_npmOperationalInternal": {
- "host": "packages-12-west.internal.npmjs.com",
- "tmp": "tmp/inflight-1.0.5.tgz_1463529611443_0.00041943578980863094"
+ "host": "packages-16-east.internal.npmjs.com",
+ "tmp": "tmp/inflight-1.0.6.tgz_1476330807696_0.10388551792129874"
},
"_npmUser": {
- "name": "zkat",
- "email": "kat@sykosomatic.org"
+ "name": "isaacs",
+ "email": "i@izs.me"
},
- "_npmVersion": "3.9.1",
+ "_npmVersion": "3.10.7",
"_phantomChildren": {},
"_requested": {
"raw": "inflight@^1.0.4",
@@ -41,11 +40,11 @@
"_requiredBy": [
"/glob"
],
- "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz",
- "_shasum": "db3204cd5a9de2e6cd890b85c6e2f66bcf4f620a",
+ "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
+ "_shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9",
"_shrinkwrap": null,
"_spec": "inflight@^1.0.4",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\glob",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/glob",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
@@ -60,17 +59,17 @@
},
"description": "Add callbacks to requests in flight to avoid async duplication",
"devDependencies": {
- "tap": "^1.2.0"
+ "tap": "^7.1.2"
},
"directories": {},
"dist": {
- "shasum": "db3204cd5a9de2e6cd890b85c6e2f66bcf4f620a",
- "tarball": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz"
+ "shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9",
+ "tarball": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz"
},
"files": [
"inflight.js"
],
- "gitHead": "559e37b4f6327fca797fe8d7fe8ed6d9cae08821",
+ "gitHead": "a547881738c8f57b27795e584071d67cf6ac1a57",
"homepage": "https://github.com/isaacs/inflight",
"license": "ISC",
"main": "inflight.js",
@@ -100,7 +99,7 @@
"url": "git+https://github.com/npm/inflight.git"
},
"scripts": {
- "test": "tap test.js"
+ "test": "tap test.js --100"
},
- "version": "1.0.5"
+ "version": "1.0.6"
}
diff --git a/node_modules/inherits/inherits.js b/node_modules/inherits/inherits.js
index 29f5e24..3b94763 100644
--- a/node_modules/inherits/inherits.js
+++ b/node_modules/inherits/inherits.js
@@ -1 +1,7 @@
-module.exports = require('util').inherits
+try {
+ var util = require('util');
+ if (typeof util.inherits !== 'function') throw '';
+ module.exports = util.inherits;
+} catch (e) {
+ module.exports = require('./inherits_browser.js');
+}
diff --git a/node_modules/inherits/package.json b/node_modules/inherits/package.json
index d06c97d..3b7de0e 100644
--- a/node_modules/inherits/package.json
+++ b/node_modules/inherits/package.json
@@ -10,19 +10,23 @@
"spec": ">=2.0.0 <3.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\glob"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/glob"
]
],
"_from": "inherits@>=2.0.0 <3.0.0",
- "_id": "inherits@2.0.1",
+ "_id": "inherits@2.0.3",
"_inCache": true,
- "_installable": true,
"_location": "/inherits",
+ "_nodeVersion": "6.5.0",
+ "_npmOperationalInternal": {
+ "host": "packages-16-east.internal.npmjs.com",
+ "tmp": "tmp/inherits-2.0.3.tgz_1473295776489_0.08142363070510328"
+ },
"_npmUser": {
"name": "isaacs",
"email": "i@izs.me"
},
- "_npmVersion": "1.3.8",
+ "_npmVersion": "3.10.7",
"_phantomChildren": {},
"_requested": {
"raw": "inherits@2",
@@ -36,23 +40,30 @@
"_requiredBy": [
"/glob"
],
- "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
- "_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1",
+ "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
+ "_shasum": "633c2c83e3da42a502f52466022480f4208261de",
"_shrinkwrap": null,
"_spec": "inherits@2",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\glob",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/glob",
"browser": "./inherits_browser.js",
"bugs": {
"url": "https://github.com/isaacs/inherits/issues"
},
"dependencies": {},
"description": "Browser-friendly inheritance fully compatible with standard node.js inherits()",
- "devDependencies": {},
+ "devDependencies": {
+ "tap": "^7.1.0"
+ },
"directories": {},
"dist": {
- "shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1",
- "tarball": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
+ "shasum": "633c2c83e3da42a502f52466022480f4208261de",
+ "tarball": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz"
},
+ "files": [
+ "inherits.js",
+ "inherits_browser.js"
+ ],
+ "gitHead": "e05d0fb27c61a3ec687214f0476386b765364d5f",
"homepage": "https://github.com/isaacs/inherits#readme",
"keywords": [
"inheritance",
@@ -82,5 +93,5 @@
"scripts": {
"test": "node test"
},
- "version": "2.0.1"
+ "version": "2.0.3"
}
diff --git a/node_modules/inherits/test.js b/node_modules/inherits/test.js
deleted file mode 100644
index fc53012..0000000
--- a/node_modules/inherits/test.js
+++ /dev/null
@@ -1,25 +0,0 @@
-var inherits = require('./inherits.js')
-var assert = require('assert')
-
-function test(c) {
- assert(c.constructor === Child)
- assert(c.constructor.super_ === Parent)
- assert(Object.getPrototypeOf(c) === Child.prototype)
- assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype)
- assert(c instanceof Child)
- assert(c instanceof Parent)
-}
-
-function Child() {
- Parent.call(this)
- test(this)
-}
-
-function Parent() {}
-
-inherits(Child, Parent)
-
-var c = new Child
-test(c)
-
-console.log('ok')
diff --git a/node_modules/lodash/package.json b/node_modules/lodash/package.json
index 0355ec0..72f2357 100644
--- a/node_modules/lodash/package.json
+++ b/node_modules/lodash/package.json
@@ -10,13 +10,12 @@
"spec": ">=3.5.0 <4.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\xmlbuilder"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/xmlbuilder"
]
],
"_from": "lodash@>=3.5.0 <4.0.0",
"_id": "lodash@3.10.1",
"_inCache": true,
- "_installable": true,
"_location": "/lodash",
"_nodeVersion": "0.12.5",
"_npmUser": {
@@ -41,7 +40,7 @@
"_shasum": "5bf45e8e49ba4189e17d482789dfd15bd140b7b6",
"_shrinkwrap": null,
"_spec": "lodash@^3.5.0",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\xmlbuilder",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/xmlbuilder",
"author": {
"name": "John-David Dalton",
"email": "john.david.dalton@gmail.com",
diff --git a/node_modules/minimatch/minimatch.js b/node_modules/minimatch/minimatch.js
index 830a272..5b5f8cf 100644
--- a/node_modules/minimatch/minimatch.js
+++ b/node_modules/minimatch/minimatch.js
@@ -9,6 +9,14 @@
var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
var expand = require('brace-expansion')
+var plTypes = {
+ '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
+ '?': { open: '(?:', close: ')?' },
+ '+': { open: '(?:', close: ')+' },
+ '*': { open: '(?:', close: ')*' },
+ '@': { open: '(?:', close: ')' }
+}
+
// any single thing other than /
// don't need to escape / when using new RegExp()
var qmark = '[^/]'
@@ -277,7 +285,6 @@
// ? => one single character
var patternListStack = []
var negativeLists = []
- var plType
var stateChar
var inClass = false
var reClassStart = -1
@@ -376,11 +383,12 @@
continue
}
- plType = stateChar
patternListStack.push({
- type: plType,
+ type: stateChar,
start: i - 1,
- reStart: re.length
+ reStart: re.length,
+ open: plTypes[stateChar].open,
+ close: plTypes[stateChar].close
})
// negation is (?:(?!js)[^/]*)
re += stateChar === '!' ? '(?:(?!(?:' : '(?:'
@@ -396,24 +404,14 @@
clearStateChar()
hasMagic = true
- re += ')'
var pl = patternListStack.pop()
- plType = pl.type
// negation is (?:(?!js)[^/]*)
// The others are (?:<pattern>)<type>
- switch (plType) {
- case '!':
- negativeLists.push(pl)
- re += ')[^/]*?)'
- pl.reEnd = re.length
- break
- case '?':
- case '+':
- case '*':
- re += plType
- break
- case '@': break // the default anyway
+ re += pl.close
+ if (pl.type === '!') {
+ negativeLists.push(pl)
}
+ pl.reEnd = re.length
continue
case '|':
@@ -520,7 +518,8 @@
// Go through and escape them, taking care not to double-escape any
// | chars that were already escaped.
for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
- var tail = re.slice(pl.reStart + 3)
+ var tail = re.slice(pl.reStart + pl.open.length)
+ this.debug('setting tail', re, pl)
// maybe some even number of \, then maybe 1 \, followed by a |
tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) {
if (!$2) {
@@ -537,7 +536,7 @@
return $1 + $1 + $2 + '|'
})
- this.debug('tail=%j\n %s', tail, tail)
+ this.debug('tail=%j\n %s', tail, tail, pl, re)
var t = pl.type === '*' ? star
: pl.type === '?' ? qmark
: '\\' + pl.type
diff --git a/node_modules/minimatch/package.json b/node_modules/minimatch/package.json
index 7e5c1f5..65a3f07 100644
--- a/node_modules/minimatch/package.json
+++ b/node_modules/minimatch/package.json
@@ -10,24 +10,23 @@
"spec": ">=3.0.0 <4.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\cordova-common"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/cordova-common"
]
],
"_from": "minimatch@>=3.0.0 <4.0.0",
- "_id": "minimatch@3.0.2",
+ "_id": "minimatch@3.0.3",
"_inCache": true,
- "_installable": true,
"_location": "/minimatch",
"_nodeVersion": "4.4.4",
"_npmOperationalInternal": {
- "host": "packages-16-east.internal.npmjs.com",
- "tmp": "tmp/minimatch-3.0.2.tgz_1466194379770_0.11417287751100957"
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/minimatch-3.0.3.tgz_1470678322731_0.1892083385027945"
},
"_npmUser": {
"name": "isaacs",
"email": "i@izs.me"
},
- "_npmVersion": "3.9.1",
+ "_npmVersion": "3.10.6",
"_phantomChildren": {},
"_requested": {
"raw": "minimatch@^3.0.0",
@@ -42,11 +41,11 @@
"/cordova-common",
"/glob"
],
- "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.2.tgz",
- "_shasum": "0f398a7300ea441e9c348c83d98ab8c9dbf9c40a",
+ "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz",
+ "_shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774",
"_shrinkwrap": null,
"_spec": "minimatch@^3.0.0",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\cordova-common",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/cordova-common",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
@@ -65,8 +64,8 @@
},
"directories": {},
"dist": {
- "shasum": "0f398a7300ea441e9c348c83d98ab8c9dbf9c40a",
- "tarball": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.2.tgz"
+ "shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774",
+ "tarball": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz"
},
"engines": {
"node": "*"
@@ -74,7 +73,7 @@
"files": [
"minimatch.js"
],
- "gitHead": "81edb7c763abd31ba981c87ec5e835f178786be0",
+ "gitHead": "eed89491bd4a4e6bc463aac0dfb5c29ef0d1dc13",
"homepage": "https://github.com/isaacs/minimatch#readme",
"license": "ISC",
"main": "minimatch.js",
@@ -95,5 +94,5 @@
"posttest": "standard minimatch.js test/*.js",
"test": "tap test/*.js"
},
- "version": "3.0.2"
+ "version": "3.0.3"
}
diff --git a/node_modules/node-uuid/benchmark/bench.sh b/node_modules/node-uuid/benchmark/bench.sh
old mode 100644
new mode 100755
diff --git a/node_modules/node-uuid/bin/uuid b/node_modules/node-uuid/bin/uuid
old mode 100644
new mode 100755
diff --git a/node_modules/node-uuid/package.json b/node_modules/node-uuid/package.json
index 9e7ed4a..0c9a225 100644
--- a/node_modules/node-uuid/package.json
+++ b/node_modules/node-uuid/package.json
@@ -10,7 +10,7 @@
"spec": ">=1.4.3 <2.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows"
+ "/Users/steveng/repo/cordova/cordova-windows"
]
],
"_from": "node-uuid@>=1.4.3 <2.0.0",
@@ -37,11 +37,11 @@
"_requiredBy": [
"/"
],
- "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz",
+ "_resolved": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz",
"_shasum": "6da5a17668c4b3dd59623bda11cf7fa4c1f60a6f",
"_shrinkwrap": null,
"_spec": "node-uuid@^1.4.3",
- "_where": "d:\\cordova\\cordova-windows",
+ "_where": "/Users/steveng/repo/cordova/cordova-windows",
"author": {
"name": "Robert Kieffer",
"email": "robert@broofa.com"
diff --git a/node_modules/nopt/bin/nopt.js b/node_modules/nopt/bin/nopt.js
old mode 100644
new mode 100755
diff --git a/node_modules/nopt/examples/my-program.js b/node_modules/nopt/examples/my-program.js
old mode 100644
new mode 100755
diff --git a/node_modules/nopt/package.json b/node_modules/nopt/package.json
index 1745670..c928910 100644
--- a/node_modules/nopt/package.json
+++ b/node_modules/nopt/package.json
@@ -10,7 +10,7 @@
"spec": ">=3.0.4 <4.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows"
+ "/Users/steveng/repo/cordova/cordova-windows"
]
],
"_from": "nopt@>=3.0.4 <4.0.0",
@@ -37,11 +37,11 @@
"_requiredBy": [
"/"
],
- "_resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
+ "_resolved": "http://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
"_shasum": "c6465dbf08abcd4db359317f79ac68a646b28ff9",
"_shrinkwrap": null,
"_spec": "nopt@^3.0.4",
- "_where": "d:\\cordova\\cordova-windows",
+ "_where": "/Users/steveng/repo/cordova/cordova-windows",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
diff --git a/node_modules/once/README.md b/node_modules/once/README.md
index a2981ea..1f1ffca 100644
--- a/node_modules/once/README.md
+++ b/node_modules/once/README.md
@@ -49,3 +49,31 @@
})
}
```
+
+## `once.strict(func)`
+
+Throw an error if the function is called twice.
+
+Some functions are expected to be called only once. Using `once` for them would
+potentially hide logical errors.
+
+In the example below, the `greet` function has to call the callback only once:
+
+```javascript
+function greet (name, cb) {
+ // return is missing from the if statement
+ // when no name is passed, the callback is called twice
+ if (!name) cb('Hello anonymous')
+ cb('Hello ' + name)
+}
+
+function log (msg) {
+ console.log(msg)
+}
+
+// this will print 'Hello anonymous' but the logical error will be missed
+greet(null, once(msg))
+
+// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time
+greet(null, once.strict(msg))
+```
diff --git a/node_modules/once/once.js b/node_modules/once/once.js
index 2e1e721..2354067 100644
--- a/node_modules/once/once.js
+++ b/node_modules/once/once.js
@@ -1,5 +1,6 @@
var wrappy = require('wrappy')
module.exports = wrappy(once)
+module.exports.strict = wrappy(onceStrict)
once.proto = once(function () {
Object.defineProperty(Function.prototype, 'once', {
@@ -8,6 +9,13 @@
},
configurable: true
})
+
+ Object.defineProperty(Function.prototype, 'onceStrict', {
+ value: function () {
+ return onceStrict(this)
+ },
+ configurable: true
+ })
})
function once (fn) {
@@ -19,3 +27,16 @@
f.called = false
return f
}
+
+function onceStrict (fn) {
+ var f = function () {
+ if (f.called)
+ throw new Error(f.onceError)
+ f.called = true
+ return f.value = fn.apply(this, arguments)
+ }
+ var name = fn.name || 'Function wrapped with `once`'
+ f.onceError = name + " shouldn't be called more than once"
+ f.called = false
+ return f
+}
diff --git a/node_modules/once/package.json b/node_modules/once/package.json
index 3c1182b..ca9daae 100644
--- a/node_modules/once/package.json
+++ b/node_modules/once/package.json
@@ -10,20 +10,23 @@
"spec": ">=1.3.0 <2.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\glob"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/glob"
]
],
"_from": "once@>=1.3.0 <2.0.0",
- "_id": "once@1.3.3",
+ "_id": "once@1.4.0",
"_inCache": true,
- "_installable": true,
"_location": "/once",
- "_nodeVersion": "4.0.0",
+ "_nodeVersion": "6.5.0",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/once-1.4.0.tgz_1473196269128_0.537820661207661"
+ },
"_npmUser": {
"name": "isaacs",
"email": "i@izs.me"
},
- "_npmVersion": "3.3.2",
+ "_npmVersion": "3.10.7",
"_phantomChildren": {},
"_requested": {
"raw": "once@^1.3.0",
@@ -38,11 +41,11 @@
"/glob",
"/inflight"
],
- "_resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz",
- "_shasum": "b2e261557ce4c314ec8304f3fa82663e4297ca20",
+ "_resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "_shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1",
"_shrinkwrap": null,
"_spec": "once@^1.3.0",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\glob",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/glob",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
@@ -56,19 +59,19 @@
},
"description": "Run a function exactly one time",
"devDependencies": {
- "tap": "^1.2.0"
+ "tap": "^7.0.1"
},
"directories": {
"test": "test"
},
"dist": {
- "shasum": "b2e261557ce4c314ec8304f3fa82663e4297ca20",
- "tarball": "https://registry.npmjs.org/once/-/once-1.3.3.tgz"
+ "shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1",
+ "tarball": "https://registry.npmjs.org/once/-/once-1.4.0.tgz"
},
"files": [
"once.js"
],
- "gitHead": "2ad558657e17fafd24803217ba854762842e4178",
+ "gitHead": "0e614d9f5a7e6f0305c625f6b581f6d80b33b8a6",
"homepage": "https://github.com/isaacs/once#readme",
"keywords": [
"once",
@@ -94,5 +97,5 @@
"scripts": {
"test": "tap test/*.js"
},
- "version": "1.3.3"
+ "version": "1.4.0"
}
diff --git a/node_modules/os-homedir/package.json b/node_modules/os-homedir/package.json
index acd5e15..247b942 100644
--- a/node_modules/os-homedir/package.json
+++ b/node_modules/os-homedir/package.json
@@ -10,20 +10,23 @@
"spec": ">=1.0.0 <2.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\osenv"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/osenv"
]
],
"_from": "os-homedir@>=1.0.0 <2.0.0",
- "_id": "os-homedir@1.0.1",
+ "_id": "os-homedir@1.0.2",
"_inCache": true,
- "_installable": true,
"_location": "/os-homedir",
- "_nodeVersion": "0.12.5",
+ "_nodeVersion": "6.6.0",
+ "_npmOperationalInternal": {
+ "host": "packages-16-east.internal.npmjs.com",
+ "tmp": "tmp/os-homedir-1.0.2.tgz_1475211519628_0.7873868853785098"
+ },
"_npmUser": {
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
},
- "_npmVersion": "2.11.2",
+ "_npmVersion": "3.10.3",
"_phantomChildren": {},
"_requested": {
"raw": "os-homedir@^1.0.0",
@@ -37,11 +40,11 @@
"_requiredBy": [
"/osenv"
],
- "_resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz",
- "_shasum": "0d62bdf44b916fd3bbdcf2cab191948fb094f007",
+ "_resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
+ "_shasum": "ffbc4988336e0e833de0c168c7ef152121aa7fb3",
"_shrinkwrap": null,
"_spec": "os-homedir@^1.0.0",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\osenv",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/osenv",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
@@ -51,15 +54,16 @@
"url": "https://github.com/sindresorhus/os-homedir/issues"
},
"dependencies": {},
- "description": "io.js 2.3.0 os.homedir() ponyfill",
+ "description": "Node.js 4 `os.homedir()` ponyfill",
"devDependencies": {
- "ava": "0.0.4",
- "path-exists": "^1.0.0"
+ "ava": "*",
+ "path-exists": "^2.0.0",
+ "xo": "^0.16.0"
},
"directories": {},
"dist": {
- "shasum": "0d62bdf44b916fd3bbdcf2cab191948fb094f007",
- "tarball": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz"
+ "shasum": "ffbc4988336e0e833de0c168c7ef152121aa7fb3",
+ "tarball": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz"
},
"engines": {
"node": ">=0.10.0"
@@ -67,10 +71,10 @@
"files": [
"index.js"
],
- "gitHead": "13ff83fbd13ebe286a6092286b2c634ab4534c5f",
- "homepage": "https://github.com/sindresorhus/os-homedir",
+ "gitHead": "b1b0ae70a5965fef7005ff6509a5dd1a78c95e36",
+ "homepage": "https://github.com/sindresorhus/os-homedir#readme",
"keywords": [
- "built-in",
+ "builtin",
"core",
"ponyfill",
"polyfill",
@@ -99,7 +103,7 @@
"url": "git+https://github.com/sindresorhus/os-homedir.git"
},
"scripts": {
- "test": "node test.js"
+ "test": "xo && ava"
},
- "version": "1.0.1"
+ "version": "1.0.2"
}
diff --git a/node_modules/os-homedir/readme.md b/node_modules/os-homedir/readme.md
index 4851f10..856ae61 100644
--- a/node_modules/os-homedir/readme.md
+++ b/node_modules/os-homedir/readme.md
@@ -1,8 +1,6 @@
# os-homedir [![Build Status](https://travis-ci.org/sindresorhus/os-homedir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-homedir)
-> io.js 2.3.0 [`os.homedir()`](https://iojs.org/api/os.html#os_os_homedir) ponyfill
-
-> Ponyfill: A polyfill that doesn't overwrite the native method
+> Node.js 4 [`os.homedir()`](https://nodejs.org/api/os.html#os_os_homedir) [ponyfill](https://ponyfill.com)
## Install
@@ -15,10 +13,10 @@
## Usage
```js
-var osHomedir = require('os-homedir');
+const osHomedir = require('os-homedir');
console.log(osHomedir());
-//=> /Users/sindresorhus
+//=> '/Users/sindresorhus'
```
@@ -30,4 +28,4 @@
## License
-MIT © [Sindre Sorhus](http://sindresorhus.com)
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/node_modules/os-tmpdir/index.js b/node_modules/os-tmpdir/index.js
index 52d90bf..2077b1c 100644
--- a/node_modules/os-tmpdir/index.js
+++ b/node_modules/os-tmpdir/index.js
@@ -2,7 +2,7 @@
var isWindows = process.platform === 'win32';
var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/;
-// https://github.com/nodejs/io.js/blob/3e7a14381497a3b73dda68d05b5130563cdab420/lib/os.js#L25-L43
+// https://github.com/nodejs/node/blob/3e7a14381497a3b73dda68d05b5130563cdab420/lib/os.js#L25-L43
module.exports = function () {
var path;
diff --git a/node_modules/os-tmpdir/package.json b/node_modules/os-tmpdir/package.json
index ea43382..9c269e7 100644
--- a/node_modules/os-tmpdir/package.json
+++ b/node_modules/os-tmpdir/package.json
@@ -10,20 +10,23 @@
"spec": ">=1.0.0 <2.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\osenv"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/osenv"
]
],
"_from": "os-tmpdir@>=1.0.0 <2.0.0",
- "_id": "os-tmpdir@1.0.1",
+ "_id": "os-tmpdir@1.0.2",
"_inCache": true,
- "_installable": true,
"_location": "/os-tmpdir",
- "_nodeVersion": "0.12.3",
+ "_nodeVersion": "6.6.0",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/os-tmpdir-1.0.2.tgz_1475211274587_0.14931037812493742"
+ },
"_npmUser": {
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
},
- "_npmVersion": "2.9.1",
+ "_npmVersion": "3.10.3",
"_phantomChildren": {},
"_requested": {
"raw": "os-tmpdir@^1.0.0",
@@ -37,11 +40,11 @@
"_requiredBy": [
"/osenv"
],
- "_resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.1.tgz",
- "_shasum": "e9b423a1edaf479882562e92ed71d7743a071b6e",
+ "_resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
+ "_shasum": "bbe67406c79aa85c5cfec766fe5734555dfa1274",
"_shrinkwrap": null,
"_spec": "os-tmpdir@^1.0.0",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\osenv",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/osenv",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
@@ -53,12 +56,13 @@
"dependencies": {},
"description": "Node.js os.tmpdir() ponyfill",
"devDependencies": {
- "ava": "0.0.4"
+ "ava": "*",
+ "xo": "^0.16.0"
},
"directories": {},
"dist": {
- "shasum": "e9b423a1edaf479882562e92ed71d7743a071b6e",
- "tarball": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.1.tgz"
+ "shasum": "bbe67406c79aa85c5cfec766fe5734555dfa1274",
+ "tarball": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz"
},
"engines": {
"node": ">=0.10.0"
@@ -66,8 +70,8 @@
"files": [
"index.js"
],
- "gitHead": "5c5d355f81378980db629d60128ad03e02b1c1e5",
- "homepage": "https://github.com/sindresorhus/os-tmpdir",
+ "gitHead": "1abf9cf5611b4be7377060ea67054b45cbf6813c",
+ "homepage": "https://github.com/sindresorhus/os-tmpdir#readme",
"keywords": [
"built-in",
"core",
@@ -99,7 +103,7 @@
"url": "git+https://github.com/sindresorhus/os-tmpdir.git"
},
"scripts": {
- "test": "node test.js"
+ "test": "xo && ava"
},
- "version": "1.0.1"
+ "version": "1.0.2"
}
diff --git a/node_modules/os-tmpdir/readme.md b/node_modules/os-tmpdir/readme.md
index 54d4c6e..c09f7ed 100644
--- a/node_modules/os-tmpdir/readme.md
+++ b/node_modules/os-tmpdir/readme.md
@@ -1,12 +1,8 @@
# os-tmpdir [![Build Status](https://travis-ci.org/sindresorhus/os-tmpdir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-tmpdir)
-> Node.js [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) ponyfill
+> Node.js [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) [ponyfill](https://ponyfill.com)
-> Ponyfill: A polyfill that doesn't overwrite the native method
-
-Use this instead of `require('os').tmpdir()` to get a consistent behaviour on different Node.js versions (even 0.8).
-
-*This is actually taken from io.js 2.0.2 as it contains some fixes that haven't bubbled up to Node.js yet.*
+Use this instead of `require('os').tmpdir()` to get a consistent behavior on different Node.js versions (even 0.8).
## Install
@@ -19,10 +15,10 @@
## Usage
```js
-var osTmpdir = require('os-tmpdir');
+const osTmpdir = require('os-tmpdir');
osTmpdir();
-//=> /var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T
+//=> '/var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T'
```
@@ -33,4 +29,4 @@
## License
-MIT © [Sindre Sorhus](http://sindresorhus.com)
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/node_modules/osenv/package.json b/node_modules/osenv/package.json
index 7640ebe..0afdb7d 100644
--- a/node_modules/osenv/package.json
+++ b/node_modules/osenv/package.json
@@ -10,20 +10,23 @@
"spec": ">=0.1.3 <0.2.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\cordova-common"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/cordova-common"
]
],
"_from": "osenv@>=0.1.3 <0.2.0",
- "_id": "osenv@0.1.3",
+ "_id": "osenv@0.1.4",
"_inCache": true,
- "_installable": true,
"_location": "/osenv",
- "_nodeVersion": "2.2.1",
+ "_nodeVersion": "6.5.0",
+ "_npmOperationalInternal": {
+ "host": "packages-18-east.internal.npmjs.com",
+ "tmp": "tmp/osenv-0.1.4.tgz_1481655889868_0.3980878754518926"
+ },
"_npmUser": {
"name": "isaacs",
- "email": "isaacs@npmjs.com"
+ "email": "i@izs.me"
},
- "_npmVersion": "3.0.0",
+ "_npmVersion": "3.10.9",
"_phantomChildren": {},
"_requested": {
"raw": "osenv@^0.1.3",
@@ -37,11 +40,11 @@
"_requiredBy": [
"/cordova-common"
],
- "_resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.3.tgz",
- "_shasum": "83cf05c6d6458fc4d5ac6362ea325d92f2754217",
+ "_resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz",
+ "_shasum": "42fe6d5953df06c8064be6f176c3d05aaaa34644",
"_shrinkwrap": null,
"_spec": "osenv@^0.1.3",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\cordova-common",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/cordova-common",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
@@ -56,16 +59,16 @@
},
"description": "Look up environment settings specific to different operating systems",
"devDependencies": {
- "tap": "^1.2.0"
+ "tap": "^8.0.1"
},
"directories": {
"test": "test"
},
"dist": {
- "shasum": "83cf05c6d6458fc4d5ac6362ea325d92f2754217",
- "tarball": "https://registry.npmjs.org/osenv/-/osenv-0.1.3.tgz"
+ "shasum": "42fe6d5953df06c8064be6f176c3d05aaaa34644",
+ "tarball": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz"
},
- "gitHead": "f746b3405d8f9e28054d11b97e1436f6a15016c4",
+ "gitHead": "ef718f0d20e38d45ec452b7faeefc692d3cd1062",
"homepage": "https://github.com/npm/osenv#readme",
"keywords": [
"environment",
@@ -106,5 +109,5 @@
"scripts": {
"test": "tap test/*.js"
},
- "version": "0.1.3"
+ "version": "0.1.4"
}
diff --git a/node_modules/osenv/test/unix.js b/node_modules/osenv/test/unix.js
index f87cbfb..94d4aaa 100644
--- a/node_modules/osenv/test/unix.js
+++ b/node_modules/osenv/test/unix.js
@@ -2,14 +2,14 @@
// pretending to be another platform is too hacky, since it breaks
// how the underlying system looks up module paths and runs
// child processes, and all that stuff is cached.
-if (process.platform === 'win32') {
- console.log('TAP Version 13\n' +
- '1..0\n' +
- '# Skip unix tests, this is not unix\n')
- return
-}
var tap = require('tap')
+
+if (process.platform === 'win32') {
+ tap.plan(0, 'Skip unix tests, this is not unix')
+ process.exit(0)
+}
+
// like unix, but funny
process.env.USER = 'sirUser'
process.env.HOME = '/home/sirUser'
diff --git a/node_modules/path-is-absolute/index.js b/node_modules/path-is-absolute/index.js
index 19f103f..22aa6c3 100644
--- a/node_modules/path-is-absolute/index.js
+++ b/node_modules/path-is-absolute/index.js
@@ -2,18 +2,18 @@
function posix(path) {
return path.charAt(0) === '/';
-};
+}
function win32(path) {
- // https://github.com/joyent/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
+ // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
var result = splitDeviceRe.exec(path);
var device = result[1] || '';
- var isUnc = !!device && device.charAt(1) !== ':';
+ var isUnc = Boolean(device && device.charAt(1) !== ':');
// UNC paths are always absolute
- return !!result[2] || isUnc;
-};
+ return Boolean(result[2] || isUnc);
+}
module.exports = process.platform === 'win32' ? win32 : posix;
module.exports.posix = posix;
diff --git a/node_modules/path-is-absolute/package.json b/node_modules/path-is-absolute/package.json
index f038214..10cbb1a 100644
--- a/node_modules/path-is-absolute/package.json
+++ b/node_modules/path-is-absolute/package.json
@@ -10,20 +10,23 @@
"spec": ">=1.0.0 <2.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\glob"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/glob"
]
],
"_from": "path-is-absolute@>=1.0.0 <2.0.0",
- "_id": "path-is-absolute@1.0.0",
+ "_id": "path-is-absolute@1.0.1",
"_inCache": true,
- "_installable": true,
"_location": "/path-is-absolute",
- "_nodeVersion": "0.12.0",
+ "_nodeVersion": "6.6.0",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/path-is-absolute-1.0.1.tgz_1475210523565_0.9876507974695414"
+ },
"_npmUser": {
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
},
- "_npmVersion": "2.5.1",
+ "_npmVersion": "3.10.3",
"_phantomChildren": {},
"_requested": {
"raw": "path-is-absolute@^1.0.0",
@@ -37,11 +40,11 @@
"_requiredBy": [
"/glob"
],
- "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz",
- "_shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912",
+ "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "_shasum": "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f",
"_shrinkwrap": null,
"_spec": "path-is-absolute@^1.0.0",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\glob",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/glob",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
@@ -52,11 +55,13 @@
},
"dependencies": {},
"description": "Node.js 0.12 path.isAbsolute() ponyfill",
- "devDependencies": {},
+ "devDependencies": {
+ "xo": "^0.16.0"
+ },
"directories": {},
"dist": {
- "shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912",
- "tarball": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz"
+ "shasum": "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f",
+ "tarball": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz"
},
"engines": {
"node": ">=0.10.0"
@@ -64,8 +69,8 @@
"files": [
"index.js"
],
- "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1",
- "homepage": "https://github.com/sindresorhus/path-is-absolute",
+ "gitHead": "edc91d348b21dac2ab65ea2fbec2868e2eff5eb6",
+ "homepage": "https://github.com/sindresorhus/path-is-absolute#readme",
"keywords": [
"path",
"paths",
@@ -100,7 +105,7 @@
"url": "git+https://github.com/sindresorhus/path-is-absolute.git"
},
"scripts": {
- "test": "node test.js"
+ "test": "xo && node test.js"
},
- "version": "1.0.0"
+ "version": "1.0.1"
}
diff --git a/node_modules/path-is-absolute/readme.md b/node_modules/path-is-absolute/readme.md
index cdf94f4..8dbdf5f 100644
--- a/node_modules/path-is-absolute/readme.md
+++ b/node_modules/path-is-absolute/readme.md
@@ -1,8 +1,6 @@
# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute)
-> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) ponyfill
-
-> Ponyfill: A polyfill that doesn't overwrite the native method
+> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com)
## Install
@@ -15,19 +13,29 @@
## Usage
```js
-var pathIsAbsolute = require('path-is-absolute');
+const pathIsAbsolute = require('path-is-absolute');
-// Linux
+// Running on Linux
pathIsAbsolute('/home/foo');
//=> true
+pathIsAbsolute('C:/Users/foo');
+//=> false
-// Windows
-pathIsAbsolute('C:/Users/');
+// Running on Windows
+pathIsAbsolute('C:/Users/foo');
//=> true
+pathIsAbsolute('/home/foo');
+//=> false
-// Any OS
+// Running on any OS
pathIsAbsolute.posix('/home/foo');
//=> true
+pathIsAbsolute.posix('C:/Users/foo');
+//=> false
+pathIsAbsolute.win32('C:/Users/foo');
+//=> true
+pathIsAbsolute.win32('/home/foo');
+//=> false
```
@@ -39,13 +47,13 @@
### pathIsAbsolute.posix(path)
-The Posix specific version.
+POSIX specific version.
### pathIsAbsolute.win32(path)
-The Windows specific version.
+Windows specific version.
## License
-MIT © [Sindre Sorhus](http://sindresorhus.com)
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/node_modules/plist/package.json b/node_modules/plist/package.json
index 9e93934..c8fc4b7 100644
--- a/node_modules/plist/package.json
+++ b/node_modules/plist/package.json
@@ -10,13 +10,12 @@
"spec": ">=1.2.0 <2.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\cordova-common"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/cordova-common"
]
],
"_from": "plist@>=1.2.0 <2.0.0",
"_id": "plist@1.2.0",
"_inCache": true,
- "_installable": true,
"_location": "/plist",
"_nodeVersion": "5.0.0",
"_npmUser": {
@@ -41,7 +40,7 @@
"_shasum": "084b5093ddc92506e259f874b8d9b1afb8c79593",
"_shrinkwrap": null,
"_spec": "plist@^1.2.0",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\cordova-common",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/cordova-common",
"author": {
"name": "Nathan Rajlich",
"email": "nathan@tootallnate.net"
diff --git a/node_modules/q/package.json b/node_modules/q/package.json
index 5986038..856f466 100644
--- a/node_modules/q/package.json
+++ b/node_modules/q/package.json
@@ -10,7 +10,7 @@
"spec": ">=1.4.1 <2.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows"
+ "/Users/steveng/repo/cordova/cordova-windows"
]
],
"_from": "q@>=1.4.1 <2.0.0",
@@ -38,11 +38,11 @@
"/",
"/cordova-common"
],
- "_resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz",
+ "_resolved": "http://registry.npmjs.org/q/-/q-1.4.1.tgz",
"_shasum": "55705bcd93c5f3673530c2c2cbc0c2b3addc286e",
"_shrinkwrap": null,
"_spec": "q@^1.4.1",
- "_where": "d:\\cordova\\cordova-windows",
+ "_where": "/Users/steveng/repo/cordova/cordova-windows",
"author": {
"name": "Kris Kowal",
"email": "kris@cixar.com",
diff --git a/node_modules/sax/examples/switch-bench.js b/node_modules/sax/examples/switch-bench.js
old mode 100644
new mode 100755
diff --git a/node_modules/sax/package.json b/node_modules/sax/package.json
index 911d4ae..5d7ce6b 100644
--- a/node_modules/sax/package.json
+++ b/node_modules/sax/package.json
@@ -10,7 +10,7 @@
"spec": "0.3.5",
"type": "version"
},
- "d:\\cordova\\cordova-windows\\node_modules\\elementtree"
+ "/Users/steveng/repo/cordova/cordova-windows/node_modules/elementtree"
]
],
"_defaultsLoaded": true,
@@ -39,11 +39,11 @@
"_requiredBy": [
"/elementtree"
],
- "_resolved": "https://registry.npmjs.org/sax/-/sax-0.3.5.tgz",
+ "_resolved": "http://registry.npmjs.org/sax/-/sax-0.3.5.tgz",
"_shasum": "88fcfc1f73c0c8bbd5b7c776b6d3f3501eed073d",
"_shrinkwrap": null,
"_spec": "sax@0.3.5",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\elementtree",
+ "_where": "/Users/steveng/repo/cordova/cordova-windows/node_modules/elementtree",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
diff --git a/node_modules/semver/bin/semver b/node_modules/semver/bin/semver
old mode 100644
new mode 100755
diff --git a/node_modules/semver/package.json b/node_modules/semver/package.json
index 46860ab..aee1de4 100644
--- a/node_modules/semver/package.json
+++ b/node_modules/semver/package.json
@@ -10,7 +10,7 @@
"spec": ">=5.3.0 <6.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows"
+ "/Users/steveng/repo/cordova/cordova-windows"
]
],
"_from": "semver@>=5.3.0 <6.0.0",
@@ -42,11 +42,11 @@
"/",
"/cordova-common"
],
- "_resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz",
+ "_resolved": "http://registry.npmjs.org/semver/-/semver-5.3.0.tgz",
"_shasum": "9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f",
"_shrinkwrap": null,
"_spec": "semver@^5.3.0",
- "_where": "d:\\cordova\\cordova-windows",
+ "_where": "/Users/steveng/repo/cordova/cordova-windows",
"bin": {
"semver": "./bin/semver"
},
diff --git a/node_modules/shelljs/bin/shjs b/node_modules/shelljs/bin/shjs
old mode 100644
new mode 100755
diff --git a/node_modules/shelljs/package.json b/node_modules/shelljs/package.json
index 7e5102d..f593392 100644
--- a/node_modules/shelljs/package.json
+++ b/node_modules/shelljs/package.json
@@ -10,7 +10,7 @@
"spec": ">=0.5.3 <0.6.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows"
+ "/Users/steveng/repo/cordova/cordova-windows"
]
],
"_from": "shelljs@>=0.5.3 <0.6.0",
@@ -38,11 +38,11 @@
"/",
"/cordova-common"
],
- "_resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.5.3.tgz",
+ "_resolved": "http://registry.npmjs.org/shelljs/-/shelljs-0.5.3.tgz",
"_shasum": "c54982b996c76ef0c1e6b59fbdc5825f5b713113",
"_shrinkwrap": null,
"_spec": "shelljs@^0.5.3",
- "_where": "d:\\cordova\\cordova-windows",
+ "_where": "/Users/steveng/repo/cordova/cordova-windows",
"author": {
"name": "Artur Adib",
"email": "arturadib@gmail.com"
diff --git a/node_modules/shelljs/scripts/generate-docs.js b/node_modules/shelljs/scripts/generate-docs.js
old mode 100644
new mode 100755
diff --git a/node_modules/shelljs/scripts/run-tests.js b/node_modules/shelljs/scripts/run-tests.js
old mode 100644
new mode 100755
diff --git a/node_modules/underscore/package.json b/node_modules/underscore/package.json
index bd0a417..3f8da14 100644
--- a/node_modules/underscore/package.json
+++ b/node_modules/underscore/package.json
@@ -10,13 +10,12 @@
"spec": ">=1.8.3 <2.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\cordova-common"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/cordova-common"
]
],
"_from": "underscore@>=1.8.3 <2.0.0",
"_id": "underscore@1.8.3",
"_inCache": true,
- "_installable": true,
"_location": "/underscore",
"_npmUser": {
"name": "jashkenas",
@@ -40,7 +39,7 @@
"_shasum": "4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022",
"_shrinkwrap": null,
"_spec": "underscore@^1.8.3",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\cordova-common",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/cordova-common",
"author": {
"name": "Jeremy Ashkenas",
"email": "jeremy@documentcloud.org"
diff --git a/node_modules/unorm/package.json b/node_modules/unorm/package.json
index b24caa8..680f4ef 100644
--- a/node_modules/unorm/package.json
+++ b/node_modules/unorm/package.json
@@ -10,13 +10,12 @@
"spec": ">=1.3.3 <2.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\cordova-common"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/cordova-common"
]
],
"_from": "unorm@>=1.3.3 <2.0.0",
"_id": "unorm@1.4.1",
"_inCache": true,
- "_installable": true,
"_location": "/unorm",
"_npmUser": {
"name": "walling",
@@ -40,7 +39,7 @@
"_shasum": "364200d5f13646ca8bcd44490271335614792300",
"_shrinkwrap": null,
"_spec": "unorm@^1.3.3",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\cordova-common",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/cordova-common",
"author": {
"name": "Bjarke Walling",
"email": "bwp@bwp.dk"
diff --git a/node_modules/util-deprecate/package.json b/node_modules/util-deprecate/package.json
index 93747b8..313b40f 100644
--- a/node_modules/util-deprecate/package.json
+++ b/node_modules/util-deprecate/package.json
@@ -10,13 +10,12 @@
"spec": "1.0.2",
"type": "version"
},
- "d:\\cordova\\cordova-windows\\node_modules\\plist"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/plist"
]
],
"_from": "util-deprecate@1.0.2",
"_id": "util-deprecate@1.0.2",
"_inCache": true,
- "_installable": true,
"_location": "/util-deprecate",
"_nodeVersion": "4.1.2",
"_npmUser": {
@@ -41,7 +40,7 @@
"_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf",
"_shrinkwrap": null,
"_spec": "util-deprecate@1.0.2",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\plist",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/plist",
"author": {
"name": "Nathan Rajlich",
"email": "nathan@tootallnate.net",
diff --git a/node_modules/winjs/package.json b/node_modules/winjs/package.json
index ceba67b..a03a65e 100644
--- a/node_modules/winjs/package.json
+++ b/node_modules/winjs/package.json
@@ -10,7 +10,7 @@
"spec": ">=4.4.0 <5.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows"
+ "/Users/steveng/repo/cordova/cordova-windows"
]
],
"_from": "winjs@>=4.4.0 <5.0.0",
@@ -37,11 +37,11 @@
"_requiredBy": [
"/"
],
- "_resolved": "https://registry.npmjs.org/winjs/-/winjs-4.4.0.tgz",
+ "_resolved": "http://registry.npmjs.org/winjs/-/winjs-4.4.0.tgz",
"_shasum": "ca43f1d75eefa6e04e995262bb0e76ac51160c9a",
"_shrinkwrap": null,
"_spec": "winjs@^4.4.0",
- "_where": "d:\\cordova\\cordova-windows",
+ "_where": "/Users/steveng/repo/cordova/cordova-windows",
"author": {
"name": "Microsoft Corporation and other contributors",
"url": "https://github.com/winjs/winjs/graphs/contributors"
diff --git a/node_modules/wrappy/package.json b/node_modules/wrappy/package.json
index ef4fa77..a70772c 100644
--- a/node_modules/wrappy/package.json
+++ b/node_modules/wrappy/package.json
@@ -10,13 +10,12 @@
"spec": ">=1.0.0 <2.0.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\inflight"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/inflight"
]
],
"_from": "wrappy@>=1.0.0 <2.0.0",
"_id": "wrappy@1.0.2",
"_inCache": true,
- "_installable": true,
"_location": "/wrappy",
"_nodeVersion": "5.10.1",
"_npmOperationalInternal": {
@@ -46,7 +45,7 @@
"_shasum": "b5243d8f3ec1aa35f1364605bc0d1036e30ab69f",
"_shrinkwrap": null,
"_spec": "wrappy@1",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\inflight",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/inflight",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
diff --git a/node_modules/xmlbuilder/package.json b/node_modules/xmlbuilder/package.json
index 5f89c50..c47cfe0 100644
--- a/node_modules/xmlbuilder/package.json
+++ b/node_modules/xmlbuilder/package.json
@@ -10,13 +10,12 @@
"spec": "4.0.0",
"type": "version"
},
- "d:\\cordova\\cordova-windows\\node_modules\\plist"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/plist"
]
],
"_from": "xmlbuilder@4.0.0",
"_id": "xmlbuilder@4.0.0",
"_inCache": true,
- "_installable": true,
"_location": "/xmlbuilder",
"_npmUser": {
"name": "oozcitak",
@@ -40,7 +39,7 @@
"_shasum": "98b8f651ca30aa624036f127d11cc66dc7b907a3",
"_shrinkwrap": null,
"_spec": "xmlbuilder@4.0.0",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\plist",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/plist",
"author": {
"name": "Ozgur Ozcitak",
"email": "oozcitak@gmail.com"
diff --git a/node_modules/xmldom/dom-parser.js b/node_modules/xmldom/dom-parser.js
index 08c2f70..41d5226 100644
--- a/node_modules/xmldom/dom-parser.js
+++ b/node_modules/xmldom/dom-parser.js
@@ -2,7 +2,7 @@
this.options = options ||{locator:{}};
}
-DOMParser.prototype.parseFromString = function(source,mimeType){
+DOMParser.prototype.parseFromString = function(source,mimeType){
var options = this.options;
var sax = new XMLReader();
var domBuilder = options.domBuilder || new DOMHandler();//contentHandler and LexicalHandler
@@ -25,9 +25,9 @@
if(source){
sax.parse(source,defaultNSMap,entityMap);
}else{
- sax.errorHandler.error("invalid document source");
+ sax.errorHandler.error("invalid doc source");
}
- return domBuilder.document;
+ return domBuilder.doc;
}
function buildErrorHandler(errorImpl,domBuilder,locator){
if(!errorImpl){
@@ -77,13 +77,13 @@
*/
DOMHandler.prototype = {
startDocument : function() {
- this.document = new DOMImplementation().createDocument(null, null, null);
+ this.doc = new DOMImplementation().createDocument(null, null, null);
if (this.locator) {
- this.document.documentURI = this.locator.systemId;
+ this.doc.documentURI = this.locator.systemId;
}
},
startElement:function(namespaceURI, localName, qName, attrs) {
- var doc = this.document;
+ var doc = this.doc;
var el = doc.createElementNS(namespaceURI, qName||localName);
var len = attrs.length;
appendElement(this, el);
@@ -95,24 +95,22 @@
var value = attrs.getValue(i);
var qName = attrs.getQName(i);
var attr = doc.createAttributeNS(namespaceURI, qName);
- if( attr.getOffset){
- position(attr.getOffset(1),attr)
- }
+ this.locator &&position(attrs.getLocator(i),attr);
attr.value = attr.nodeValue = value;
el.setAttributeNode(attr)
}
},
endElement:function(namespaceURI, localName, qName) {
var current = this.currentElement
- var tagName = current.tagName;
- this.currentElement = current.parentNode;
+ var tagName = current.tagName;
+ this.currentElement = current.parentNode;
},
startPrefixMapping:function(prefix, uri) {
},
endPrefixMapping:function(prefix) {
},
processingInstruction:function(target, data) {
- var ins = this.document.createProcessingInstruction(target, data);
+ var ins = this.doc.createProcessingInstruction(target, data);
this.locator && position(this.locator,ins)
appendElement(this, ins);
},
@@ -121,13 +119,17 @@
characters:function(chars, start, length) {
chars = _toString.apply(this,arguments)
//console.log(chars)
- if(this.currentElement && chars){
+ if(chars){
if (this.cdata) {
- var charNode = this.document.createCDATASection(chars);
- this.currentElement.appendChild(charNode);
+ var charNode = this.doc.createCDATASection(chars);
} else {
- var charNode = this.document.createTextNode(chars);
+ var charNode = this.doc.createTextNode(chars);
+ }
+ if(this.currentElement){
this.currentElement.appendChild(charNode);
+ }else if(/^\s*$/.test(chars)){
+ this.doc.appendChild(charNode);
+ //process xml
}
this.locator && position(this.locator,charNode)
}
@@ -135,7 +137,7 @@
skippedEntity:function(name) {
},
endDocument:function() {
- this.document.normalize();
+ this.doc.normalize();
},
setDocumentLocator:function (locator) {
if(this.locator = locator){// && !('lineNumber' in locator)){
@@ -145,7 +147,7 @@
//LexicalHandler
comment:function(chars, start, length) {
chars = _toString.apply(this,arguments)
- var comm = this.document.createComment(chars);
+ var comm = this.doc.createComment(chars);
this.locator && position(this.locator,comm)
appendElement(this, comm);
},
@@ -159,7 +161,7 @@
},
startDTD:function(name, publicId, systemId) {
- var impl = this.document.implementation;
+ var impl = this.doc.implementation;
if (impl && impl.createDocumentType) {
var dt = impl.createDocumentType(name, publicId, systemId);
this.locator && position(this.locator,dt)
@@ -235,15 +237,15 @@
/* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */
function appendElement (hander,node) {
if (!hander.currentElement) {
- hander.document.appendChild(node);
+ hander.doc.appendChild(node);
} else {
hander.currentElement.appendChild(node);
}
}//appendChild and setAttributeNS are preformance key
-if(typeof require == 'function'){
+//if(typeof require == 'function'){
var XMLReader = require('./sax').XMLReader;
var DOMImplementation = exports.DOMImplementation = require('./dom').DOMImplementation;
exports.XMLSerializer = require('./dom').XMLSerializer ;
exports.DOMParser = DOMParser;
-}
+//}
diff --git a/node_modules/xmldom/dom.js b/node_modules/xmldom/dom.js
index 460a1be..b290df0 100644
--- a/node_modules/xmldom/dom.js
+++ b/node_modules/xmldom/dom.js
@@ -110,9 +110,9 @@
item: function(index) {
return this[index] || null;
},
- toString:function(){
+ toString:function(isHTML,nodeFilter){
for(var buf = [], i = 0;i<this.length;i++){
- serializeToString(this[i],buf);
+ serializeToString(this[i],buf,isHTML,nodeFilter);
}
return buf.join('');
}
@@ -170,6 +170,7 @@
}
}
function _removeNamedNode(el,list,attr){
+ //console.log('remove attr:'+attr)
var i = _findNodeIndex(list,attr);
if(i>=0){
var lastIndex = list.length-1
@@ -185,7 +186,7 @@
}
}
}else{
- throw DOMException(NOT_FOUND_ERR,new Error())
+ throw DOMException(NOT_FOUND_ERR,new Error(el.tagName+'@'+attr))
}
}
NamedNodeMap.prototype = {
@@ -195,9 +196,11 @@
// if(key.indexOf(':')>0 || key == 'xmlns'){
// return null;
// }
+ //console.log()
var i = this.length;
while(i--){
var attr = this[i];
+ //console.log(attr.nodeName,key)
if(attr.nodeName == key){
return attr;
}
@@ -379,7 +382,7 @@
}
}
}
- el = el.nodeType == 2?el.ownerDocument : el.parentNode;
+ el = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;
}
return null;
},
@@ -394,7 +397,7 @@
return map[prefix] ;
}
}
- el = el.nodeType == 2?el.ownerDocument : el.parentNode;
+ el = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;
}
return null;
},
@@ -579,7 +582,7 @@
}
return newChild;
}
- if(this.documentElement == null && newChild.nodeType == 1){
+ if(this.documentElement == null && newChild.nodeType == ELEMENT_NODE){
this.documentElement = newChild;
}
@@ -599,7 +602,7 @@
getElementById : function(id){
var rtv = null;
_visitNode(this.documentElement,function(node){
- if(node.nodeType == 1){
+ if(node.nodeType == ELEMENT_NODE){
if(node.getAttribute('id') == id){
rtv = node;
return true;
@@ -748,6 +751,7 @@
return this.attributes.setNamedItemNS(newAttr);
},
removeAttributeNode : function(oldAttr){
+ //console.log(this == oldAttr.ownerElement)
return this.attributes.removeNamedItem(oldAttr.nodeName);
},
//get real attribute name,and remove it by removeAttributeNode
@@ -792,6 +796,7 @@
}
});
return ls;
+
});
}
};
@@ -823,10 +828,7 @@
},
appendChild:function(newChild){
- //if(!(newChild instanceof CharacterData)){
- throw new Error(ExceptionMessage[3])
- //}
- return Node.prototype.appendChild.apply(this,arguments)
+ throw new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR])
},
deleteData: function(offset, count) {
this.replaceData(offset,count,"");
@@ -908,39 +910,132 @@
ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;
_extends(ProcessingInstruction,Node);
function XMLSerializer(){}
-XMLSerializer.prototype.serializeToString = function(node,attributeSorter){
- return node.toString(attributeSorter);
+XMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter){
+ return nodeSerializeToString.call(node,isHtml,nodeFilter);
}
-Node.prototype.toString =function(attributeSorter){
+Node.prototype.toString = nodeSerializeToString;
+function nodeSerializeToString(isHtml,nodeFilter){
var buf = [];
- serializeToString(this,buf,attributeSorter);
+ var refNode = this.nodeType == 9?this.documentElement:this;
+ var prefix = refNode.prefix;
+ var uri = refNode.namespaceURI;
+
+ if(uri && prefix == null){
+ //console.log(prefix)
+ var prefix = refNode.lookupPrefix(uri);
+ if(prefix == null){
+ //isHTML = true;
+ var visibleNamespaces=[
+ {namespace:uri,prefix:null}
+ //{namespace:uri,prefix:''}
+ ]
+ }
+ }
+ serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);
+ //console.log('###',this.nodeType,uri,prefix,buf.join(''))
return buf.join('');
}
-function serializeToString(node,buf,attributeSorter,isHTML){
+function needNamespaceDefine(node,isHTML, visibleNamespaces) {
+ var prefix = node.prefix||'';
+ var uri = node.namespaceURI;
+ if (!prefix && !uri){
+ return false;
+ }
+ if (prefix === "xml" && uri === "http://www.w3.org/XML/1998/namespace"
+ || uri == 'http://www.w3.org/2000/xmlns/'){
+ return false;
+ }
+
+ var i = visibleNamespaces.length
+ //console.log('@@@@',node.tagName,prefix,uri,visibleNamespaces)
+ while (i--) {
+ var ns = visibleNamespaces[i];
+ // get namespace prefix
+ //console.log(node.nodeType,node.tagName,ns.prefix,prefix)
+ if (ns.prefix == prefix){
+ return ns.namespace != uri;
+ }
+ }
+ //console.log(isHTML,uri,prefix=='')
+ //if(isHTML && prefix ==null && uri == 'http://www.w3.org/1999/xhtml'){
+ // return false;
+ //}
+ //node.flag = '11111'
+ //console.error(3,true,node.flag,node.prefix,node.namespaceURI)
+ return true;
+}
+function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
+ if(nodeFilter){
+ node = nodeFilter(node);
+ if(node){
+ if(typeof node == 'string'){
+ buf.push(node);
+ return;
+ }
+ }else{
+ return;
+ }
+ //buf.sort.apply(attrs, attributeSorter);
+ }
switch(node.nodeType){
case ELEMENT_NODE:
+ if (!visibleNamespaces) visibleNamespaces = [];
+ var startVisibleNamespaces = visibleNamespaces.length;
var attrs = node.attributes;
var len = attrs.length;
var child = node.firstChild;
var nodeName = node.tagName;
+
isHTML = (htmlns === node.namespaceURI) ||isHTML
buf.push('<',nodeName);
- if(attributeSorter){
- buf.sort.apply(attrs, attributeSorter);
+
+
+
+ for(var i=0;i<len;i++){
+ // add namespaces for attributes
+ var attr = attrs.item(i);
+ if (attr.prefix == 'xmlns') {
+ visibleNamespaces.push({ prefix: attr.localName, namespace: attr.value });
+ }else if(attr.nodeName == 'xmlns'){
+ visibleNamespaces.push({ prefix: '', namespace: attr.value });
+ }
}
for(var i=0;i<len;i++){
- serializeToString(attrs.item(i),buf,attributeSorter,isHTML);
+ var attr = attrs.item(i);
+ if (needNamespaceDefine(attr,isHTML, visibleNamespaces)) {
+ var prefix = attr.prefix||'';
+ var uri = attr.namespaceURI;
+ var ns = prefix ? ' xmlns:' + prefix : " xmlns";
+ buf.push(ns, '="' , uri , '"');
+ visibleNamespaces.push({ prefix: prefix, namespace:uri });
+ }
+ serializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces);
}
- if(child || isHTML && !/^(?:meta|link|img|br|hr|input|button)$/i.test(nodeName)){
+ // add namespace for current node
+ if (needNamespaceDefine(node,isHTML, visibleNamespaces)) {
+ var prefix = node.prefix||'';
+ var uri = node.namespaceURI;
+ var ns = prefix ? ' xmlns:' + prefix : " xmlns";
+ buf.push(ns, '="' , uri , '"');
+ visibleNamespaces.push({ prefix: prefix, namespace:uri });
+ }
+
+ if(child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)){
buf.push('>');
//if is cdata child node
if(isHTML && /^script$/i.test(nodeName)){
- if(child){
- buf.push(child.data);
- }
- }else{
while(child){
- serializeToString(child,buf,attributeSorter,isHTML);
+ if(child.data){
+ buf.push(child.data);
+ }else{
+ serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces);
+ }
+ child = child.nextSibling;
+ }
+ }else
+ {
+ while(child){
+ serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces);
child = child.nextSibling;
}
}
@@ -948,12 +1043,14 @@
}else{
buf.push('/>');
}
+ // remove added visible namespaces
+ //visibleNamespaces.length = startVisibleNamespaces;
return;
case DOCUMENT_NODE:
case DOCUMENT_FRAGMENT_NODE:
var child = node.firstChild;
while(child){
- serializeToString(child,buf,attributeSorter,isHTML);
+ serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces);
child = child.nextSibling;
}
return;
@@ -1098,8 +1195,8 @@
},
set:function(data){
switch(this.nodeType){
- case 1:
- case 11:
+ case ELEMENT_NODE:
+ case DOCUMENT_FRAGMENT_NODE:
while(this.firstChild){
this.removeChild(this.firstChild);
}
@@ -1110,7 +1207,7 @@
default:
//TODO:
this.data = data;
- this.value = value;
+ this.value = data;
this.nodeValue = data;
}
}
@@ -1118,8 +1215,8 @@
function getTextContent(node){
switch(node.nodeType){
- case 1:
- case 11:
+ case ELEMENT_NODE:
+ case DOCUMENT_FRAGMENT_NODE:
var buf = [];
node = node.firstChild;
while(node){
@@ -1141,7 +1238,7 @@
}catch(e){//ie8
}
-if(typeof require == 'function'){
+//if(typeof require == 'function'){
exports.DOMImplementation = DOMImplementation;
exports.XMLSerializer = XMLSerializer;
-}
+//}
diff --git a/node_modules/xmldom/package.json b/node_modules/xmldom/package.json
index d0afecf..7eb81b6 100644
--- a/node_modules/xmldom/package.json
+++ b/node_modules/xmldom/package.json
@@ -10,15 +10,18 @@
"spec": ">=0.1.0 <0.2.0",
"type": "range"
},
- "d:\\cordova\\cordova-windows\\node_modules\\plist"
+ "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/plist"
]
],
"_from": "xmldom@>=0.1.0 <0.2.0",
- "_id": "xmldom@0.1.22",
+ "_id": "xmldom@0.1.27",
"_inCache": true,
- "_installable": true,
"_location": "/xmldom",
"_nodeVersion": "5.5.0",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/xmldom-0.1.27.tgz_1480305406093_0.9070004557725042"
+ },
"_npmUser": {
"name": "jindw",
"email": "jindw@xidea.org"
@@ -37,11 +40,11 @@
"_requiredBy": [
"/plist"
],
- "_resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.22.tgz",
- "_shasum": "10de4e5e964981f03c8cc72fadc08d14b6c3aa26",
+ "_resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz",
+ "_shasum": "d501f97b3bdb403af8ef9ecc20573187aadac0e9",
"_shrinkwrap": null,
"_spec": "xmldom@0.1.x",
- "_where": "d:\\cordova\\cordova-windows\\node_modules\\plist",
+ "_where": "/Users/kotikov.vladimir/repos/cordova/cordova-windows/node_modules/plist",
"author": {
"name": "jindw",
"email": "jindw@xidea.org",
@@ -75,13 +78,13 @@
},
"directories": {},
"dist": {
- "shasum": "10de4e5e964981f03c8cc72fadc08d14b6c3aa26",
- "tarball": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.22.tgz"
+ "shasum": "d501f97b3bdb403af8ef9ecc20573187aadac0e9",
+ "tarball": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz"
},
"engines": {
"node": ">=0.1"
},
- "gitHead": "29a83b315aef56c156602286b2d884a3b4c2521f",
+ "gitHead": "b53aa82a36160d85faab394035dcd1784764537f",
"homepage": "https://github.com/jindw/xmldom",
"keywords": [
"w3c",
@@ -132,5 +135,5 @@
"scripts": {
"test": "proof platform win32 && proof test */*/*.t.js || t/test"
},
- "version": "0.1.22"
+ "version": "0.1.27"
}
diff --git a/node_modules/xmldom/sax.js b/node_modules/xmldom/sax.js
index e11bdfb..b33635f 100644
--- a/node_modules/xmldom/sax.js
+++ b/node_modules/xmldom/sax.js
@@ -2,21 +2,21 @@
//[4a] NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
//[5] Name ::= NameStartChar (NameChar)*
var nameStartChar = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]///\u10000-\uEFFFF
-var nameChar = new RegExp("[\\-\\.0-9"+nameStartChar.source.slice(1,-1)+"\u00B7\u0300-\u036F\\u203F-\u2040]");
+var nameChar = new RegExp("[\\-\\.0-9"+nameStartChar.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");
var tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\:'+nameStartChar.source+nameChar.source+'*)?$');
//var tagNamePattern = /^[a-zA-Z_][\w\-\.]*(?:\:[a-zA-Z_][\w\-\.]*)?$/
//var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',')
-//S_TAG, S_ATTR, S_EQ, S_V
-//S_ATTR_S, S_E, S_S, S_C
+//S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE
+//S_ATTR_SPACE, S_ATTR_END, S_TAG_SPACE, S_TAG_CLOSE
var S_TAG = 0;//tag name offerring
var S_ATTR = 1;//attr name offerring
-var S_ATTR_S=2;//attr name end and space offer
+var S_ATTR_SPACE=2;//attr name end and space offer
var S_EQ = 3;//=space?
-var S_V = 4;//attr value(no quot value only)
-var S_E = 5;//attr value end and no space(quot end)
-var S_S = 6;//(attr value end || tag end ) && (space offer)
-var S_C = 7;//closed el<el />
+var S_ATTR_NOQUOT_VALUE = 4;//attr value(no quot value only)
+var S_ATTR_END = 5;//attr value end and no space(quot end)
+var S_TAG_SPACE = 6;//(attr value end || tag end ) && (space offer)
+var S_TAG_CLOSE = 7;//closed el<el />
function XMLReader(){
@@ -33,7 +33,7 @@
}
}
function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
- function fixedFromCharCode(code) {
+ function fixedFromCharCode(code) {
// String.prototype.fromCharCode does not supports
// > 2 bytes unicode chars directly
if (code > 0xffff) {
@@ -76,7 +76,7 @@
}
var lineStart = 0;
var lineEnd = 0;
- var linePattern = /.+(?:\r\n?|\n)|.*$/g
+ var linePattern = /.*(?:\r\n?|\n)|.*$/g
var locator = domBuilder.locator;
var parseStack = [{currentNSMap:defaultNSMapCopy}]
@@ -87,7 +87,7 @@
var tagStart = source.indexOf('<',start);
if(tagStart<0){
if(!source.substr(start).match(/^\s*$/)){
- var doc = domBuilder.document;
+ var doc = domBuilder.doc;
var text = doc.createTextNode(source.substr(start));
doc.appendChild(text);
domBuilder.currentElement = text;
@@ -102,16 +102,36 @@
var end = source.indexOf('>',tagStart+3);
var tagName = source.substring(tagStart+2,end);
var config = parseStack.pop();
- var localNSMap = config.localNSMap;
- if(config.tagName != tagName){
- errorHandler.fatalError("end tag name: "+tagName+' is not match the current start tagName:'+config.tagName );
- }
- domBuilder.endElement(config.uri,config.localName,tagName);
- if(localNSMap){
- for(var prefix in localNSMap){
- domBuilder.endPrefixMapping(prefix) ;
- }
+ if(end<0){
+
+ tagName = source.substring(tagStart+2).replace(/[\s<].*/,'');
+ //console.error('#@@@@@@'+tagName)
+ errorHandler.error("end tag name: "+tagName+' is not complete:'+config.tagName);
+ end = tagStart+1+tagName.length;
+ }else if(tagName.match(/\s</)){
+ tagName = tagName.replace(/[\s<].*/,'');
+ errorHandler.error("end tag name: "+tagName+' maybe not complete');
+ end = tagStart+1+tagName.length;
}
+ //console.error(parseStack.length,parseStack)
+ //console.error(config);
+ var localNSMap = config.localNSMap;
+ var endMatch = config.tagName == tagName;
+ var endIgnoreCaseMach = endMatch || config.tagName&&config.tagName.toLowerCase() == tagName.toLowerCase()
+ if(endIgnoreCaseMach){
+ domBuilder.endElement(config.uri,config.localName,tagName);
+ if(localNSMap){
+ for(var prefix in localNSMap){
+ domBuilder.endPrefixMapping(prefix) ;
+ }
+ }
+ if(!endMatch){
+ errorHandler.fatalError("end tag name: "+tagName+' is not match the current start tagName:'+config.tagName );
+ }
+ }else{
+ parseStack.push(config)
+ }
+
end++;
break;
// end elment
@@ -124,33 +144,40 @@
end = parseDCC(source,tagStart,domBuilder,errorHandler);
break;
default:
-
locator&&position(tagStart);
-
var el = new ElementAttributes();
-
+ var currentNSMap = parseStack[parseStack.length-1].currentNSMap;
//elStartEnd
- var end = parseElementStartPart(source,tagStart,el,entityReplacer,errorHandler);
+ var end = parseElementStartPart(source,tagStart,el,currentNSMap,entityReplacer,errorHandler);
var len = el.length;
- if(locator){
- if(len){
- //attribute position fixed
- for(var i = 0;i<len;i++){
- var a = el[i];
- position(a.offset);
- a.offset = copyLocator(locator,{});
- }
- }
- position(end);
- }
+
if(!el.closed && fixSelfClosed(source,end,el.tagName,closeMap)){
el.closed = true;
if(!entityMap.nbsp){
errorHandler.warning('unclosed xml attribute');
}
}
- appendElement(el,domBuilder,parseStack);
+ if(locator && len){
+ var locator2 = copyLocator(locator,{});
+ //try{//attribute position fixed
+ for(var i = 0;i<len;i++){
+ var a = el[i];
+ position(a.offset);
+ a.locator = copyLocator(locator,{});
+ }
+ //}catch(e){console.error('@@@@@'+e)}
+ domBuilder.locator = locator2
+ if(appendElement(el,domBuilder,currentNSMap)){
+ parseStack.push(el)
+ }
+ domBuilder.locator = locator;
+ }else{
+ if(appendElement(el,domBuilder,currentNSMap)){
+ parseStack.push(el)
+ }
+ }
+
if(el.uri === 'http://www.w3.org/1999/xhtml' && !el.closed){
@@ -160,8 +187,10 @@
}
}
}catch(e){
- errorHandler.error('element parse error: '+e);
+ errorHandler.error('element parse error: '+e)
+ //errorHandler.error('element parse error: '+e);
end = -1;
+ //throw e;
}
if(end>start){
start = end;
@@ -181,7 +210,7 @@
* @see #appendElement(source,elStartEnd,el,selfClosed,entityReplacer,domBuilder,parseStack);
* @return end of the elementStartPart(end of elementEndPart for selfClosed el)
*/
-function parseElementStartPart(source,start,el,entityReplacer,errorHandler){
+function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,errorHandler){
var attrName;
var value;
var p = ++start;
@@ -193,7 +222,7 @@
if(s === S_ATTR){//attrName
attrName = source.slice(start,p);
s = S_EQ;
- }else if(s === S_ATTR_S){
+ }else if(s === S_ATTR_SPACE){
s = S_EQ;
}else{
//fatalError: equal must after attrName or space after attrName
@@ -202,25 +231,30 @@
break;
case '\'':
case '"':
- if(s === S_EQ){//equal
+ if(s === S_EQ || s === S_ATTR //|| s == S_ATTR_SPACE
+ ){//equal
+ if(s === S_ATTR){
+ errorHandler.warning('attribute value must after "="')
+ attrName = source.slice(start,p)
+ }
start = p+1;
p = source.indexOf(c,start)
if(p>0){
value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer);
el.add(attrName,value,start-1);
- s = S_E;
+ s = S_ATTR_END;
}else{
//fatalError: no end quot match
throw new Error('attribute value no end \''+c+'\' match');
}
- }else if(s == S_V){
+ }else if(s == S_ATTR_NOQUOT_VALUE){
value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer);
//console.log(attrName,value,start,p)
el.add(attrName,value,start);
//console.dir(el)
errorHandler.warning('attribute "'+attrName+'" missed start quot('+c+')!!');
start = p+1;
- s = S_E
+ s = S_ATTR_END
}else{
//fatalError: no equal before
throw new Error('attribute value must after "="');
@@ -230,14 +264,14 @@
switch(s){
case S_TAG:
el.setTagName(source.slice(start,p));
- case S_E:
- case S_S:
- case S_C:
- s = S_C;
+ case S_ATTR_END:
+ case S_TAG_SPACE:
+ case S_TAG_CLOSE:
+ s =S_TAG_CLOSE;
el.closed = true;
- case S_V:
+ case S_ATTR_NOQUOT_VALUE:
case S_ATTR:
- case S_ATTR_S:
+ case S_ATTR_SPACE:
break;
//case S_EQ:
default:
@@ -247,30 +281,36 @@
case ''://end document
//throw new Error('unexpected end of input')
errorHandler.error('unexpected end of input');
+ if(s == S_TAG){
+ el.setTagName(source.slice(start,p));
+ }
+ return p;
case '>':
switch(s){
case S_TAG:
el.setTagName(source.slice(start,p));
- case S_E:
- case S_S:
- case S_C:
+ case S_ATTR_END:
+ case S_TAG_SPACE:
+ case S_TAG_CLOSE:
break;//normal
- case S_V://Compatible state
+ case S_ATTR_NOQUOT_VALUE://Compatible state
case S_ATTR:
value = source.slice(start,p);
if(value.slice(-1) === '/'){
el.closed = true;
value = value.slice(0,-1)
}
- case S_ATTR_S:
- if(s === S_ATTR_S){
+ case S_ATTR_SPACE:
+ if(s === S_ATTR_SPACE){
value = attrName;
}
- if(s == S_V){
+ if(s == S_ATTR_NOQUOT_VALUE){
errorHandler.warning('attribute "'+value+'" missed quot(")!!');
el.add(attrName,value.replace(/&#?\w+;/g,entityReplacer),start)
}else{
- errorHandler.warning('attribute "'+value+'" missed value!! "'+value+'" instead!!')
+ if(currentNSMap[''] !== 'http://www.w3.org/1999/xhtml' || !value.match(/^(?:disabled|checked|selected)$/i)){
+ errorHandler.warning('attribute "'+value+'" missed value!! "'+value+'" instead!!')
+ }
el.add(value,value,start)
}
break;
@@ -287,64 +327,68 @@
switch(s){
case S_TAG:
el.setTagName(source.slice(start,p));//tagName
- s = S_S;
+ s = S_TAG_SPACE;
break;
case S_ATTR:
attrName = source.slice(start,p)
- s = S_ATTR_S;
+ s = S_ATTR_SPACE;
break;
- case S_V:
+ case S_ATTR_NOQUOT_VALUE:
var value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer);
errorHandler.warning('attribute "'+value+'" missed quot(")!!');
el.add(attrName,value,start)
- case S_E:
- s = S_S;
+ case S_ATTR_END:
+ s = S_TAG_SPACE;
break;
- //case S_S:
+ //case S_TAG_SPACE:
//case S_EQ:
- //case S_ATTR_S:
+ //case S_ATTR_SPACE:
// void();break;
- //case S_C:
+ //case S_TAG_CLOSE:
//ignore warning
}
}else{//not space
-//S_TAG, S_ATTR, S_EQ, S_V
-//S_ATTR_S, S_E, S_S, S_C
+//S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE
+//S_ATTR_SPACE, S_ATTR_END, S_TAG_SPACE, S_TAG_CLOSE
switch(s){
//case S_TAG:void();break;
//case S_ATTR:void();break;
- //case S_V:void();break;
- case S_ATTR_S:
- errorHandler.warning('attribute "'+attrName+'" missed value!! "'+attrName+'" instead!!')
+ //case S_ATTR_NOQUOT_VALUE:void();break;
+ case S_ATTR_SPACE:
+ var tagName = el.tagName;
+ if(currentNSMap[''] !== 'http://www.w3.org/1999/xhtml' || !attrName.match(/^(?:disabled|checked|selected)$/i)){
+ errorHandler.warning('attribute "'+attrName+'" missed value!! "'+attrName+'" instead2!!')
+ }
el.add(attrName,attrName,start);
start = p;
s = S_ATTR;
break;
- case S_E:
+ case S_ATTR_END:
errorHandler.warning('attribute space is required"'+attrName+'"!!')
- case S_S:
+ case S_TAG_SPACE:
s = S_ATTR;
start = p;
break;
case S_EQ:
- s = S_V;
+ s = S_ATTR_NOQUOT_VALUE;
start = p;
break;
- case S_C:
+ case S_TAG_CLOSE:
throw new Error("elements closed character '/' and '>' must be connected to");
}
}
- }
+ }//end outer switch
+ //console.log('p++',p)
p++;
}
}
/**
- * @return end of the elementStartPart(end of elementEndPart for selfClosed el)
+ * @return true if has new namespace define
*/
-function appendElement(el,domBuilder,parseStack){
+function appendElement(el,domBuilder,currentNSMap){
var tagName = el.tagName;
var localNSMap = null;
- var currentNSMap = parseStack[parseStack.length-1].currentNSMap;
+ //var currentNSMap = parseStack[parseStack.length-1].currentNSMap;
var i = el.length;
while(i--){
var a = el[i];
@@ -383,7 +427,7 @@
if(prefix === 'xml'){
a.uri = 'http://www.w3.org/XML/1998/namespace';
}if(prefix !== 'xmlns'){
- a.uri = currentNSMap[prefix]
+ a.uri = currentNSMap[prefix || '']
//{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)}
}
@@ -412,7 +456,8 @@
}else{
el.currentNSMap = currentNSMap;
el.localNSMap = localNSMap;
- parseStack.push(el);
+ //parseStack.push(el);
+ return true;
}
}
function parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){
@@ -442,7 +487,11 @@
var pos = closeMap[tagName];
if(pos == null){
//console.log(tagName)
- pos = closeMap[tagName] = source.lastIndexOf('</'+tagName+'>')
+ pos = source.lastIndexOf('</'+tagName+'>')
+ if(pos<elStartEnd){//忘记闭合
+ pos = source.lastIndexOf('</'+tagName)
+ }
+ closeMap[tagName] =pos
}
return pos<elStartEnd;
//}
@@ -533,7 +582,7 @@
},
length:0,
getLocalName:function(i){return this[i].localName},
- getOffset:function(i){return this[i].offset},
+ getLocator:function(i){return this[i].locator},
getQName:function(i){return this[i].qName},
getURI:function(i){return this[i].uri},
getValue:function(i){return this[i].value}
@@ -580,7 +629,5 @@
}
}
-if(typeof require == 'function'){
- exports.XMLReader = XMLReader;
-}
+exports.XMLReader = XMLReader;
diff --git a/package.json b/package.json
index 64a9d51..e73937c 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "cordova-windows",
- "version": "4.5.0-dev",
+ "version": "5.1.0-dev",
"description": "cordova-windows release",
"bin": "bin/create",
"main": "template/cordova/Api.js",
@@ -15,13 +15,13 @@
],
"scripts": {
"test": "npm run jshint && npm run test-unit && npm run test-e2e",
- "test-unit": "jasmine-node --captureExceptions spec/unit",
- "test-e2e": "jasmine-node --captureExceptions spec/e2e",
- "cover": "istanbul cover --root template --print detail node_modules/jasmine-node/bin/jasmine-node -- spec/unit",
+ "test-unit": "jasmine --captureExceptions ",
+ "test-e2e": "jasmine --captureExceptions spec/e2e/endtoend.spec.js",
+ "cover": "istanbul cover --root bin/templates/cordova --print detail jasmine",
"jshint": "jshint bin && jshint template && jshint spec"
},
"dependencies": {
- "cordova-common": "^1.4.0",
+ "cordova-common": "^2.0.0",
"elementtree": "^0.1.6",
"node-uuid": "^1.4.3",
"nopt": "^3.0.4",
@@ -32,7 +32,7 @@
},
"devDependencies": {
"istanbul": "^0.4.0",
- "jasmine-node": "1.14.5",
+ "jasmine": "^2.5.3",
"jshint": "^2.8.0",
"rewire": "^2.5.1"
},
diff --git a/spec/e2e/endtoend.spec.js b/spec/e2e/endtoend.spec.js
index 3732693..52f1cfa 100644
--- a/spec/e2e/endtoend.spec.js
+++ b/spec/e2e/endtoend.spec.js
@@ -20,6 +20,14 @@
fs = require('fs'),
path = require('path');
+var FIXTURES = path.join(__dirname, '../unit/fixtures');
+var EXTENSIONS_PLUGIN = 'org.test.plugins.extensionsplugin';
+var extensionsPlugin = path.join(FIXTURES, EXTENSIONS_PLUGIN);
+
+var templateFolder = path.join(__dirname, '../../template');
+var Api = require(path.join(templateFolder, 'cordova/Api'));
+var PluginInfo = require('cordova-common').PluginInfo;
+
describe('Cordova create and build', function(){
var projectFolder = 'testcreate 応用',
@@ -27,8 +35,14 @@
appPackagesFolder = path.join(buildDirectory, projectFolder, 'AppPackages'),
buildScriptPath = '"' + path.join(buildDirectory, projectFolder, 'cordova', 'build') + '"';
+ function verifySubDirContainsFile(subDirName, fileName) {
+ var subDir = path.join(appPackagesFolder, subDirName);
+ var packages = shell.ls(subDir);
+ expect(packages.filter(function(file) { return file.match(fileName); }).length).toBe(1);
+ }
+
beforeEach(function(){
- shell.exec(path.join('bin', 'create') + ' "' + projectFolder + '" com.test.app 応用', {silent : true});
+ shell.exec(path.join('bin', 'create') + ' "' + projectFolder + '" com.test.app 応用', {silent : true});
});
afterEach(function() {
@@ -60,10 +74,103 @@
expect(packages.filter(function(file) { return file.match(/.*Phone.*x86.*\.appx.*/); }).length).toBe(1);
expect(packages.filter(function(file) { return file.match(/.*Phone.*x64.*\.appx.*/); }).length).toBe(1);
expect(packages.filter(function(file) { return file.match(/.*Phone.*arm.*\.appx.*/); }).length).toBe(1);
- expect(packages.filter(function(file) { return file.match(/.*Phone.*AnyCPU.*\.appx.*/); }).length).toBe(1);
+ expect(packages.filter(function(file) { return file.match(/.*Phone.*AnyCPU.*\.appx.*/i); }).length).toBe(1);
expect(packages.filter(function(file) { return file.match(/.*Windows.*x64.*\.appx.*/); }).length).toBe(1);
expect(packages.filter(function(file) { return file.match(/.*Windows.*x86.*\.appx.*/); }).length).toBe(1);
expect(packages.filter(function(file) { return file.match(/.*Windows.*arm.*\.appx.*/); }).length).toBe(1);
- expect(packages.filter(function(file) { return file.match(/.*Windows.*anycpu.*\.appx.*/); }).length).toBe(1);
+ expect(packages.filter(function(file) { return file.match(/.*Windows.*anycpu.*\.appx.*/i); }).length).toBe(1);
+ });
+
+ it('spec.5 should build project containing plugin with InProcessServer extension', function(done){
+ var extensionsPluginInfo, api;
+
+ extensionsPluginInfo = new PluginInfo(extensionsPlugin);
+ api = new Api();
+ api.root = projectFolder;
+ api.locations.root = projectFolder;
+ api.locations.www = path.join(projectFolder, 'www');
+
+ var fail = jasmine.createSpy('fail')
+ .and.callFake(function (err) {
+ console.error(err);
+ });
+
+ api.addPlugin(extensionsPluginInfo)
+ .then(function() {
+ shell.exec(buildScriptPath, {silent:true});
+ var packages = shell.ls(appPackagesFolder);
+ expect(packages.filter(function(file) { return file.match(/.*Phone.*\.appx.*/); }).length).toBe(1);
+ expect(packages.filter(function(file) { return file.match(/.*Windows.*\.appx.*/); }).length).toBe(1);
+ })
+ .catch(fail)
+ .finally(function() {
+ expect(fail).not.toHaveBeenCalled();
+ done();
+ });
+ });
+
+ it('spec.6 should generate appxupload and appxbundle for Windows 8.1 project bundle release build', function(){
+ shell.exec(buildScriptPath + ' --release --win --bundle --archs=\"x64 x86 arm\"', {silent : true});
+ var packages = shell.ls(appPackagesFolder);
+ expect(packages.filter(function(file) { return file.match(/.*bundle\.appxupload$/); }).length > 0).toBeTruthy();
+
+ var bundleDirName = 'CordovaApp.Windows_1.0.0.0_Test';
+ expect(packages.filter(function(file) { return file.match(bundleDirName); }).length).toBe(1);
+
+ verifySubDirContainsFile(bundleDirName, 'CordovaApp.Windows_1.0.0.0_x64_x86_arm.appxbundle');
+ });
+
+ it('spec.6.1 should generate appxupload for Windows 8.1 project non-bundle release build', function(){
+ shell.exec(buildScriptPath + ' --release --win --archs=\"x64 x86 arm\"', {silent : true});
+ var packages = shell.ls(appPackagesFolder);
+ expect(packages.filter(function(file) { return file.match(/.*\.appxupload$/); }).length).toBe(3);
+ });
+
+ it('spec.7 should generate appxupload and appxbundle for Windows 10 project bundle release build', function(){
+ shell.exec(buildScriptPath + ' --release --win --appx=uap --bundle --archs=\"x64 x86 arm\"', {silent : true});
+ var packages = shell.ls(appPackagesFolder);
+ expect(packages.filter(function(file) { return file.match(/.*bundle\.appxupload$/); }).length > 0).toBeTruthy();
+
+ var bundleDirName = 'CordovaApp.Windows10_1.0.0.0_Test';
+ expect(packages.filter(function(file) { return file.match(bundleDirName); }).length).toBe(1);
+
+ verifySubDirContainsFile(bundleDirName, 'CordovaApp.Windows10_1.0.0.0_x64_x86_arm.appxbundle');
+ });
+
+ it('spec.7.1 should generate appxupload for Windows 10 project non-bundle release build', function(){
+ shell.exec(buildScriptPath + ' --release --win --appx=uap --archs=\"x64 x86 arm\"', {silent : true});
+ var packages = shell.ls(appPackagesFolder);
+ expect(packages.filter(function(file) { return file.match(/.*\.appxupload$/); }).length).toBe(3);
+
+ // CB-12416 Should build appx in separate dirs for each architecture
+ var armSubDir = 'CordovaApp.Windows10_1.0.0.0_arm_Test',
+ x64SubDir = 'CordovaApp.Windows10_1.0.0.0_x64_Test',
+ x86SubDir = 'CordovaApp.Windows10_1.0.0.0_x86_Test';
+
+ // Should contain a subdirectory for each of the architectures
+ expect(packages.filter(function(file) { return file.match(armSubDir); }).length).toBe(1);
+ expect(packages.filter(function(file) { return file.match(x64SubDir); }).length).toBe(1);
+ expect(packages.filter(function(file) { return file.match(x86SubDir); }).length).toBe(1);
+
+ // These subdirectories should contain corresponding appx files
+ verifySubDirContainsFile(armSubDir, 'CordovaApp.Windows10_1.0.0.0_arm.appx');
+ verifySubDirContainsFile(x64SubDir, 'CordovaApp.Windows10_1.0.0.0_x64.appx');
+ verifySubDirContainsFile(x86SubDir, 'CordovaApp.Windows10_1.0.0.0_x86.appx');
+ });
+
+ it('spec.8 for a non-bundle case for Windows Phone 8.1 it should build appx in separate dirs for each architecture', function(){
+ shell.exec(buildScriptPath + ' --release --phone --archs=\"x86 arm\"', {silent : true});
+ var packages = shell.ls(appPackagesFolder);
+
+ var armSubDir = 'CordovaApp.Phone_1.0.0.0_arm_Test',
+ x86SubDir = 'CordovaApp.Phone_1.0.0.0_x86_Test';
+
+ // Should contain a subdirectory for each of the architectures
+ expect(packages.filter(function(file) { return file.match(armSubDir); }).length).toBe(1);
+ expect(packages.filter(function(file) { return file.match(x86SubDir); }).length).toBe(1);
+
+ // These subdirectories should contain corresponding appx files
+ verifySubDirContainsFile(armSubDir, 'CordovaApp.Phone_1.0.0.0_arm.appx');
+ verifySubDirContainsFile(x86SubDir, 'CordovaApp.Phone_1.0.0.0_x86.appx');
});
});
diff --git a/spec/support/jasmine.json b/spec/support/jasmine.json
new file mode 100644
index 0000000..f683549
--- /dev/null
+++ b/spec/support/jasmine.json
@@ -0,0 +1,8 @@
+{
+ "spec_dir": "spec",
+ "spec_files": [
+ "../spec/unit/**/*[sS]pec.js"
+ ],
+ "stopSpecOnExpectationFailure": false,
+ "random": false
+}
diff --git a/spec/unit/AppxManifest.spec.js b/spec/unit/AppxManifest.spec.js
index 0da7afa..ab5f992 100644
--- a/spec/unit/AppxManifest.spec.js
+++ b/spec/unit/AppxManifest.spec.js
@@ -38,7 +38,7 @@
beforeEach(function () {
var parseElementtreeSyncOrig = xml.parseElementtreeSync;
- spyOn(xml, 'parseElementtreeSync').andCallFake(function (manifestPath) {
+ spyOn(xml, 'parseElementtreeSync').and.callFake(function (manifestPath) {
return XMLS[manifestPath] || parseElementtreeSyncOrig(manifestPath);
});
@@ -47,21 +47,21 @@
describe('constructor', function () {
- it('should create a new AppxManifest instance', function () {
+ it('Test #000 : should create a new AppxManifest instance', function () {
var manifest;
expect(function () { manifest = new AppxManifest(WINDOWS_MANIFEST); }).not.toThrow();
expect(manifest instanceof AppxManifest).toBe(true);
});
- it('should throw if first parameter is not a file', function () {
+ it('Test #001 : should throw if first parameter is not a file', function () {
expect(function () { new AppxManifest('/invalid/path'); }).toThrow();
});
- it('should throw if first parameter is not a valid manifest file (no "Package" tag)', function () {
+ it('Test #002 : should throw if first parameter is not a valid manifest file (no "Package" tag)', function () {
expect(function () { new AppxManifest('/invalid/manifest'); }).toThrow();
});
- it('should add ":" to manifest prefix if needed', function () {
+ it('Test #003 : should add ":" to manifest prefix if needed', function () {
expect(new AppxManifest(WINDOWS_MANIFEST, 'prefix').prefix).toEqual('prefix:');
});
});
@@ -71,20 +71,20 @@
AppxManifest.__set__('manifestCache', { a: 'foo/a', b: 'foo/b', c: 'foo/c' });
});
- it('should remove all entries when no parameter is specified', function () {
+ it('Test #004 : should remove all entries when no parameter is specified', function () {
AppxManifest.purgeCache();
var cache = AppxManifest.__get__('manifestCache');
expect(Object.keys(cache).length).toBe(0);
});
- it('should remove an entry when parameter is a string key', function () {
+ it('Test #005 : should remove an entry when parameter is a string key', function () {
AppxManifest.purgeCache('a');
var cache = AppxManifest.__get__('manifestCache');
expect(Object.keys(cache).length).toBe(2);
expect(cache.a).not.toBeDefined();
});
- it('should remove multiple entries when parameter is an array of keys', function () {
+ it('Test #006 : should remove multiple entries when parameter is an array of keys', function () {
AppxManifest.purgeCache(['a', 'b']);
var cache = AppxManifest.__get__('manifestCache');
expect(Object.keys(cache).length).toBe(1);
@@ -92,7 +92,7 @@
expect(cache.b).not.toBeDefined();
});
- it('should not remove anything if there is no such key', function () {
+ it('Test #007 : should not remove anything if there is no such key', function () {
AppxManifest.purgeCache(['bar']);
var cache = AppxManifest.__get__('manifestCache');
expect(Object.keys(cache).length).toBe(3);
@@ -104,16 +104,16 @@
describe('static get() method', function () {
- it('should return an AppxManifest instance', function () {
+ it('Test #008 : should return an AppxManifest instance', function () {
expect(AppxManifest.get(WINDOWS_MANIFEST) instanceof AppxManifest).toBe(true);
});
- it('should detect manifest prefix based on "Package" element attributes', function () {
+ it('Test #009 : should detect manifest prefix based on "Package" element attributes', function () {
expect(AppxManifest.get(WINDOWS_MANIFEST).prefix).toEqual('m2:');
expect(AppxManifest.get(WINDOWS_PHONE_MANIFEST).prefix).toEqual('m3:');
});
- it('should instantiate either AppxManifest or Windows 10 AppxManifest based on manifest prefix', function () {
+ it('Test #010 : should instantiate either AppxManifest or Windows 10 AppxManifest based on manifest prefix', function () {
expect(AppxManifest.get('/no/prefixed').prefix).toEqual('');
expect(AppxManifest.get('/no/prefixed') instanceof AppxManifest).toBe(true);
expect(AppxManifest.get('/no/prefixed') instanceof Win10AppxManifest).toBe(false);
@@ -122,32 +122,32 @@
expect(AppxManifest.get('/uap/prefixed') instanceof Win10AppxManifest).toBe(true);
});
- it('should cache AppxManifest instances by default', function () {
+ it('Test #011 : should cache AppxManifest instances by default', function () {
var manifest = AppxManifest.get('/no/prefixed');
- expect(xml.parseElementtreeSync.calls.length).toBe(2);
+ expect(xml.parseElementtreeSync.calls.count()).toBe(2);
var manifest2 = AppxManifest.get('/no/prefixed');
- expect(xml.parseElementtreeSync.calls.length).toBe(2);
+ expect(xml.parseElementtreeSync.calls.count()).toBe(2);
expect(manifest).toBe(manifest2);
});
- it('should not use cache to get AppxManifest instances when "ignoreCache" is specified', function () {
+ it('Test #012 : should not use cache to get AppxManifest instances when "ignoreCache" is specified', function () {
var manifest = AppxManifest.get('/no/prefixed');
- expect(xml.parseElementtreeSync.calls.length).toBe(2);
+ expect(xml.parseElementtreeSync.calls.count()).toBe(2);
var manifest2 = AppxManifest.get('/no/prefixed', true);
- expect(xml.parseElementtreeSync.calls.length).toBe(4);
+ expect(xml.parseElementtreeSync.calls.count()).toBe(4);
expect(manifest).not.toBe(manifest2);
});
- it('should not cache AppxManifest instances when "ignoreCache" is specified', function () {
+ it('Test #013 : should not cache AppxManifest instances when "ignoreCache" is specified', function () {
var manifest = AppxManifest.get('/no/prefixed', true);
- expect(xml.parseElementtreeSync.calls.length).toBe(2);
+ expect(xml.parseElementtreeSync.calls.count()).toBe(2);
var manifest2 = AppxManifest.get('/no/prefixed');
- expect(xml.parseElementtreeSync.calls.length).toBe(4);
+ expect(xml.parseElementtreeSync.calls.count()).toBe(4);
expect(manifest).not.toBe(manifest2);
});
@@ -156,7 +156,7 @@
describe('instance get* methods', function () {
var methods = ['getPhoneIdentity','getIdentity','getProperties','getApplication','getVisualElements'];
- it('should exists', function () {
+ it('Test #014 : should exists', function () {
var manifest = AppxManifest.get(WINDOWS_PHONE_MANIFEST);
var emptyManifest = AppxManifest.get('/no/prefixed');
@@ -171,7 +171,7 @@
});
describe('instance write method', function () {
- it('should not write duplicate UAP capability declarations', function () {
+ it('Test #015 : should not write duplicate UAP capability declarations', function () {
var manifest = AppxManifest.get(WINDOWS_10_MANIFEST);
var capabilities = manifest.doc.find('.//Capabilities');
capabilities.append(new et.Element('uap:Capability', { 'Name': 'enterpriseAuthentication' }));
@@ -184,9 +184,54 @@
});
describe('getVisualElements methods', function () {
- it('refineColor should leave CSS color name as is', function () {
+ it('Test #016 : refineColor should leave CSS color name as is', function () {
expect(refineColor(CSS_COLOR_NAME)).toEqual(CSS_COLOR_NAME);
});
+
+ it('Test #017 : setForegroundText should change the ForegroundText property on non-Windows 10 platforms', function () {
+ var visualElementsWindows = AppxManifest.get(WINDOWS_MANIFEST).getVisualElements();
+ var visualElementsWindows10 = AppxManifest.get(WINDOWS_10_MANIFEST).getVisualElements();
+
+ var foregroundTextLight = 'light';
+ var foregroundTextDark = 'dark';
+ var foregroundTextDefault = foregroundTextLight;
+
+ // Set to 'light'
+ visualElementsWindows.setForegroundText(foregroundTextLight);
+ expect(visualElementsWindows.getForegroundText()).toEqual(foregroundTextLight);
+
+ // Set to 'dark'
+ visualElementsWindows.setForegroundText(foregroundTextDark);
+ expect(visualElementsWindows.getForegroundText()).toEqual(foregroundTextDark);
+
+ // Simulate removal of preference, should change back to default vlaue 'light'
+ visualElementsWindows.setForegroundText(undefined);
+ expect(visualElementsWindows.getForegroundText()).toEqual(foregroundTextDefault);
+
+ // Returns nothing on Windows 10
+ visualElementsWindows10.setForegroundText(foregroundTextLight);
+ expect(visualElementsWindows10.getForegroundText()).toEqual(undefined);
+ });
+
+ it('Test #018 : getSplashScreenExtension/setSplashScreenExtension', function () {
+ var visualElementsWindows = AppxManifest.get(WINDOWS_MANIFEST).getVisualElements();
+ var visualElementsWindows10 = AppxManifest.get(WINDOWS_10_MANIFEST).getVisualElements();
+ var visualElementsWindowsPhone = AppxManifest.get(WINDOWS_PHONE_MANIFEST).getVisualElements();
+ var jpgExtension = '.jpg';
+
+ // PNG is default extension
+ expect(visualElementsWindows.getSplashScreenExtension()).toEqual('.png');
+ expect(visualElementsWindows10.getSplashScreenExtension()).toEqual('.png');
+ expect(visualElementsWindowsPhone.getSplashScreenExtension()).toEqual('.png');
+
+ // Set to jpg
+ visualElementsWindows.setSplashScreenExtension(jpgExtension);
+ expect(visualElementsWindows.getSplashScreenExtension()).toEqual(jpgExtension);
+ visualElementsWindows10.setSplashScreenExtension(jpgExtension);
+ expect(visualElementsWindows10.getSplashScreenExtension()).toEqual(jpgExtension);
+ visualElementsWindowsPhone.setSplashScreenExtension(jpgExtension);
+ expect(visualElementsWindowsPhone.getSplashScreenExtension()).toEqual(jpgExtension);
+ });
});
});
diff --git a/spec/unit/ConfigChanges.spec.js b/spec/unit/ConfigChanges.spec.js
index 3733fe8..e641bdc 100644
--- a/spec/unit/ConfigChanges.spec.js
+++ b/spec/unit/ConfigChanges.spec.js
@@ -19,14 +19,30 @@
var BaseMunger = require('cordova-common').ConfigChanges.PlatformMunger;
var PlatformMunger = require('../../template/cordova/lib/ConfigChanges').PlatformMunger;
+var PluginInfoProvider = require('cordova-common').PluginInfoProvider;
+var PluginInfo = require('../../template/cordova/lib/PluginInfo.js').PluginInfo;
+var Api = require('../../template/cordova/Api');
+var AppxManifest = require('../../template/cordova/lib/AppxManifest');
var os = require('os');
var path = require('path');
var shell = require('shelljs');
+var rewire = require('rewire');
+var configChanges = require('../../template/cordova/lib/ConfigChanges');
+var pluginInfo = rewire('../../template/cordova/lib/PluginInfo.js');
var tempDir = path.join(os.tmpdir(), 'windows');
var WINDOWS_MANIFEST = 'package.windows.appxmanifest';
var WINDOWS10_MANIFEST = 'package.windows10.appxmanifest';
+var FIXTURES = path.join(__dirname, 'fixtures');
+var DUMMY_PLUGIN = 'org.test.plugins.capabilityplugin';
+var CONFIG_PLUGIN = 'org.test.configtest';
+
+var dummyPlugin = path.join(FIXTURES, DUMMY_PLUGIN);
+var configplugin = path.join(FIXTURES, CONFIG_PLUGIN);
+var dummyProjName = 'testProj';
+var windowsProject = path.join(FIXTURES, dummyProjName);
+var windows_testapp_jsproj = path.join(FIXTURES, 'testProj/platforms/windows/CordovaApp.Windows.jsproj');
describe('PlatformMunger', function () {
var munge, munger;
@@ -37,7 +53,7 @@
{ before: undefined, count: 1, xml: '<DummyElement name="Dummy" />'}
]}};
munger = new PlatformMunger('windows', tempDir);
- spyOn(BaseMunger.prototype, 'apply_file_munge').andCallThrough();
+ spyOn(BaseMunger.prototype, 'apply_file_munge').and.callThrough();
});
afterEach(function () {
@@ -52,26 +68,212 @@
});
it('should additionally call parent\'s method with another munge if removing changes from windows 10 appxmanifest', function () {
- munger.apply_file_munge('package.windows10.appxmanifest', munge, /*remove=*/true);
+ munger.apply_file_munge(WINDOWS10_MANIFEST, munge, /*remove=*/true);
expect(BaseMunger.prototype.apply_file_munge).toHaveBeenCalledWith(WINDOWS10_MANIFEST, munge, true);
- expect(BaseMunger.prototype.apply_file_munge).toHaveBeenCalledWith(WINDOWS10_MANIFEST, jasmine.any(Object), true);
});
it('should remove uap: capabilities added by windows prepare step', function () {
// Generate a munge that contain non-prefixed capabilities changes
- var baseMunge = { parents: { WINDOWS10_MANIFEST: [
+ var baseMunge = { parents: { '/Package/Capabilities': [
// Emulate capability that was initially added with uap prefix
{ before: undefined, count: 1, xml: '<uap:Capability Name=\"privateNetworkClientServer\">'},
{ before: undefined, count: 1, xml: '<Capability Name=\"enterpriseAuthentication\">'}
]}};
- var capabilitiesMunge = { parents: { WINDOWS10_MANIFEST: [
+ var capabilitiesMunge = { parents: { '/Package/Capabilities': [
+ { before: undefined, count: 1, xml: '<uap:Capability Name=\"privateNetworkClientServer\">'},
{ before: undefined, count: 1, xml: '<uap:Capability Name=\"enterpriseAuthentication\">'}
]}};
-
- munger.apply_file_munge('package.windows10.appxmanifest', baseMunge, /*remove=*/true);
+ munger.apply_file_munge(WINDOWS10_MANIFEST, baseMunge, /*remove=*/true);
expect(BaseMunger.prototype.apply_file_munge).toHaveBeenCalledWith(WINDOWS10_MANIFEST, capabilitiesMunge, true);
});
});
});
+describe('Capabilities within package.windows.appxmanifest', function() {
+
+ var testDir, windowsPlatform, windowsManifest, windowsManifest10, dummyPluginInfo, api;
+
+ beforeEach(function() {
+ testDir = path.join(__dirname, 'testDir');
+ shell.mkdir('-p', testDir);
+ shell.cp('-rf', windowsProject + '/*', testDir);
+ windowsPlatform = path.join(testDir, 'platforms/windows');
+ windowsManifest = path.join(windowsPlatform, WINDOWS_MANIFEST);
+ windowsManifest10 = path.join(windowsPlatform, WINDOWS10_MANIFEST);
+ dummyPluginInfo = new PluginInfo(dummyPlugin);
+ api = new Api();
+ api.root = windowsPlatform;
+ api.locations.root = windowsPlatform;
+ api.locations.www = path.join(windowsPlatform, 'www');
+ });
+
+ afterEach(function() {
+ shell.rm('-rf', testDir);
+ });
+
+ function getPluginCapabilities(pluginInfo) {
+ return pluginInfo.getConfigFiles()[0].xmls;
+ }
+
+ function getManifestCapabilities(manifest) {
+ var appxmanifest = AppxManifest.get(manifest, true);
+ return appxmanifest.getCapabilities();
+ }
+
+ var fail = jasmine.createSpy('fail')
+ .and.callFake(function (err) {
+ console.error(err);
+ });
+
+ it('should be removed using overriden PlatformMunger', function(done) {
+ api.addPlugin(dummyPluginInfo)
+ .then(function() {
+ // There is the one default capability in manifest with 'internetClient' name
+ expect(getManifestCapabilities(windowsManifest).length).toBe(getPluginCapabilities(dummyPluginInfo).length + 1);
+ api.removePlugin(dummyPluginInfo);
+ })
+ .then(function() {
+ expect(getManifestCapabilities(windowsManifest).length).toBe(1);
+ })
+ .catch(fail)
+ .finally(function() {
+ expect(fail).not.toHaveBeenCalled();
+ done();
+ });
+ });
+
+ it('should be added with uap prefixes when install plugin', function(done) {
+ api.addPlugin(dummyPluginInfo)
+ .then(function() {
+ // There is the one default capability in manifest with 'internetClient' name
+ var manifestCapabilities = getManifestCapabilities(windowsManifest10);
+ expect(manifestCapabilities.length).toBe(getPluginCapabilities(dummyPluginInfo).length + 1);
+
+ // Count 'uap' prefixed capabilities
+ var uapPrefixedCapsCount = manifestCapabilities.filter(function(capability) {
+ return capability.type === 'uap:Capability';
+ }).length;
+
+ expect(uapPrefixedCapsCount).toBe(2);
+ api.removePlugin(dummyPluginInfo);
+ })
+ .then(function() {
+ expect(getManifestCapabilities(windowsManifest10).length).toBe(1);
+ })
+ .catch(fail)
+ .finally(function() {
+ expect(fail).not.toHaveBeenCalled();
+ done();
+ });
+ });
+
+ it('should be added as DeviceCapabilities when install plugin', function(done) {
+ function isDeviceCapability(capability) {
+ return capability.type === 'DeviceCapability';
+ }
+
+ function checkCapabilitiesAfterInstall(manifest) {
+ // There is the one default capability in manifest with 'internetClient' name
+ var manifestCapabilities = getManifestCapabilities(manifest);
+ var pluginCapabilities = getPluginCapabilities(dummyPluginInfo);
+
+ expect(manifestCapabilities.length).toBe(pluginCapabilities.length + 1);
+
+ var manifestDeviceCapabilties = manifestCapabilities.filter(isDeviceCapability);
+ expect(manifestDeviceCapabilties.length).toBe(1);
+ }
+
+ function checkCapabilitiesAfterRemove(manifest) {
+ var manifestCapabilities = getManifestCapabilities(manifest);
+ expect(manifestCapabilities.length).toBe(1);
+ }
+
+ api.addPlugin(dummyPluginInfo)
+ .then(function() {
+ checkCapabilitiesAfterInstall(windowsManifest);
+ checkCapabilitiesAfterInstall(windowsManifest10);
+ api.removePlugin(dummyPluginInfo);
+ })
+ .then(function() {
+ checkCapabilitiesAfterRemove(windowsManifest);
+ checkCapabilitiesAfterRemove(windowsManifest10);
+ })
+ .catch(fail)
+ .finally(function() {
+ expect(fail).not.toHaveBeenCalled();
+ done();
+ });
+ });
+});
+
+describe('generate_plugin_config_munge for windows project', function() {
+ beforeEach(function() {
+ shell.mkdir('-p', tempDir);
+ shell.cp('-rf', windows_testapp_jsproj, tempDir);
+ });
+
+ afterEach(function() {
+ shell.rm('-rf', tempDir);
+ });
+
+ it('should special case config-file elements for windows', function() {
+ var pluginInfoProvider = new PluginInfoProvider();
+ var munger = new configChanges.PlatformMunger('windows', tempDir, 'unused', null, pluginInfoProvider);
+ var munge = munger.generate_plugin_config_munge(new PluginInfo(configplugin), {});
+ var windows81AppxManifest = munge.files['package.windows.appxmanifest'];
+ var winphone81AppxManifest = munge.files['package.phone.appxmanifest'];
+ var windows10AppxManifest = munge.files['package.windows10.appxmanifest'];
+
+ // 1 comes from versions="=8.1.0" + 1 from versions="=8.1.0" device-target="windows"
+ expect(windows81AppxManifest.parents['/Parent/Capabilities'][0].xml).toBe('<Capability Note="should-exist-for-all-appxmanifest-target-files" />');
+ expect(windows81AppxManifest.parents['/Parent/Capabilities'][1].xml).toBe('<Capability Note="should-exist-for-win81-win-and-phone" />');
+ expect(windows81AppxManifest.parents['/Parent/Capabilities'][2].xml).toBe('<Capability Note="should-exist-for-win81-win-only" />');
+ expect(windows81AppxManifest.parents['/Parent/Capabilities'][3].xml).toBe('<Capability Note="should-exist-for-win10-and-win81-win-and-phone" />');
+ expect(windows81AppxManifest.parents['/Parent/Capabilities'].length).toBe(4);
+
+ // 1 comes from versions="=8.1.0" + 1 from versions="=8.1.0" device-target="phone"
+ expect(winphone81AppxManifest.parents['/Parent/Capabilities'][0].xml).toBe('<Capability Note="should-exist-for-all-appxmanifest-target-files" />');
+ expect(winphone81AppxManifest.parents['/Parent/Capabilities'][1].xml).toBe('<Capability Note="should-exist-for-win81-win-and-phone" />');
+ expect(winphone81AppxManifest.parents['/Parent/Capabilities'][2].xml).toBe('<Capability Note="should-exist-for-win81-phone-only" />');
+ expect(winphone81AppxManifest.parents['/Parent/Capabilities'][3].xml).toBe('<Capability Note="should-exist-for-win10-and-win81-win-and-phone" />');
+ expect(winphone81AppxManifest.parents['/Parent/Capabilities'].length).toBe(4);
+
+ expect(windows10AppxManifest.parents['/Parent/Capabilities'][0].xml).toBe('<Capability Note="should-exist-for-all-appxmanifest-target-files" />');
+ expect(windows10AppxManifest.parents['/Parent/Capabilities'][1].xml).toBe('<Capability Note="should-exist-for-win10-and-win81-win-and-phone" />');
+ expect(windows10AppxManifest.parents['/Parent/Capabilities'][2].xml).toBe('<Capability Note="should-exist-in-win10-only" />');
+ expect(windows10AppxManifest.parents['/Parent/Capabilities'].length).toBe(3);
+ });
+
+ it('should not process change w/o target package.appxmanifest', function() {
+ var processChanges = pluginInfo.__get__('processChanges');
+ var testChanges = [
+ {
+ target: 'package.windows.appxmanifest'
+ },
+ {
+ target: 'package.appxmanifest'
+ }
+ ];
+
+ var changes = processChanges(testChanges);
+ expect(changes.length).toBe(4);
+ expect(changes[0].target).toBe(testChanges[0].target);
+ });
+
+ it('should apply changes to all manifests in case of incorrect "deviceTarget" attribute', function() {
+ var processChanges = pluginInfo.__get__('processChanges');
+
+ var testChanges = [{
+ deviceTarget: 'wrong_device_target',
+ target: 'package.appxmanifest'
+ }];
+
+ var changes = processChanges(testChanges);
+ expect(changes.length).toBe(3);
+ expect(changes[0].target).toBe('package.windows.appxmanifest');
+ expect(changes[1].target).toBe('package.phone.appxmanifest');
+ expect(changes[2].target).toBe('package.windows10.appxmanifest');
+ });
+});
+
diff --git a/spec/unit/JsprojManager.spec.js b/spec/unit/JsprojManager.spec.js
index 5e1834f..132a705 100644
--- a/spec/unit/JsprojManager.spec.js
+++ b/spec/unit/JsprojManager.spec.js
@@ -43,9 +43,9 @@
JsprojManager.__set__('proj', jasmine.createSpy('proj'));
- spyOn(shell, 'ls').andReturn([PROJECT_PATH + '/CordovaApp.projitems']);
- spyOn(xml, 'parseElementtreeSync').andReturn(FAKE_MANIFEST);
- spyOn(AppxManifest, 'get').andCallThrough();
+ spyOn(shell, 'ls').and.returnValue([PROJECT_PATH + '/CordovaApp.projitems']);
+ spyOn(xml, 'parseElementtreeSync').and.returnValue(FAKE_MANIFEST);
+ spyOn(AppxManifest, 'get').and.callThrough();
project = JsprojManager.getProject(PROJECT_PATH);
});
@@ -55,7 +55,7 @@
});
it('should throw if project is not a windows project', function () {
- shell.ls.andCallThrough();
+ shell.ls.and.callThrough();
expect(function () {
JsprojManager.getProject(INVALID_PROJECT_PATH);
}).toThrow();
@@ -65,6 +65,6 @@
expect(project.getPackageName()).toBe('HelloCordova');
expect(AppxManifest.get).toHaveBeenCalled();
// Should pass 'ignoreCache' option to 'get' method
- expect(AppxManifest.get.calls[0].args[1]).toBe(true);
+ expect(AppxManifest.get.calls.argsFor(0)[1]).toBe(true);
});
});
diff --git a/spec/unit/MSBuildTools.spec.js b/spec/unit/MSBuildTools.spec.js
index 442479b..8c65248 100644
--- a/spec/unit/MSBuildTools.spec.js
+++ b/spec/unit/MSBuildTools.spec.js
@@ -106,7 +106,7 @@
it('spec.6 should return valid version and path', function(){
var version = '14.0';
- spawnSpy.andReturn(Q.resolve(
+ spawnSpy.and.returnValue(Q.resolve(
'\r\nHKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\12.0\r\n\t' +
'MSBuildToolsPath\tREG_SZ\t' + fakeToolsPath(version) + '\r\n\r\n')
);
@@ -118,7 +118,7 @@
});
it('spec.7 should return null if no tools found for version', function(){
- spawnSpy.andReturn(Q.resolve('ERROR: The system was unable to find the specified registry key or value.'));
+ spawnSpy.and.returnValue(Q.resolve('ERROR: The system was unable to find the specified registry key or value.'));
checkMSBuildVersion('14.0').then(function (actual) {
expect(actual).not.toBeDefined();
@@ -126,7 +126,7 @@
});
it('spec.8 should return null on internal error', function(){
- spawnSpy.andReturn(Q.reject());
+ spawnSpy.and.returnValue(Q.reject());
checkMSBuildVersion('14.0').then(function (actual) {
expect(actual).not.toBeDefined();
@@ -156,8 +156,8 @@
var programFilesOrig = process.env['ProgramFiles'];
beforeEach(function () {
- shellTest = spyOn(shell, 'test').andReturn(true);
- shellLs = spyOn(shell, 'ls').andReturn(availableVersions);
+ shellTest = spyOn(shell, 'test').and.returnValue(true);
+ shellLs = spyOn(shell, 'ls').and.returnValue(availableVersions);
process.env['ProgramFiles(x86)'] = '/';
process.env['ProgramFiles'] = '/';
});
@@ -174,9 +174,9 @@
});
it('should return empty array if no UAP SDKs installed', function() {
- shellLs.andReturn([]);
+ shellLs.and.returnValue([]);
expect(buildTools.getAvailableUAPVersions().length).toEqual(0);
- shellTest.andReturn(false);
+ shellTest.and.returnValue(false);
expect(buildTools.getAvailableUAPVersions().length).toEqual(0);
});
@@ -188,7 +188,7 @@
it('should return sorted list versions with only valid versions', function() {
var brokenAvailableVersions = availableVersions.concat('Broken.version');
- shellLs.andReturn(brokenAvailableVersions);
+ shellLs.and.returnValue(brokenAvailableVersions);
var versions = buildTools.getAvailableUAPVersions();
expect(versions).toEqual(jasmine.any(Array));
@@ -222,7 +222,7 @@
});
it('should return MSBuildTools instance', function (done) {
- spawnSpy.andReturn(Q(fakeVersion));
+ spawnSpy.and.returnValue(Q(fakeVersion));
buildTools.getMSBuildToolsAt(fakePath)
.then(function (tools) {
@@ -237,7 +237,7 @@
});
it('should reject promise if no msbuild found', function (done) {
- spawnSpy.andReturn(Q.reject());
+ spawnSpy.and.returnValue(Q.reject());
buildTools.getMSBuildToolsAt(messyPath)
.then(success, fail)
diff --git a/spec/unit/Prepare.Win10.spec.js b/spec/unit/Prepare.Win10.spec.js
index 222b7b4..977c0bc 100644
--- a/spec/unit/Prepare.Win10.spec.js
+++ b/spec/unit/Prepare.Win10.spec.js
@@ -34,7 +34,12 @@
applyStartPage = prepare.__get__('applyStartPage');
var Win10ManifestPath = 'template/package.windows10.appxmanifest',
- Win81ManifestPath = 'template/package.windows.appxmanifest';
+ Win81ManifestPath = 'template/package.windows.appxmanifest',
+ WP81ManifestPath = 'template/package.phone.appxmanifest';
+
+var Win10ManifestName = path.basename(Win10ManifestPath),
+ Win81ManifestName = path.basename(Win81ManifestPath),
+ WP81ManifestName = path.basename(WP81ManifestPath);
/***
* Unit tests for validating default ms-appx-web:// URI scheme in Win10
@@ -195,7 +200,7 @@
mockConfig = createMockConfigAndManifestForApplyAccessRules(true, 'http://www.bing.com/*');
addCapabilityDeclarationToMockManifest(mockConfig.manifest, 'documentsLibrary');
- spyOn(AppxManifest, 'get').andReturn(mockConfig.manifest);
+ spyOn(AppxManifest, 'get').and.returnValue(mockConfig.manifest);
stringFound = false;
events.on('warn', function (msg) {
@@ -237,7 +242,7 @@
'</widget>\n';
var origParseElementtreeSync = xml.parseElementtreeSync;
- spyOn(xml, 'parseElementtreeSync').andCallFake(function(path) {
+ spyOn(xml, 'parseElementtreeSync').and.callFake(function(path) {
if (path ==='config.xml') return new et.ElementTree(et.XML(TEST_XML));
return origParseElementtreeSync(path);
});
@@ -245,7 +250,7 @@
var config = new ConfigParser('config.xml');
var origGetPreference = config.getPreference;
- spyOn(config, 'getPreference').andCallFake(function (prefName) {
+ spyOn(config, 'getPreference').and.callFake(function (prefName) {
if (prefName === 'WindowsDefaultUriPrefix') {
return isWin10 ? 'ms-appx-web://' : 'ms-appx://';
}
@@ -461,10 +466,10 @@
var PROJECT = '/some/path';
- function createMockConfig(images) {
+ function createMockConfig(images, splashScreens) {
var result = jasmine.createSpyObj('config', ['getIcons', 'getSplashScreens']);
- result.getIcons.andReturn(images);
- result.getSplashScreens.andReturn([]);
+ result.getIcons.and.returnValue(images);
+ result.getSplashScreens.and.returnValue(splashScreens || []);
return result;
}
@@ -501,7 +506,7 @@
events.on('warn', warnSpy);
copyImages(project, locations);
expect(FileUpdater.updatePaths).toHaveBeenCalledWith({}, { rootDir: PROJECT }, logFileOp);
- expect(warnSpy.calls[0].args[0]).toMatch('image was skipped');
+ expect(warnSpy.calls.argsFor(0)[0]).toMatch('image was skipped');
});
describe('when "target" attribute is specified for the image', function () {
@@ -519,7 +524,7 @@
'Square44x44.targetsize-16.jpg'
];
- spyOn(fs, 'readdirSync').andReturn(matchingFiles.concat(nonMatchingFiles));
+ spyOn(fs, 'readdirSync').and.returnValue(matchingFiles.concat(nonMatchingFiles));
var images = [{src: 'res/Windows/Square44x44.png', target: 'SmallIcon' }];
var project = { projectConfig: createMockConfig(images), root: PROJECT };
@@ -541,4 +546,168 @@
expect(FileUpdater.updatePaths).toHaveBeenCalledWith(expectedPathMap, { rootDir: PROJECT }, logFileOp);
});
});
+
+ it('should ignore splashScreens for Windows 10 project with size >200K and emit a warning', function () {
+ var size300K = 300 * 1024;
+ var warnSpy = jasmine.createSpy('warn');
+ events.on('warn', warnSpy);
+
+ var splashScreens = [
+ {src: 'res/Windows/splashscreen.png', target: 'SplashScreen' }, // targetProject: 10
+ {src: 'res/Windows/splashscreen.scale-180.png', width: '1116', height: '540' }, // targetProject: 8.1
+ {src: 'res/Windows/splashscreen.scale-200.png', width: '1240', height: '600' }, // targetProject: 10
+ {src: 'res/Windows/splashscreen.scale-400.png', width: '2480', height: '1200' }, // targetProject: 10
+ {src: 'res/Windows/splashscreenphone.scale-240.png', width: '1152', height: '1920' }, // targetProject: WP 8.1
+ {src: 'res/Windows/splashscreenphone.png', target: 'SplashScreenPhone' }, // targetProject: WP 8.1
+ ];
+
+ var splashScreensFiles = splashScreens.map(function(splash) {
+ return path.basename(splash.src);
+ });
+ spyOn(fs, 'readdirSync').and.returnValue(splashScreensFiles);
+
+ spyOn(fs, 'statSync').and.returnValue({
+ size: size300K
+ });
+
+ var project = { projectConfig: createMockConfig([], splashScreens), root: PROJECT };
+ var locations = { root: PROJECT };
+
+ copyImages(project, locations);
+
+ var expectedPathMap = {};
+ expectedPathMap['images' + path.sep + 'SplashScreen.scale-180.png'] = 'res/Windows/splashscreen.scale-180.png';
+ expectedPathMap['images' + path.sep + 'SplashScreenPhone.scale-240.png'] = path.join('res', 'Windows', 'splashscreenphone.scale-240.png');
+ expectedPathMap['images' + path.sep + 'SplashScreenPhone.scale-100.png'] = path.join('res', 'Windows', 'splashscreenphone.png');
+ expect(FileUpdater.updatePaths).toHaveBeenCalledWith(expectedPathMap, { rootDir: PROJECT }, logFileOp);
+ expect(warnSpy.calls.argsFor(0)[0]).toMatch('file size exceeds the limit');
+ });
+
+ it('should ignore splashScreens with unsupported extensions and emit a warning', function () {
+ var warnSpy = jasmine.createSpy('warn');
+ events.on('warn', warnSpy);
+
+ var splashScreens = [
+ {src: 'res/Windows/splashscreen.gif', target: 'SplashScreen' }, // targetProject: 10
+ {src: 'res/Windows/splashscreen.scale-180.bmp', width: '1116', height: '540' }, // targetProject: 8.1
+ {src: 'res/Windows/splashscreenphone.tga', target: 'SplashScreenPhone' }, // targetProject: WP 8.1
+ ];
+
+ var splashScreensFiles = splashScreens.map(function(splash) {
+ return path.basename(splash.src);
+ });
+ spyOn(fs, 'readdirSync').and.returnValue(splashScreensFiles);
+
+ spyOn(fs, 'statSync').and.returnValue({
+ size: 0
+ });
+
+ var project = { projectConfig: createMockConfig([], splashScreens), root: PROJECT };
+ var locations = { root: PROJECT };
+
+ copyImages(project, locations);
+
+ var extensionNotSupportedMsg = 'extension is not supported';
+ var expectedPathMap = {};
+ expect(FileUpdater.updatePaths).toHaveBeenCalledWith(expectedPathMap, { rootDir: PROJECT }, logFileOp);
+ expect(warnSpy.calls.argsFor(0)[0]).toMatch(extensionNotSupportedMsg);
+ expect(warnSpy.calls.argsFor(1)[0]).toMatch(extensionNotSupportedMsg);
+ expect(warnSpy.calls.argsFor(2)[0]).toMatch(extensionNotSupportedMsg);
+ });
+
+ it('should warn about mixed splashscreen extensions used for non-MRT syntax', function () {
+ var updateSplashScreenImageExtensions = prepare.__get__('updateSplashScreenImageExtensions');
+ spyOn(fs, 'writeFileSync');
+ spyOn(AppxManifest, 'get').and.returnValue({
+ getVisualElements: function() {
+ return {
+ getSplashScreenExtension: function() {
+ return '.png';
+ },
+ setSplashScreenExtension: function() {}
+ };
+ },
+ write: function() {}
+ });
+ var warnSpy = jasmine.createSpy('warn');
+ events.on('warn', warnSpy);
+
+ var splashScreens = [
+ {src: 'res/Windows/splashscreen.png', width: '620', height: '300' }, // targetProject: 10
+ {src: 'res/Windows/splashscreen.scale-180.jpg', width: '1116', height: '540' }, // targetProject: 8.1
+ {src: 'res/Windows/splashscreen.scale-200.png', width: '1240', height: '600' }, // targetProject: 10
+ {src: 'res/Windows/splashscreen.scale-400.jpg', width: '2480', height: '1200' }, // targetProject: 10
+ {src: 'res/Windows/splashscreenphone.scale-240.png', width: '1152', height: '1920' }, // targetProject: WP 8.1
+ {src: 'res/Windows/splashscreenphone.jpg', width: '480', height: '800' }, // targetProject: WP 8.1
+ ];
+
+ var splashScreensFiles = splashScreens.map(function(splash) {
+ return path.basename(splash.src);
+ });
+ spyOn(fs, 'readdirSync').and.returnValue(splashScreensFiles);
+
+ spyOn(fs, 'statSync').and.returnValue({
+ size: 0
+ });
+
+ var project = { projectConfig: createMockConfig([], splashScreens), root: PROJECT };
+ var locations = { root: PROJECT };
+
+ updateSplashScreenImageExtensions(project, locations);
+
+ var mixedExtensionsMsg = 'splash screens have mixed file extensions';
+ expect(warnSpy.calls.argsFor(0)[0]).toMatch(mixedExtensionsMsg);
+ expect(warnSpy.calls.argsFor(1)[0]).toMatch(mixedExtensionsMsg);
+ });
+
+ it('should update manifests with proper splashscreen image extension', function () {
+ // 1. Set manifest with SplashScreen.Image = "image.png" (this is default)
+ // 2. Set config.xml with splash src="image.jpg"
+ // 3. updateSplashScreenImageExtensions should call getSplashScreenExtension, setSplashScreenExtension('.jpg')
+
+ var updateSplashScreenImageExtensions = prepare.__get__('updateSplashScreenImageExtensions');
+ spyOn(fs, 'writeFileSync');
+
+ var win10Manifest = AppxManifest.get(Win10ManifestPath),
+ win81Manifest = AppxManifest.get(Win81ManifestPath),
+ wp81Manifest = AppxManifest.get(WP81ManifestPath);
+
+ spyOn(AppxManifest, 'get').and.callFake(function(manifestPath) {
+ if (manifestPath.indexOf(Win10ManifestName) !== -1) {
+ return win10Manifest;
+ }
+
+ if (manifestPath.indexOf(Win81ManifestName) !== -1) {
+ return win81Manifest;
+ }
+
+ if (manifestPath.indexOf(WP81ManifestName) !== -1) {
+ return wp81Manifest;
+ }
+ });
+
+ var splashScreens = [
+ {src: 'res/Windows/splashscreen.jpg', width: '620', height: '300' }, // targetProject: 10
+ {src: 'res/Windows/splashscreen.scale-180.jpg', width: '1116', height: '540' }, // targetProject: 8.1
+ {src: 'res/Windows/splashscreenphone.jpg', width: '480', height: '800' }, // targetProject: WP 8.1
+ ];
+
+ var splashScreensFiles = splashScreens.map(function(splash) {
+ return path.basename(splash.src);
+ });
+ spyOn(fs, 'readdirSync').and.returnValue(splashScreensFiles);
+
+ spyOn(fs, 'statSync').and.returnValue({
+ size: 0
+ });
+
+ var project = { projectConfig: createMockConfig([], splashScreens), root: PROJECT };
+ var locations = { root: PROJECT };
+
+ updateSplashScreenImageExtensions(project, locations);
+
+ expect(win10Manifest.getVisualElements().getSplashScreenExtension()).toBe('.jpg');
+ expect(win81Manifest.getVisualElements().getSplashScreenExtension()).toBe('.jpg');
+ expect(wp81Manifest.getVisualElements().getSplashScreenExtension()).toBe('.jpg');
+ });
});
diff --git a/spec/unit/Version.spec.js b/spec/unit/Version.spec.js
index 4ee16a8..7f5882a 100644
--- a/spec/unit/Version.spec.js
+++ b/spec/unit/Version.spec.js
@@ -21,7 +21,7 @@
describe('Version constructor', function () {
- it('should behave correctly', function () {
+ it('Test #000 : should behave correctly', function () {
var v1 = new Version(1);
expect(v1.major).toBe(1);
expect(v1.minor).toBe(0);
@@ -47,13 +47,15 @@
describe('Version parse functions work as expected.', function() {
- var version = Version.fromString('1.2.4.7');
- expect(version.major).toBe(1);
- expect(version.minor).toBe(2);
- expect(version.build).toBe(4);
- expect(version.qfe).toBe(7);
+ it('Test #001 : should behave correctly', function() {
+ var version = Version.fromString('1.2.4.7');
+ expect(version.major).toBe(1);
+ expect(version.minor).toBe(2);
+ expect(version.build).toBe(4);
+ expect(version.qfe).toBe(7);
+ });
- it('should parse incomplete version string.', function() {
+ it('Test #002 : should parse incomplete version string.', function() {
var version = Version.fromString('1.5.3');
expect(version.major).toBe(1);
expect(version.minor).toBe(5);
@@ -61,7 +63,7 @@
expect(version.qfe).toBe(0);
});
- it('should produce an error as the version string is invalid', function() {
+ it('Test #003 : should produce an error as the version string is invalid', function() {
try {
Version.fromString('This is invalid.');
@@ -72,7 +74,7 @@
}
});
- it('should produce an error as the string is too long.', function() {
+ it('Test #004 : should produce an error as the string is too long.', function() {
try {
Version.fromString('1.5.3.2.7');
@@ -81,63 +83,63 @@
catch (ex) {
expect(ex.constructor).toBe(RangeError);
}
+ expect(Version.tryParse('This is invalid')).toBe(false);
});
-
- expect(Version.tryParse('This is invalid')).toBe(false);
-
});
describe('Version equality functions work as expected.', function() {
+ it('Test #005 : should parse incomplete version string.', function() {
+ var v1Base = new Version(1, 1, 2, 3);
+ // equal to v1Base
+ var v1Copy = new Version(1, 1, 2, 3);
+ // greater than v1Base by QFE
+ var gtV1ByQfe = new Version(1, 1, 2, 4);
+ // greater than v1Base by Build
+ var gtV1ByBuild = new Version(1, 1, 3, 3);
+ // greater than v1Base by Minor
+ var gtV1ByMinor = new Version(1, 2, 2, 3);
+ // greater than v1Base by Major
+ var gtV1ByMajor = new Version(2, 1, 2, 3);
- var v1Base = new Version(1, 1, 2, 3);
- // equal to v1Base
- var v1Copy = new Version(1, 1, 2, 3);
- // greater than v1Base by QFE
- var gtV1ByQfe = new Version(1, 1, 2, 4);
- // greater than v1Base by Build
- var gtV1ByBuild = new Version(1, 1, 3, 3);
- // greater than v1Base by Minor
- var gtV1ByMinor = new Version(1, 2, 2, 3);
- // greater than v1Base by Major
- var gtV1ByMajor = new Version(2, 1, 2, 3);
+ expect(v1Copy.eq(v1Base)).toBe(true);
+ expect(v1Copy.gte(v1Base)).toBe(true);
+ expect(v1Copy.gt(v1Base)).toBe(false);
- expect(v1Copy.eq(v1Base)).toBe(true);
- expect(v1Copy.gte(v1Base)).toBe(true);
- expect(v1Copy.gt(v1Base)).toBe(false);
+ expect(gtV1ByQfe.eq(v1Base)).toBe(false);
+ expect(gtV1ByQfe.gte(v1Base)).toBe(true);
+ expect(gtV1ByQfe.gt(v1Base)).toBe(true);
- expect(gtV1ByQfe.eq(v1Base)).toBe(false);
- expect(gtV1ByQfe.gte(v1Base)).toBe(true);
- expect(gtV1ByQfe.gt(v1Base)).toBe(true);
+ expect(gtV1ByBuild.eq(v1Base)).toBe(false);
+ expect(gtV1ByBuild.gte(v1Base)).toBe(true);
+ expect(gtV1ByBuild.gt(v1Base)).toBe(true);
- expect(gtV1ByBuild.eq(v1Base)).toBe(false);
- expect(gtV1ByBuild.gte(v1Base)).toBe(true);
- expect(gtV1ByBuild.gt(v1Base)).toBe(true);
+ expect(gtV1ByMinor.eq(v1Base)).toBe(false);
+ expect(gtV1ByMinor.gte(v1Base)).toBe(true);
+ expect(gtV1ByMinor.gt(v1Base)).toBe(true);
- expect(gtV1ByMinor.eq(v1Base)).toBe(false);
- expect(gtV1ByMinor.gte(v1Base)).toBe(true);
- expect(gtV1ByMinor.gt(v1Base)).toBe(true);
-
- expect(gtV1ByMajor.eq(v1Base)).toBe(false);
- expect(gtV1ByMajor.gte(v1Base)).toBe(true);
- expect(gtV1ByMajor.gt(v1Base)).toBe(true);
+ expect(gtV1ByMajor.eq(v1Base)).toBe(false);
+ expect(gtV1ByMajor.gte(v1Base)).toBe(true);
+ expect(gtV1ByMajor.gt(v1Base)).toBe(true);
+ });
});
describe('Version equality tests integrate with Array sort and toString() as expected.', function() {
+ it('Test #006 : should parse incomplete version string.', function() {
+ var v1Base = new Version(1, 1, 2, 3);
+ // equal to v1Base
+ var v1Copy = new Version(1, 1, 2, 3);
+ // greater than v1Base by QFE
+ var gtV1ByQfe = new Version(1, 1, 2, 4);
+ // greater than v1Base by Build
+ var gtV1ByBuild = new Version(1, 1, 3, 3);
+ // greater than v1Base by Minor
+ var gtV1ByMinor = new Version(1, 2, 2, 3);
+ // greater than v1Base by Major
+ var gtV1ByMajor = new Version(2, 1, 2, 3);
- var v1Base = new Version(1, 1, 2, 3);
- // equal to v1Base
- var v1Copy = new Version(1, 1, 2, 3);
- // greater than v1Base by QFE
- var gtV1ByQfe = new Version(1, 1, 2, 4);
- // greater than v1Base by Build
- var gtV1ByBuild = new Version(1, 1, 3, 3);
- // greater than v1Base by Minor
- var gtV1ByMinor = new Version(1, 2, 2, 3);
- // greater than v1Base by Major
- var gtV1ByMajor = new Version(2, 1, 2, 3);
+ var toTest = [gtV1ByBuild, gtV1ByMajor, v1Copy, gtV1ByMinor, gtV1ByQfe, v1Base];
+ toTest.sort(Version.comparer);
- var toTest = [gtV1ByBuild, gtV1ByMajor, v1Copy, gtV1ByMinor, gtV1ByQfe, v1Base];
- toTest.sort(Version.comparer);
-
- expect(toTest.join(',')).toBe('1.1.2.3,1.1.2.3,1.1.2.4,1.1.3.3,1.2.2.3,2.1.2.3');
+ expect(toTest.join(',')).toBe('1.1.2.3,1.1.2.3,1.1.2.4,1.1.3.3,1.2.2.3,2.1.2.3');
+ });
});
diff --git a/spec/unit/WindowsConfigParser.spec.js b/spec/unit/WindowsConfigParser.spec.js
index a4b1bd3..4180dc6 100644
--- a/spec/unit/WindowsConfigParser.spec.js
+++ b/spec/unit/WindowsConfigParser.spec.js
@@ -40,13 +40,13 @@
var mockConfig;
beforeEach(function () {
- spyOn(xml, 'parseElementtreeSync').andReturn(new et.ElementTree(et.XML(TEST_XML)));
+ spyOn(xml, 'parseElementtreeSync').and.returnValue(new et.ElementTree(et.XML(TEST_XML)));
mockConfig = new ConfigParser('/some/file');
});
it('should correctly transform all versions as a baseline.', function() {
- spyOn(mockConfig, 'getMatchingPreferences').andReturn([
+ spyOn(mockConfig, 'getMatchingPreferences').and.returnValue([
{ name: 'Windows.Universal-MinVersion', value: '10.0.9910.0' },
{ name: 'Windows.Universal-MaxVersionTested', value: '10.0.9917.0' },
{ name: 'Windows.Desktop-MinVersion', value: '10.0.9910.0' },
@@ -73,7 +73,7 @@
});
it('should produce versions correctly even when the config file has no settings.', function() {
- spyOn(mockConfig, 'getMatchingPreferences').andReturn([]);
+ spyOn(mockConfig, 'getMatchingPreferences').and.returnValue([]);
var versionSet = mockConfig.getAllMinMaxUAPVersions();
var verBaseline = rewire('../../template/cordova/lib/ConfigParser')
@@ -88,7 +88,7 @@
it('should fail with a RangeError if version specified incorrectly', function() {
spyOn(mockConfig, 'getMatchingPreferences')
- .andReturn([
+ .and.returnValue([
{ name: 'Windows.Universal-MinVersion', value: '10.0.9910.f' },
{ name: 'Windows.Universal-MaxVersionTested', value: '10.0.9917.0' },
]);
diff --git a/spec/unit/build.spec.js b/spec/unit/build.spec.js
index e8fd8d8..1c2bc5f 100644
--- a/spec/unit/build.spec.js
+++ b/spec/unit/build.spec.js
@@ -17,6 +17,7 @@
under the License.
*/
var Q = require('q'),
+ fs = require('fs'),
path = require('path'),
rewire = require('rewire'),
platformRoot = '../../template',
@@ -83,17 +84,17 @@
configParserOriginal = build.__get__('ConfigParser');
var originalBuildMethod = build.run;
- spyOn(build, 'run').andCallFake(function () {
+ spyOn(build, 'run').and.callFake(function () {
// Bind original build to custom 'this' object to mock platform's locations property
return originalBuildMethod.apply({locations: {www: 'some/path'}}, arguments);
});
- spyOn(utils, 'isCordovaProject').andReturn(true);
+ spyOn(utils, 'isCordovaProject').and.returnValue(true);
spyOn(prepare, 'applyPlatformConfig');
spyOn(prepare, 'updateBuildConfig');
- spyOn(package, 'getPackage').andReturn(Q({}));
+ spyOn(package, 'getPackage').and.returnValue(Q({}));
- spyOn(AppxManifest, 'get').andReturn({
+ spyOn(AppxManifest, 'get').and.returnValue({
getIdentity: function () {
return { setPublisher: function () {} };
},
@@ -112,7 +113,7 @@
buildSpy = jasmine.createSpy();
// utils.isCordovaProject is a spy, so we can call andReturn directly on it
- utils.isCordovaProject.andReturn(false);
+ utils.isCordovaProject.and.returnValue(false);
createFindAllAvailableVersionsMock([{version: '14.0', buildProject: buildSpy, path: testPath }]);
build.run([ 'node', buildPath, '--release', '--debug' ])
@@ -152,10 +153,8 @@
build.run({ buildConfig: buildConfigPath })
.finally(function() {
expect(prepare.updateBuildConfig).toHaveBeenCalled();
-
- var buildOpts = prepare.updateBuildConfig.calls[0].args[0];
+ var buildOpts = prepare.updateBuildConfig.calls.argsFor(0)[0];
var buildConfig = require(buildConfigPath).windows.debug;
-
expect(buildOpts.packageCertificateKeyFile).toBeDefined();
expect(buildOpts.packageCertificateKeyFile)
.toEqual(path.resolve(path.dirname(buildConfigPath), buildConfig.packageCertificateKeyFile));
@@ -164,13 +163,15 @@
expect(buildOpts[key]).toBeDefined();
expect(buildOpts[key]).toEqual(buildConfig[key]);
});
-
+ done();
+ }).fail(function err (errMsg) {
+ expect(errMsg).toBeUndefined();
done();
});
- });
+ }, 20000);
it('spec.4 should call buildProject of MSBuildTools with buildType = "release" if called with --release argument', function(done) {
- var buildSpy = jasmine.createSpy().andCallFake(function (solutionFile, buildType, buildArch) {
+ var buildSpy = jasmine.createSpy().and.callFake(function (solutionFile, buildType, buildArch) {
expect(buildType).toBe('release');
});
@@ -184,7 +185,7 @@
});
it('spec.5 should call buildProject of MSBuildTools with buildType = "debug" if called without arguments', function(done) {
- var buildSpy = jasmine.createSpy().andCallFake(function (solutionFile, buildType, buildArch) {
+ var buildSpy = jasmine.createSpy().and.callFake(function (solutionFile, buildType, buildArch) {
expect(buildType).toBe('debug');
});
@@ -198,7 +199,7 @@
});
it('spec.6 should call buildProject of MSBuildTools with buildArch = "arm" if called with --archs="arm" argument', function(done) {
- var buildSpy = jasmine.createSpy().andCallFake(function (solutionFile, buildType, buildArch) {
+ var buildSpy = jasmine.createSpy().and.callFake(function (solutionFile, buildType, buildArch) {
expect(buildArch).toBe('arm');
});
@@ -337,7 +338,7 @@
});
it('spec.13 should be able to override target via --appx parameter', function(done) {
- var buildSpy = jasmine.createSpy().andCallFake(function(solutionFile, buildType, buildArch) {
+ var buildSpy = jasmine.createSpy().and.callFake(function(solutionFile, buildType, buildArch) {
// check that we build Windows 10 and not Windows 8.1
expect(solutionFile.toLowerCase()).toMatch('cordovaapp.windows10.jsproj');
});
@@ -360,10 +361,10 @@
process.env.VSINSTALLDIR = customMSBuildPath;
spyOn(MSBuildTools, 'getMSBuildToolsAt')
- .andReturn(Q({
+ .and.returnValue(Q({
path: customMSBuildPath,
version: customMSBuildVersion,
- buildProject: jasmine.createSpy('buildProject').andReturn(Q())
+ buildProject: jasmine.createSpy('buildProject').and.returnValue(Q())
}));
var fail = jasmine.createSpy('fail');
@@ -395,3 +396,65 @@
});
});
});
+
+describe('buildFlags', function () {
+
+ describe('parseAndValidateArgs method', function () {
+ var parseAndValidateArgs;
+ var readFileSync;
+
+ beforeEach(function () {
+ parseAndValidateArgs = build.__get__('parseAndValidateArgs');
+ readFileSync = spyOn(fs, 'readFileSync');
+ });
+
+ it('should handle build flags from both CLI and buildConfig.json', function () {
+ readFileSync.and.returnValue(JSON.stringify({
+ windows: { debug: { buildFlag: 'baz="quux"' } }
+ }));
+
+ var buildOptions = {
+ argv: ['--buildFlag', 'foo=bar', '--buildFlag', 'bar=baz', '--buildConfig', 'buildConfig.json']
+ };
+
+ expect(parseAndValidateArgs(buildOptions).buildFlags).toEqual([ 'baz="quux"', 'foo=bar', 'bar=baz' ]);
+ });
+ });
+
+ describe('build', function () {
+ beforeEach(function () {
+ spyOn(utils, 'isCordovaProject').and.returnValue(true);
+ spyOn(prepare, 'applyPlatformConfig');
+ spyOn(prepare, 'updateBuildConfig');
+ spyOn(package, 'getPackage').and.returnValue(Q({}));
+
+ spyOn(AppxManifest, 'get').and.returnValue({
+ getIdentity: function () {
+ return { setPublisher: function () {} };
+ },
+ write: function () {}
+ });
+ });
+
+ it('should pass buildFlags directly to MSBuild', function(done) {
+ var fail = jasmine.createSpy('fail');
+ var buildTools = {version: '14.0', buildProject: jasmine.createSpy('buildProject').and.returnValue(Q()), path: testPath };
+ var buildOptions = {
+ argv: ['--buildFlag', 'foo=bar']
+ };
+
+ createFindAllAvailableVersionsMock([buildTools]);
+
+ build.run(buildOptions)
+ .fail(fail)
+ .finally(function() {
+ expect(fail).not.toHaveBeenCalled();
+ // CB-12416 AppxBundle=Never is present because we are not building a bundle
+ expect(buildTools.buildProject).toHaveBeenCalledWith(jasmine.any(String),
+ jasmine.any(String), jasmine.any(String), [ 'foo=bar', '/p:AppxBundle=Never' ]);
+
+ done();
+ });
+ });
+ });
+});
diff --git a/spec/unit/check_reqs.spec.js b/spec/unit/check_reqs.spec.js
index deebb67..62c8e61 100644
--- a/spec/unit/check_reqs.spec.js
+++ b/spec/unit/check_reqs.spec.js
@@ -35,12 +35,12 @@
Requirement = check_reqs.__get__('Requirement');
});
- it('that should be constructable', function () {
+ it('Test #000 : that should be constructable', function () {
var requirement = new Requirement('someId', 'Some Name');
expect(requirement instanceof Requirement).toBeTruthy();
});
- it('that should have fields defined', function () {
+ it('Test #001 : that should have fields defined', function () {
var requirement = new Requirement('someId', 'Some Name');
expect(requirement.id).toBe('someId');
expect(requirement.name).toBe('Some Name');
@@ -75,11 +75,11 @@
checkSpy = jasmine.createSpy('checkSpy');
fakeCheckFns = [
- checkSpy.andReturn(Q('1.0')),
- checkSpy.andReturn(Q('2.0')),
- checkSpy.andReturn(Q('3.0'))
+ checkSpy.and.returnValue(Q('1.0')),
+ checkSpy.and.returnValue(Q('2.0')),
+ checkSpy.and.returnValue(Q('3.0'))
];
- spyOn(xml, 'parseElementtreeSync').andReturn(new et.ElementTree(et.XML(TEST_XML)));
+ spyOn(xml, 'parseElementtreeSync').and.returnValue(new et.ElementTree(et.XML(TEST_XML)));
fakeConfig = new ConfigParser('/some/file');
});
@@ -89,7 +89,7 @@
check_reqs.__set__('config', originalconfig);
});
- it('that should return a promise, fulfilled with an array of Requirements', function (done) {
+ it('Test #002 : that should return a promise, fulfilled with an array of Requirements', function (done) {
check_reqs.__set__('requirements', fakeRequirements);
check_reqs.__set__('checkFns', fakeCheckFns);
check_reqs.__set__('config', fakeConfig);
@@ -106,7 +106,7 @@
});
});
- it('that should not reject if one of requirements is not installed', function (done) {
+ it('Test #003 : that should not reject if one of requirements is not installed', function (done) {
check_reqs.__set__('requirements', fakeRequirements);
fakeCheckFns[0] = function () { return Q.reject('Error message'); };
check_reqs.__set__('checkFns', fakeCheckFns);
@@ -124,9 +124,9 @@
});
});
- it('that should reject if one of checks has internal erorrs', function (done) {
+ it('Test #004 : that should reject if one of checks has internal erorrs', function (done) {
check_reqs.__set__('requirements', fakeRequirements);
- fakeCheckFns[0] = checkSpy.andThrow('Fatal error');
+ fakeCheckFns[0] = checkSpy.and.throwError('Fatal error');
check_reqs.__set__('checkFns', fakeCheckFns);
check_reqs.__set__('config', fakeConfig);
@@ -136,15 +136,15 @@
done();
})
.catch(function (error) {
- expect(error).toBe('Fatal error');
+ expect(error).toMatch('Fatal error');
done();
});
});
- it('that should not run other requirements checks if `fatal` requirement isn\'t installed', function (done) {
+ it('Test #005 : that should not run other requirements checks if `fatal` requirement isn\'t installed', function (done) {
check_reqs.__set__('requirements', fakeRequirements);
// The second requirement is fatal, so we're setting up second check to fail
- fakeCheckFns[1] = checkSpy.andReturn(Q.reject('Error message'));
+ fakeCheckFns[1] = checkSpy.and.returnValue(Q.reject('Error message'));
check_reqs.__set__('checkFns', fakeCheckFns);
check_reqs.__set__('config', fakeConfig);
@@ -152,7 +152,7 @@
.then(function (requirements) {
expect(requirements.length).toBe(2);
expect(requirements[1].isFatal).toBeTruthy();
- expect(checkSpy.calls.length).toBe(2);
+ expect(checkSpy.calls.count()).toBe(2);
done();
})
.catch(function (error) {
diff --git a/spec/unit/clean.spec.js b/spec/unit/clean.spec.js
index c969141..5d9148a 100644
--- a/spec/unit/clean.spec.js
+++ b/spec/unit/clean.spec.js
@@ -12,10 +12,19 @@
iconPath = path.join(currentProject, 'images/SplashScreen.scale-100.png');
var fsExistsSyncOrig = fs.existsSync;
- spyOn(fs, 'existsSync').andCallFake(function (filePath) {
+ spyOn(fs, 'existsSync').and.callFake(function (filePath) {
if (/config\.xml$/.test(filePath)) return true;
return fsExistsSyncOrig(filePath);
});
+ var fsStatSyncOrig = fs.statSync;
+ spyOn(fs, 'statSync').and.callFake(function (filePath) {
+ if (/SplashScreen\.scale-100\.png$/.test(filePath)) {
+ // Use absolute path:
+ return fsStatSyncOrig(iconPath);
+ }
+
+ return fsStatSyncOrig(filePath);
+ });
});
afterEach(function() {
@@ -33,7 +42,10 @@
}
};
- var rejected = jasmine.createSpy();
+ var rejected = jasmine.createSpy().and.callFake(function(err) {
+ // Log error:
+ expect(err).not.toBeDefined();
+ });
prepareModule.clean.call(config)
.then(function() {
expect(fs.existsSync(iconPath)).toBeFalsy();
diff --git a/spec/unit/deployment.spec.js b/spec/unit/deployment.spec.js
index 97365fb..8f3e3cd 100644
--- a/spec/unit/deployment.spec.js
+++ b/spec/unit/deployment.spec.js
@@ -29,14 +29,28 @@
describe('The correct version of the app deployment tool is obtained.', function() {
- it('Provides an AppDeployCmdTool when 8.1 is requested.', function() {
+ var mockedProgramFiles = process.env['ProgramFiles(x86)'];
+
+ beforeEach(function() {
+ process.env['ProgramFiles(x86)'] = path.join('c:/Program Files (x86)');
+ });
+
+ afterEach(function() {
+ if (mockedProgramFiles) {
+ process.env['ProgramFiles(x86)'] = mockedProgramFiles;
+ } else {
+ delete process.env['ProgramFiles(x86)'];
+ }
+ });
+
+ it('Test #000 : Provides an AppDeployCmdTool when 8.1 is requested.', function() {
var tool = deployment.getDeploymentTool('8.1');
expect(tool instanceof AppDeployCmdTool).toBe(true);
});
- it('Provides a WinAppDeployCmdTool when 10.0 is requested.', function() {
+ it('Test #001 : Provides a WinAppDeployCmdTool when 10.0 is requested.', function() {
var tool = deployment.getDeploymentTool('10.0');
expect(tool instanceof WinAppDeployCmdTool).toBe(true);
@@ -84,66 +98,55 @@
}
});
- it('enumerateDevices returns a valid set of objects', function() {
+ it('Test #002 : enumerateDevices returns a valid set of objects', function(done) {
var deploymentTool = deployment.getDeploymentTool('10.0');
- var done = false;
- deploymentTool.enumerateDevices().then(function(deviceList) {
-
+ deploymentTool.enumerateDevices()
+ .then(function(deviceList) {
expect(deviceList.length).toBe(3);
expect(deviceList[0].name).toBe('Lumia 1520 (RM-940)');
expect(deviceList[0].index).toBe(0);
expect(deviceList[0].type).toBe('device');
-
- done = true;
-
+ done();
+ }).fail(function err (errMsg) {
+ expect(errMsg).toBeUndefined();
+ done();
});
-
- waitsFor(function() { return done; });
});
- it('installAppPackage passes the correct set of parameters', function() {
+ it('Test #003 : installAppPackage passes the correct set of parameters', function(done) {
var deploymentTool = deployment.getDeploymentTool('10.0');
- var done = false;
- deploymentTool.enumerateDevices().then(function(deviceList) {
- deploymentTool.installAppPackage(TEST_APP_PACKAGE_NAME, deviceList[0], /*shouldLaunch*/ false, /*shouldUpdate*/ false).then(function() {
-
- // expect() calls are in the fakeSpawn function
- done = true;
-
- });
+ deploymentTool.enumerateDevices()
+ .then(function(deviceList) {
+ deploymentTool.installAppPackage(TEST_APP_PACKAGE_NAME, deviceList[0], /*shouldLaunch*/ false, /*shouldUpdate*/ false);
+ done();
+ }).fail(function err (errMsg) {
+ expect(errMsg).toBeUndefined();
+ done();
});
-
- waitsFor(function() { return done; });
});
- it('installAppPackage passes the correct set of parameters when updating', function() {
+ it('Test #004 : installAppPackage passes the correct set of parameters when updating', function(done) {
var deploymentTool = deployment.getDeploymentTool('10.0');
- var done = false;
- deploymentTool.enumerateDevices().then(function(deviceList) {
- deploymentTool.installAppPackage(TEST_APP_PACKAGE_NAME, deviceList[0], /*shouldLaunch*/ false, /*shouldUpdate*/ true).then(function() {
-
- // expect() calls are in the fakeSpawn function
- done = true;
-
- });
+ deploymentTool.enumerateDevices()
+ .then(function(deviceList) {
+ deploymentTool.installAppPackage(TEST_APP_PACKAGE_NAME, deviceList[0], /*shouldLaunch*/ false, /*shouldUpdate*/ true);
+ done();
+ }).fail(function err (errMsg) {
+ expect(errMsg).toBeUndefined();
+ done();
});
-
- waitsFor(function() { return done; });
});
- it('uninstallAppPackage passes the correct set of parameters', function() {
+ it('Test #005 : uninstallAppPackage passes the correct set of parameters', function(done) {
var deploymentTool = deployment.getDeploymentTool('10.0');
- var done = false;
- deploymentTool.enumerateDevices().then(function(deviceList) {
- deploymentTool.uninstallAppPackage(TEST_APP_PACKAGE_ID, deviceList[2]).then(function() {
-
- // expect() calls are in the fakeSpawn function
- done = true;
-
- });
+ deploymentTool.enumerateDevices()
+ .then(function(deviceList) {
+ deploymentTool.uninstallAppPackage(TEST_APP_PACKAGE_ID, deviceList[2]);
+ done();
+ }).fail(function err (errMsg) {
+ expect(errMsg).toBeUndefined();
+ done();
});
-
- waitsFor(function() { return done; });
});
});
@@ -192,93 +195,81 @@
}
});
- it('enumerateDevices returns a valid set of objects', function() {
+ it('Test #006 : enumerateDevices returns a valid set of objects', function(done) {
var deploymentTool = deployment.getDeploymentTool('8.1');
- var done = false;
- deploymentTool.enumerateDevices().then(function(deviceList) {
-
+ deploymentTool.enumerateDevices()
+ .then(function(deviceList) {
expect(deviceList.length).toBe(12);
expect(deviceList[0].name).toBe('Device');
expect(deviceList[0].index).toBe(0);
expect(deviceList[0].type).toBe('device');
-
expect(deviceList[5].name).toBe('Mobile Emulator 10.0.10150.0 1080p 6 inch 2GB');
expect(deviceList[5].index).toBe(5);
expect(deviceList[5].type).toBe('emulator');
-
- done = true;
-
+ done();
+ }).fail(function err (errMsg) {
+ expect(errMsg).toBeUndefined();
+ done();
});
- waitsFor(function() { return done; });
});
- it('installAppPackage passes the correct set of parameters', function() {
+ it('Test #007 : installAppPackage passes the correct set of parameters', function(done) {
var deploymentTool = deployment.getDeploymentTool('8.1');
- var done = false;
- deploymentTool.enumerateDevices().then(function(deviceList) {
- deploymentTool.installAppPackage(TEST_APP_PACKAGE_NAME, deviceList[0], /*shouldLaunch*/ false, /*shouldUpdate*/ false).then(function() {
-
- // expect() calls are in the fakeSpawn function
- done = true;
-
- });
+ deploymentTool.enumerateDevices()
+ .then(function(deviceList) {
+ deploymentTool.installAppPackage(TEST_APP_PACKAGE_NAME, deviceList[0], /*shouldLaunch*/ false, /*shouldUpdate*/ false);
+ done();
+ }).fail(function err (errMsg) {
+ expect(errMsg).toBeUndefined();
+ done();
});
- waitsFor(function() { return done; });
});
- it('installAppPackage passes the correct set of parameters when updating', function() {
+ it('Test #008 : installAppPackage passes the correct set of parameters when updating', function(done) {
var deploymentTool = deployment.getDeploymentTool('8.1');
- var done = false;
- deploymentTool.enumerateDevices().then(function(deviceList) {
- deploymentTool.installAppPackage(TEST_APP_PACKAGE_NAME, deviceList[0], /*shouldLaunch*/ false, /*shouldUpdate*/ true).then(function() {
-
- // expect() calls are in the fakeSpawn function
- done = true;
-
- });
+ deploymentTool.enumerateDevices()
+ .then(function(deviceList) {
+ deploymentTool.installAppPackage(TEST_APP_PACKAGE_NAME, deviceList[0], /*shouldLaunch*/ false, /*shouldUpdate*/ true);
+ done();
+ }).fail(function err (errMsg) {
+ expect(errMsg).toBeUndefined();
+ done();
});
- waitsFor(function() { return done; });
});
- it('installAppPackage passes the correct set of parameters when launching', function() {
+ it('Test #009 : installAppPackage passes the correct set of parameters when launching', function(done) {
var deploymentTool = deployment.getDeploymentTool('8.1');
- var done = false;
- deploymentTool.enumerateDevices().then(function(deviceList) {
- deploymentTool.installAppPackage(TEST_APP_PACKAGE_NAME, deviceList[0], /*shouldLaunch*/ true, /*shouldUpdate*/ false).then(function() {
-
- // expect() calls are in the fakeSpawn function
- done = true;
-
- });
+ deploymentTool.enumerateDevices()
+ .then(function(deviceList) {
+ deploymentTool.installAppPackage(TEST_APP_PACKAGE_NAME, deviceList[0], /*shouldLaunch*/ true, /*shouldUpdate*/ false);
+ done();
+ }).fail(function err (errMsg) {
+ expect(errMsg).toBeUndefined();
+ done();
});
- waitsFor(function() { return done; });
});
- it('installAppPackage passes the correct set of parameters when updating and launching', function() {
+ it('Test #010 : installAppPackage passes the correct set of parameters when updating and launching', function(done) {
var deploymentTool = deployment.getDeploymentTool('8.1');
- var done = false;
- deploymentTool.enumerateDevices().then(function(deviceList) {
- deploymentTool.installAppPackage(TEST_APP_PACKAGE_NAME, deviceList[0], /*shouldLaunch*/ true, /*shouldUpdate*/ true).then(function() {
-
- // expect() calls are in the fakeSpawn function
- done = true;
-
- });
+ deploymentTool.enumerateDevices()
+ .then(function(deviceList) {
+ deploymentTool.installAppPackage(TEST_APP_PACKAGE_NAME, deviceList[0], /*shouldLaunch*/ true, /*shouldUpdate*/ true);
+ done();
+ }).fail(function err (errMsg) {
+ expect(errMsg).toBeUndefined();
+ done();
});
- waitsFor(function() { return done; });
});
- it('uninstallAppPackage passes the correct set of parameters', function() {
+ it('Test #011 : uninstallAppPackage passes the correct set of parameters', function(done) {
var deploymentTool = deployment.getDeploymentTool('8.1');
- var done = false;
- deploymentTool.enumerateDevices().then(function(deviceList) {
- deploymentTool.uninstallAppPackage(TEST_APP_PACKAGE_ID, deviceList[5]).then(function() {
-
- // expect() calls are in the fakeSpawn function
- done = true;
-
- });
+ deploymentTool.enumerateDevices()
+ .then(function(deviceList) {
+ deploymentTool.uninstallAppPackage(TEST_APP_PACKAGE_ID, deviceList[5]);
+ done();
+ }).fail(function err (errMsg) {
+ expect(errMsg).toBeUndefined();
+ done();
});
- waitsFor(function() { return done; });
});
});
diff --git a/spec/unit/fixtures/org.test.configtest/plugin.xml b/spec/unit/fixtures/org.test.configtest/plugin.xml
new file mode 100644
index 0000000..d140297
--- /dev/null
+++ b/spec/unit/fixtures/org.test.configtest/plugin.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 2013 Anis Kadri
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+<plugin xmlns="http://cordova.apache.org/ns/plugins/1.0"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ id="org.test.configtest"
+ version="3.0.0">
+
+ <name>Does Code Fil Write Even Work? Hopefully the Tests Will Tell Us</name>
+
+ <!-- android -->
+ <platform name="android">
+ <config-file target="res/xml/config.xml" parent="/widget">
+ <poop/>
+ </config-file>
+ <config-file target="res/xml/config.xml" parent="/widget">
+ <poop/>
+ </config-file>
+ </platform>
+
+ <platform name="windows">
+ <config-file target="package.appxmanifest" parent="/Parent/Capabilities">
+ <Capability Note="should-exist-for-all-appxmanifest-target-files" />
+ </config-file>
+ <config-file target="package.appxmanifest" parent="/Parent/Capabilities" versions="=8.1.0">
+ <Capability Note="should-exist-for-win81-win-and-phone" />
+ </config-file>
+ <config-file target="package.appxmanifest" parent="/Parent/Capabilities" versions="=8.1.0" device-target="windows">
+ <Capability Note="should-exist-for-win81-win-only" />
+ </config-file>
+ <config-file target="package.appxmanifest" parent="/Parent/Capabilities" versions="=8.1.0" device-target="phone">
+ <Capability Note="should-exist-for-win81-phone-only" />
+ </config-file>
+ <config-file target="package.appxmanifest" parent="/Parent/Capabilities" versions="=8.1.0" device-target="all">
+ <Capability Note="should-exist-for-win81-win-and-phone" />
+ </config-file>
+ <config-file target="package.appxmanifest" parent="/Parent/Capabilities" versions="<=10.0.0" device-target="all">
+ <Capability Note="should-exist-for-win10-and-win81-win-and-phone" />
+ </config-file>
+ <config-file target="package.appxmanifest" parent="/Parent/Capabilities" versions=">=10.0.0">
+ <Capability Note="should-exist-in-win10-only" />
+ </config-file>
+ </platform>
+</plugin>
diff --git a/spec/unit/fixtures/org.test.plugins.capabilityplugin/plugin.xml b/spec/unit/fixtures/org.test.plugins.capabilityplugin/plugin.xml
new file mode 100644
index 0000000..687dedf
--- /dev/null
+++ b/spec/unit/fixtures/org.test.plugins.capabilityplugin/plugin.xml
@@ -0,0 +1,13 @@
+<?xml version='1.0' encoding='utf-8'?>
+<plugin id="org.test.plugins.capabilityplugin" version="0.0.1" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
+ <name>org.test.plugins.capabilityplugin</name>
+ <js-module name="org.test.plugins.capabilityplugin" src="www/org.test.plugins.capabilityplugin.js">
+ <clobbers target="cordova.plugins.org.test.plugins.capabilityplugin" />
+ </js-module>
+ <config-file target="package.appxmanifest" parent="/Package/Capabilities" device-target="windows">
+ <Capability Name="enterpriseAuthentication" />
+ <Capability Name="privateNetworkClientServer" />
+ <Capability Name="sharedUserCertificates" />
+ <DeviceCapability Name="webcam"/>
+ </config-file>
+</plugin>
diff --git a/spec/unit/fixtures/org.test.plugins.capabilityplugin/www/org.test.plugins.capabilityplugin.js b/spec/unit/fixtures/org.test.plugins.capabilityplugin/www/org.test.plugins.capabilityplugin.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/spec/unit/fixtures/org.test.plugins.capabilityplugin/www/org.test.plugins.capabilityplugin.js
diff --git a/spec/unit/fixtures/org.test.plugins.extensionsplugin/plugin.xml b/spec/unit/fixtures/org.test.plugins.extensionsplugin/plugin.xml
new file mode 100644
index 0000000..cf39b89
--- /dev/null
+++ b/spec/unit/fixtures/org.test.plugins.extensionsplugin/plugin.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 2013 Anis Kadri
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+<plugin xmlns="http://cordova.apache.org/ns/plugins/1.0"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ id="org.test.plugins.extensionsplugin"
+ version="1.0.0">
+
+ <!-- new requirement: NO SPACES -->
+ <name>extensionsplugin</name>
+ <!-- These are going to be required by plugman-registry -->
+ <description>my description</description>
+ <author>Jackson Badman</author>
+ <keywords>extensions,plugin</keywords>
+ <license>BSD</license>
+ <!-- end plugman-registry requirements -->
+
+ <!-- windows -->
+ <platform name="windows">
+ <config-file target="package.windows.appxmanifest" parent="/Package">
+ <Extensions>
+ <Extension Category="windows.activatableClass.inProcessServer">
+ <InProcessServer>
+ <Path>Foo.dll</Path>
+ <ActivatableClass ActivatableClassId="Foo.Class" ThreadingModel="both" />
+ </InProcessServer>
+ </Extension>
+ </Extensions>
+ </config-file>
+
+ <resource-file src="src/windows/Foo.dll" target="Foo.dll" />
+ </platform>
+
+</plugin>
diff --git a/spec/unit/fixtures/org.test.plugins.extensionsplugin/src/windows/Foo.dll b/spec/unit/fixtures/org.test.plugins.extensionsplugin/src/windows/Foo.dll
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/spec/unit/fixtures/org.test.plugins.extensionsplugin/src/windows/Foo.dll
diff --git a/spec/unit/fixtures/org.test.plugins.resourcereferenceplugin/plugin.xml b/spec/unit/fixtures/org.test.plugins.resourcereferenceplugin/plugin.xml
new file mode 100644
index 0000000..855b220
--- /dev/null
+++ b/spec/unit/fixtures/org.test.plugins.resourcereferenceplugin/plugin.xml
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='utf-8'?>
+<plugin id="org.test.plugins.resourcereferenceplugin" version="0.0.1" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
+ <name>org.test.plugins.resourcereferenceplugin</name>
+ <platform name="windows">
+ <resource-file src="src/windows/dummy1.json" target="dummy.json" arch="x86" reference="true" />
+ <resource-file src="src/windows/dummy2.json" target="dummy.json" versions=">=8.1" reference="true" />
+ <resource-file src="src/windows/dummy3.json" target="dummy.json" device-target="phone" reference="true"/>
+ <resource-file src="src/windows/dummy4.json" target="dummy.json" device-target="windows" versions="8.0" arch="x64" reference="true" />
+ </platform>
+</plugin>
diff --git a/spec/unit/fixtures/org.test.plugins.resourcereferenceplugin/src/windows/dummy1.json b/spec/unit/fixtures/org.test.plugins.resourcereferenceplugin/src/windows/dummy1.json
new file mode 100644
index 0000000..70bc71c
--- /dev/null
+++ b/spec/unit/fixtures/org.test.plugins.resourcereferenceplugin/src/windows/dummy1.json
@@ -0,0 +1,3 @@
+{
+ "name": "dummy1"
+}
diff --git a/spec/unit/fixtures/org.test.plugins.resourcereferenceplugin/src/windows/dummy2.json b/spec/unit/fixtures/org.test.plugins.resourcereferenceplugin/src/windows/dummy2.json
new file mode 100644
index 0000000..7a96e3b
--- /dev/null
+++ b/spec/unit/fixtures/org.test.plugins.resourcereferenceplugin/src/windows/dummy2.json
@@ -0,0 +1,3 @@
+{
+ "name": "dummy2"
+}
diff --git a/spec/unit/fixtures/org.test.plugins.resourcereferenceplugin/src/windows/dummy3.json b/spec/unit/fixtures/org.test.plugins.resourcereferenceplugin/src/windows/dummy3.json
new file mode 100644
index 0000000..18798c0
--- /dev/null
+++ b/spec/unit/fixtures/org.test.plugins.resourcereferenceplugin/src/windows/dummy3.json
@@ -0,0 +1,3 @@
+{
+ "name": "dummy3"
+}
diff --git a/spec/unit/fixtures/org.test.plugins.resourcereferenceplugin/src/windows/dummy4.json b/spec/unit/fixtures/org.test.plugins.resourcereferenceplugin/src/windows/dummy4.json
new file mode 100644
index 0000000..9935709
--- /dev/null
+++ b/spec/unit/fixtures/org.test.plugins.resourcereferenceplugin/src/windows/dummy4.json
@@ -0,0 +1,3 @@
+{
+ "name": "dummy4"
+}
diff --git a/spec/unit/fixtures/testProj/platforms/windows/package.windows10.appxmanifest b/spec/unit/fixtures/testProj/platforms/windows/package.windows10.appxmanifest
new file mode 100644
index 0000000..59e435a
--- /dev/null
+++ b/spec/unit/fixtures/testProj/platforms/windows/package.windows10.appxmanifest
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<Package
+ xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
+ xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
+ xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
+ IgnorableNamespaces="uap mp">
+
+ <Identity
+ Name="$guid1$"
+ Version="1.0.0.0"
+ Publisher="CN=$username$" />
+
+ <mp:PhoneIdentity PhoneProductId="$guid1$" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
+
+ <Properties>
+ <DisplayName>$projectname$</DisplayName>
+ <PublisherDisplayName>$username$</PublisherDisplayName>
+ <Logo>images\StoreLogo.png</Logo>
+ </Properties>
+
+ <Dependencies>
+ <TargetDeviceFamily Name="Windows.Universal" MinVersion="0.0.0.0" MaxVersionTested="10.0.0.0" />
+ </Dependencies>
+
+ <Resources>
+ <Resource Language="x-generate" />
+ </Resources>
+
+ <Applications>
+ <Application
+ Id="App"
+ StartPage="www/index.html">
+
+ <uap:VisualElements
+ DisplayName="$projectname$"
+ Description="CordovaApp"
+ BackgroundColor="#464646"
+ Square150x150Logo="images\Square150x150Logo.png"
+ Square44x44Logo="images\Square44x44Logo.png">
+
+ <uap:SplashScreen Image="images\splashscreen.png" />
+ <uap:DefaultTile ShortName="$projectname$"
+ Square310x310Logo="images\Square310x310Logo.png"
+ Square71x71Logo="images\Square71x71Logo.png"
+ Wide310x150Logo="images\Wide310x150Logo.png" />
+
+ </uap:VisualElements>
+ </Application>
+ </Applications>
+
+ <Capabilities>
+ <Capability Name="internetClient" />
+ </Capabilities>
+
+</Package>
diff --git a/spec/unit/fixtures/testProj/plugins/testPlugin/plugin.xml b/spec/unit/fixtures/testProj/plugins/testPlugin/plugin.xml
new file mode 100644
index 0000000..c1e813d
--- /dev/null
+++ b/spec/unit/fixtures/testProj/plugins/testPlugin/plugin.xml
@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='utf-8'?>
+<plugin id="testPlugin" version="0.0.1" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
+ <name>testPlugin</name>
+ <js-module name="testPlugin" src="www/testPlugin.js">
+ <clobbers target="cordova.plugins.testPlugin" />
+ </js-module>
+ <platform name="windows">
+ <framework src="src/deps/x86/x86.winmd" target-dir="x86" arch="x86" custom="true" versions="10.*" implementation="src/deps/x86/x86.dll"/>
+ <framework src="src/deps/x64/x64.winmd" target-dir="x64" arch="x64" custom="true" versions="10.*" implementation="src/deps/x64/x64.UWP.dll" />
+ <framework src="src/deps/ARM/arm.winmd" target-dir="ARM" arch="ARM" custom="true" versions="10.*" implementation="src/deps/ARM/arm.dll"/>
+ </platform>
+</plugin>
diff --git a/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/ARM/arm.dll b/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/ARM/arm.dll
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/ARM/arm.dll
diff --git a/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/ARM/arm.winmd b/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/ARM/arm.winmd
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/ARM/arm.winmd
diff --git a/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/x64/x64.UWP.dll b/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/x64/x64.UWP.dll
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/x64/x64.UWP.dll
diff --git a/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/x64/x64.winmd b/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/x64/x64.winmd
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/x64/x64.winmd
diff --git a/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/x86/x86.dll b/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/x86/x86.dll
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/x86/x86.dll
diff --git a/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/x86/x86.winmd b/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/x86/x86.winmd
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/spec/unit/fixtures/testProj/plugins/testPlugin/src/deps/x86/x86.winmd
diff --git a/spec/unit/pluginHandler/common.spec.js b/spec/unit/pluginHandler/common.spec.js
index d026b97..776fb58 100644
--- a/spec/unit/pluginHandler/common.spec.js
+++ b/spec/unit/pluginHandler/common.spec.js
@@ -40,12 +40,12 @@
describe('common platform handler', function() {
describe('copyFile', function() {
- it('should throw if source path not found', function(){
+ it('Test #000 : should throw if source path not found', function(){
expect(function(){copyFile('/some/dir', 'foo', project_dir, dest);})
.toThrow(new Error('"' + path.resolve('/some/dir', 'foo') + '" not found!'));
});
- it('should throw if src not in plugin directory', function(){
+ it('Test #001 : should throw if src not in plugin directory', function(){
shell.mkdir('-p', project_dir);
fs.writeFileSync(non_plugin_file, 'contents', 'utf-8');
var outside_file = '../non_plugin_file';
@@ -54,7 +54,7 @@
shell.rm('-rf', test_dir);
});
- it('should allow symlink src, if inside plugin', function(){
+ it('Test #002 : should allow symlink src, if inside plugin', function(){
shell.mkdir('-p', java_dir);
fs.writeFileSync(java_file, 'contents', 'utf-8');
@@ -67,7 +67,7 @@
shell.rm('-rf', project_dir);
});
- it('should throw if symlink is linked to a file outside the plugin', function(){
+ it('Test #003 : should throw if symlink is linked to a file outside the plugin', function(){
shell.mkdir('-p', java_dir);
fs.writeFileSync(non_plugin_file, 'contents', 'utf-8');
@@ -81,7 +81,7 @@
shell.rm('-rf', project_dir);
});
- it('should throw if dest is outside the project directory', function(){
+ it('Test #004 : should throw if dest is outside the project directory', function(){
shell.mkdir('-p', java_dir);
fs.writeFileSync(java_file, 'contents', 'utf-8');
expect(function(){copyFile(test_dir, java_file, project_dir, non_plugin_file);})
@@ -89,11 +89,11 @@
shell.rm('-rf', project_dir);
});
- it('should call mkdir -p on target path', function(){
+ it('Test #005 : should call mkdir -p on target path', function(){
shell.mkdir('-p', java_dir);
fs.writeFileSync(java_file, 'contents', 'utf-8');
- var s = spyOn(shell, 'mkdir').andCallThrough();
+ var s = spyOn(shell, 'mkdir').and.callThrough();
copyFile(test_dir, java_file, project_dir, dest);
expect(s).toHaveBeenCalled();
@@ -101,11 +101,11 @@
shell.rm('-rf', project_dir);
});
- it('should call cp source/dest paths', function(){
+ it('Test #006 : should call cp source/dest paths', function(){
shell.mkdir('-p', java_dir);
fs.writeFileSync(java_file, 'contents', 'utf-8');
- var s = spyOn(shell, 'cp').andCallThrough();
+ var s = spyOn(shell, 'cp').and.callThrough();
copyFile(test_dir, java_file, project_dir, dest);
expect(s).toHaveBeenCalled();
@@ -116,7 +116,7 @@
});
describe('copyNewFile', function () {
- it('should throw if target path exists', function(){
+ it('Test #007 : should throw if target path exists', function(){
shell.mkdir('-p', dest);
expect(function(){copyNewFile(test_dir, src, project_dir, dest);})
.toThrow(new Error('"' + dest + '" already exists!'));
@@ -125,11 +125,11 @@
});
describe('deleteJava', function() {
- it('should call fs.unlinkSync on the provided paths', function(){
+ it('Test #008 : should call fs.unlinkSync on the provided paths', function(){
shell.mkdir('-p', java_dir);
fs.writeFileSync(java_file, 'contents', 'utf-8');
- var s = spyOn(fs, 'unlinkSync').andCallThrough();
+ var s = spyOn(fs, 'unlinkSync').and.callThrough();
removeFileAndParents(project_dir, java_file);
expect(s).toHaveBeenCalled();
expect(s).toHaveBeenCalledWith(path.resolve(project_dir, java_file));
@@ -137,7 +137,7 @@
shell.rm('-rf', java_dir);
});
- it('should delete empty directories after removing source code in a java src path hierarchy', function(){
+ it('Test #009 : should delete empty directories after removing source code in a java src path hierarchy', function(){
shell.mkdir('-p', java_dir);
fs.writeFileSync(java_file, 'contents', 'utf-8');
diff --git a/spec/unit/pluginHandler/windows.spec.js b/spec/unit/pluginHandler/windows.spec.js
index 161f6f5..11aa573 100644
--- a/spec/unit/pluginHandler/windows.spec.js
+++ b/spec/unit/pluginHandler/windows.spec.js
@@ -27,17 +27,22 @@
var PluginHandler = rewire('../../../template/cordova/lib/PluginHandler');
var JsprojManager = require('../../../template/cordova/lib/JsprojManager');
var cordovaProjectDir = path.join(os.tmpdir(), 'plugman');
+var testProjectWindowsPlatformDir = path.join(__dirname, '../fixtures/testProj', 'platforms', 'windows');
var cordovaProjectWindowsPlatformDir = path.join(cordovaProjectDir, 'platforms', 'windows');
var cordovaProjectPluginsDir = path.join(cordovaProjectDir, 'plugins');
var PluginInfo = require('cordova-common').PluginInfo;
+var pluginInfo = require('../../../template/cordova/lib/PluginInfo').PluginInfo;
var dummyplugin = path.join(__dirname, '../fixtures/testProj/plugins/org.test.plugins.dummyplugin');
+var testPlugin = path.join(__dirname, '../fixtures/testProj/plugins/testPlugin');
var dummyPluginInfo = new PluginInfo(dummyplugin);
+var testPluginInfo = new pluginInfo(testPlugin);
var valid_source = dummyPluginInfo.getSourceFiles('windows');
var valid_resourceFiles = dummyPluginInfo.getResourceFiles('windows');
var valid_libfiles = dummyPluginInfo.getLibFiles('windows');
var valid_frameworks = dummyPluginInfo.getFrameworks('windows');
+var test_frameworks = testPluginInfo.getFrameworks('windows');
var faultyplugin = path.join(__dirname, '../fixtures/org.test.plugins.faultyplugin');
var faultyPluginInfo = new PluginInfo(faultyplugin);
@@ -45,6 +50,11 @@
var invalid_resourceFiles = faultyPluginInfo.getResourceFiles('windows');
var invalid_libfiles = faultyPluginInfo.getLibFiles('windows');
+var resourcereferenceplugin = path.join(__dirname, '../fixtures/org.test.plugins.resourcereferenceplugin');
+var resourcePluginInfo = new PluginInfo(resourcereferenceplugin);
+var valid_resourcereferenceFiles = resourcePluginInfo.getResourceFiles('windows');
+
+
function copyArray(arr) {
return Array.prototype.slice.call(arr, 0);
}
@@ -56,19 +66,27 @@
}
beforeEach(function () {
- this.addMatchers({
- toContainXmlPath: function (xpath) {
- var xml = this.actual;
- var notText = this.isNot ? 'not ' : '';
- this.message = function () {
- return 'Expected xml \'' + et.tostring(xml) + '\' ' + notText + 'to contain elements matching \'' + xpath + '\'.';
+ jasmine.addMatchers({
+ toContainXmlPath: function () {
+ return {
+ compare: function(actual, expected) {
+ var xml = actual;
+ var notText = this.isNot ? 'not ' : '';
+ var result = {};
+ result.pass = xml.find(expected) !== null;
+ if(result.pass) {
+ result.message = 'Expected xml \'' + et.tostring(xml) + '\' ' + notText + 'to contain elements matching \'' + actual + '\'.';
+ } else {
+ result.message = 'Expected xml \'' + et.tostring(xml) + '\' ' + notText + 'to not contain elements matching \'' + actual + '\'.';
+ }
+ return result;
+ }
};
-
- return xml.find(xpath) !== null;
}
});
});
+
var getPluginFilePath = PluginHandler.__get__('getPluginFilePath');
var computeResourcePath = function(resourceFile) {
return getPluginFilePath(dummyPluginInfo, resourceFile.src, cordovaProjectWindowsPlatformDir);
@@ -90,7 +108,7 @@
dummyProject = JsprojManager.getProject(cordovaProjectWindowsPlatformDir);
shell.mkdir('-p', cordovaProjectPluginsDir);
shell.cp('-rf', dummyplugin, cordovaProjectPluginsDir);
- // CB-11558 Reinitialize plugin.dir to become project_root/plugins/plugin.id to avoid
+ // CB-11558 Reinitialize plugin.dir to become project_root/plugins/plugin.id to avoid
// different drives issue resulting in absolute path in projectReferences.
dummyPluginInfo = new PluginInfo(path.join(cordovaProjectPluginsDir, dummyPluginInfo.id));
});
@@ -104,7 +122,7 @@
var copyFileSpy = jasmine.createSpy('copyFile');
beforeEach(function () {
- PluginHandler.__set__('copyFile', copyFileSpy.andCallFake(copyFileOrig));
+ PluginHandler.__set__('copyFile', copyFileSpy.and.callFake(copyFileOrig));
});
afterEach(function() {
@@ -112,7 +130,6 @@
});
function validateInstalledProjects(tag, elementToInstall, xpath, supportedPlatforms) {
- jasmine.getEnv().currentSpec.removeAllSpies();
var projects = copyArray(dummyProject.projects);
projects.push(dummyProject.master);
@@ -163,7 +180,7 @@
projects.forEach(function (project) {
if (projectsAddedTo.indexOf(path.basename(project.location)) > -1) {
- projectsAddedToSpies.push(spyOn(project, 'appendToRoot').andCallFake(appendToRootFake));
+ projectsAddedToSpies.push(spyOn(project, 'appendToRoot').and.callFake(appendToRootFake));
} else {
projectsNotAddedToSpies.push(spyOn(project, 'appendToRoot'));
}
@@ -184,63 +201,95 @@
var install = PluginHandler.getInstaller('source-file');
- it('should copy stuff from one location to another by calling common.copyFile', function () {
+ it('Test #000 : should copy stuff from one location to another by calling common.copyFile', function () {
var source = copyArray(valid_source);
install(source[0], dummyPluginInfo, dummyProject);
expect(copyFileSpy).toHaveBeenCalledWith(dummyPluginInfo.dir, 'src/windows/dummer.js', cordovaProjectWindowsPlatformDir, path.join('plugins', 'org.test.plugins.dummyplugin', 'dummer.js'), false);
});
- it('should throw if source-file src cannot be found', function () {
+ it('Test #001 : should throw if source-file src cannot be found', function () {
var source = copyArray(invalid_source);
- copyFileSpy.andCallFake(copyFileOrig);
+ copyFileSpy.and.callFake(copyFileOrig);
expect(function () {
install(source[1], faultyPluginInfo, dummyProject);
- }).toThrow('"' + path.resolve(faultyplugin, 'src/windows/NotHere.js') + '" not found!');
+ }).toThrow(new Error ('"' + path.resolve(faultyplugin, 'src/windows/NotHere.js') + '" not found!'));
});
- it('should throw if source-file target already exists', function () {
+ it('Test #002 : should throw if source-file target already exists', function () {
var source = copyArray(valid_source);
var target = path.join(cordovaProjectWindowsPlatformDir, 'plugins', dummyPluginInfo.id, 'dummer.js');
shell.mkdir('-p', path.dirname(target));
fs.writeFileSync(target, 'some bs', 'utf-8');
expect(function () {
install(source[0], dummyPluginInfo, dummyProject);
- }).toThrow('"' + target + '" already exists!');
+ }).toThrow(new Error ('"' + target + '" already exists!'));
});
});
describe('of <resource-file> elements', function () {
var resourceFiles = copyArray(valid_resourceFiles);
+ var resourcereferenceFiles = copyArray(valid_resourcereferenceFiles);
var invalidResourceFiles = copyArray(invalid_resourceFiles);
var install = PluginHandler.getInstaller('resource-file');
// This could be separated into individual specs, but that results in a lot of copying and deleting the
// project files, which is not needed.
- it('should write to correct project files when conditions are specified', function () {
- var xpath = 'Content[@Include="' + computeResourcePath(resourceFiles[0]) + '"][@Condition="\'$(Platform)\'==\'x86\'"]';
+ it('Test #003 : should write to correct project files when conditions are specified', function () {
+ var xpath = 'Content[@Include="' + resourceFiles[0].target + '"][@Condition="\'$(Platform)\'==\'x86\'"]';
validateInstalledProjects('resource-file', resourceFiles[0], xpath, ['all']);
+ });
- xpath = 'Content[@Include="' + computeResourcePath(resourceFiles[1]) + '"]';
+
+ // project files, which is not needed.
+ it('Test #004 : should write to correct project files when conditions are specified', function () {
+ var xpath = 'Content[@Include="' + resourceFiles[1].target + '"]';
validateInstalledProjects('resource-file', resourceFiles[1], xpath, ['windows', 'phone', 'windows10']);
+ });
- xpath = 'Content[@Include="' + computeResourcePath(resourceFiles[2]) + '"]';
+ // project files, which is not needed.
+ it('Test #005 : should write to correct project files when conditions are specified', function () {
+ var xpath = 'Content[@Include="' + resourceFiles[2].target + '"]';
validateInstalledProjects('resource-file', resourceFiles[2], xpath, ['phone']);
+ });
- xpath = 'Content[@Include="' + computeResourcePath(resourceFiles[3]) + '"][@Condition="\'$(Platform)\'==\'x64\'"]';
+ it('Test #006 : should write to correct project files when conditions are specified with reference', function () {
+ var xpath = 'Content[@Include="' + computeResourcePath(resourcereferenceFiles[0]) + '"][@Condition="\'$(Platform)\'==\'x86\'"]';
+ validateInstalledProjects('resource-file', resourcereferenceFiles[0], xpath, ['all']);
+
+ });
+
+ it('Test #007 : should write to correct project files when conditions are specified with reference', function () {
+ var xpath = 'Content[@Include="' + computeResourcePath(resourcereferenceFiles[1]) + '"]';
+ validateInstalledProjects('resource-file', resourcereferenceFiles[1], xpath, ['windows', 'phone', 'windows10']);
+ });
+
+ it('Test #008 : should write to correct project files when conditions are specified with reference', function () {
+ var xpath = 'Content[@Include="' + computeResourcePath(resourcereferenceFiles[2]) + '"]';
+ validateInstalledProjects('resource-file', resourcereferenceFiles[2], xpath, ['phone']);
+ });
+
+ it('Test #009 : should write to correct project files when conditions are specified with reference', function () {
+ var xpath = 'Content[@Include="' + computeResourcePath(resourcereferenceFiles[3]) + '"][@Condition="\'$(Platform)\'==\'x64\'"]';
+ validateInstalledProjects('resource-file', resourcereferenceFiles[3], xpath, ['windows8']);
+ });
+
+ // project files, which is not needed.
+ it('Test #010 : should write to correct project files when conditions are specified', function () {
+ var xpath = 'Content[@Include="' + resourceFiles[3].target + '"][@Condition="\'$(Platform)\'==\'x64\'"]';
validateInstalledProjects('resource-file', resourceFiles[3], xpath, ['windows8']);
});
- it('should throw if conditions are invalid', function () {
+ it('Test #011 : should throw if conditions are invalid', function () {
expect(function () {
install(invalidResourceFiles[0], faultyPluginInfo, dummyProject);
- }).toThrow('Invalid arch attribute (must be "x86", "x64" or "ARM"): x85');
+ }).toThrow(new Error ('Invalid arch attribute (must be "x86", "x64" or "ARM"): x85'));
expect(function () {
install(invalidResourceFiles[1], faultyPluginInfo, dummyProject);
- }).toThrow('Invalid versions attribute (must be a valid semantic version range): 8.0a');
+ }).toThrow(new Error ('Invalid versions attribute (must be a valid semantic version range): 8.0a'));
expect(function () {
install(invalidResourceFiles[2], faultyPluginInfo, dummyProject);
- }).toThrow('Invalid device-target attribute (must be "all", "phone", "windows" or "win"): daphne');
+ }).toThrow(new Error('Invalid device-target attribute (must be "all", "phone", "windows" or "win"): daphne'));
});
});
@@ -251,32 +300,35 @@
// This could be separated into individual specs, but that results in a lot of copying and deleting the
// project files, which is not needed.
- it('should write to correct project files when conditions are specified', function () {
+ it('Test #012 : should write to correct project files when conditions are specified', function () {
var xpath = 'SDKReference[@Include="TestSDK1, Version=1.0"][@Condition="\'$(Platform)\'==\'x86\'"]';
validateInstalledProjects('lib-file', libfiles[0], xpath, ['all']);
-
- xpath = 'SDKReference[@Include="TestSDK2, Version=1.0"]';
+ });
+ it('Test #013 : should write to correct project files when conditions are specified', function () {
+ var xpath = 'SDKReference[@Include="TestSDK2, Version=1.0"]';
validateInstalledProjects('lib-file', libfiles[1], xpath, ['windows', 'phone', 'windows10']);
-
- xpath = 'SDKReference[@Include="TestSDK3, Version=1.0"]';
+ });
+ it('Test #014 : should write to correct project files when conditions are specified', function () {
+ var xpath = 'SDKReference[@Include="TestSDK3, Version=1.0"]';
validateInstalledProjects('lib-file', libfiles[2], xpath, ['phone']);
-
- xpath = 'SDKReference[@Include="TestSDK4, Version=1.0"]';
+ });
+ it('Test #015 : should write to correct project files when conditions are specified', function () {
+ var xpath = 'SDKReference[@Include="TestSDK4, Version=1.0"]';
validateInstalledProjects('lib-file', libfiles[3], xpath, ['windows8']);
});
- it('should throw if conditions are invalid', function () {
+ it('Test #016 : should throw if conditions are invalid', function () {
expect(function () {
install(invalidLibFiles[0], faultyPluginInfo, dummyProject);
- }).toThrow('Invalid arch attribute (must be "x86", "x64" or "ARM"): x85');
+ }).toThrow(new Error ('Invalid arch attribute (must be "x86", "x64" or "ARM"): x85'));
expect(function () {
install(invalidLibFiles[1], faultyPluginInfo, dummyProject);
- }).toThrow('Invalid versions attribute (must be a valid semantic version range): 8.0a');
+ }).toThrow(new Error ('Invalid versions attribute (must be a valid semantic version range): 8.0a'));
expect(function () {
install(invalidLibFiles[2], faultyPluginInfo, dummyProject);
- }).toThrow('Invalid device-target attribute (must be "all", "phone", "windows" or "win"): daphne');
+ }).toThrow(new Error ('Invalid device-target attribute (must be "all", "phone", "windows" or "win"): daphne'));
});
});
@@ -285,31 +337,86 @@
// This could be separated into individual specs, but that results in a lot of copying and deleting the
// project files, which is not needed.
- it('should write to correct project files when conditions are specified', function () {
+ it('Test #017 : should write to correct project files when conditions are specified', function () {
var xpath = 'Reference[@Include="dummy1"][@Condition="\'$(Platform)\'==\'x64\'"]/HintPath';
validateInstalledProjects('framework', frameworks[0], xpath, ['all']);
+ });
- xpath = 'Reference[@Include="dummy2"]/HintPath';
+ it('Test #018 : should write to correct project files when conditions are specified', function () {
+ var xpath = 'Reference[@Include="dummy2"]/HintPath';
validateInstalledProjects('framework', frameworks[1], xpath, ['all']);
+ });
- xpath = 'Reference[@Include="dummy3"]/HintPath';
+ it('Test #019 : should write to correct project files when conditions are specified', function () {
+ var xpath = 'Reference[@Include="dummy3"]/HintPath';
validateInstalledProjects('framework', frameworks[2], xpath, ['windows', 'windows8', 'windows10']);
+ });
- xpath = 'Reference[@Include="dummy4"][@Condition="\'$(Platform)\'==\'ARM\'"]/HintPath';
+ it('Test #020 : should write to correct project files when conditions are specified', function () {
+ var xpath = 'Reference[@Include="dummy4"][@Condition="\'$(Platform)\'==\'ARM\'"]/HintPath';
validateInstalledProjects('framework', frameworks[3], xpath, ['phone']);
+ });
- xpath = 'Reference[@Include="dummy5"]/HintPath';
+ it('Test #021 : should write to correct project files when conditions are specified', function () {
+ var xpath = 'Reference[@Include="dummy5"]/HintPath';
validateInstalledProjects('framework', frameworks[4], xpath, ['phone']);
+ });
- xpath = 'Reference[@Include="dummy6"]/HintPath';
+ it('Test #022 : should write to correct project files when conditions are specified', function () {
+ var xpath = 'Reference[@Include="dummy6"]/HintPath';
validateInstalledProjects('framework', frameworks[5], xpath, ['windows', 'windows10', 'phone']);
});
+
+ it('Test #023 : with .winmd and .dll files', function() {
+ var frameworks = copyArray(test_frameworks);
+ var install = PluginHandler.getInstaller('framework');
+ var uninstall = PluginHandler.getUninstaller('framework');
+ var testProject = JsprojManager.getProject(testProjectWindowsPlatformDir);
+
+ frameworks.forEach(function(framework) {
+ install(framework, testPluginInfo, testProject);
+ var dest = path.join('plugins', 'testPlugin', framework.targetDir || '', path.basename(framework.src));
+ if (framework.implementation) {
+ expect(copyFileSpy).toHaveBeenCalledWith(testPlugin, framework.implementation, testProjectWindowsPlatformDir, path.join(path.dirname(dest), path.basename(framework.implementation)));
+ }
+ });
+
+ var jsProjFileFromPlatform = path.join(testProjectWindowsPlatformDir, 'CordovaApp.Windows10.jsproj');
+ var searchProjects = testProject._projects.filter(function(project) {
+ return path.normalize(project.location) === jsProjFileFromPlatform;
+ });
+
+ expect(searchProjects.length).toBe(1);
+ var projectXmlTree = searchProjects[0].xml;
+
+ var refHintPaths = projectXmlTree.findall('./ItemGroup/Reference/HintPath');
+ var pathsEqual = refHintPaths.every(function(hintPath, index) {
+ return path.basename(hintPath.text) === path.basename(frameworks[index].src);
+ });
+
+ expect(pathsEqual).toBeTruthy();
+
+ var refWinMdStatus = projectXmlTree.findall('./ItemGroup/Reference/IsWinMDFile');
+ var allReferencesHaveMetadata = refWinMdStatus.every(function(isWinMd) {
+ return isWinMd.text === 'true';
+ });
+
+ expect(allReferencesHaveMetadata).toBeTruthy();
+
+ var refImplements = projectXmlTree.findall('./ItemGroup/Reference/Implementation');
+ expect(refImplements.length).toBe(1);
+ expect(refImplements[0].text).toBe(path.basename(frameworks[1].implementation));
+
+ frameworks.forEach(function(framework) {
+ uninstall(framework, testPluginInfo, testProject);
+ });
+ });
});
describe('of <framework> elements of type \'projectReference\'', function () {
var frameworks = copyArray(valid_frameworks);
- it('should write to correct project files when conditions are specified', function () {
+ it('Test #024 : should write to correct project files when conditions are specified', function () {
var curDir;
var xpath;
@@ -318,13 +425,39 @@
xpath = 'ProjectReference[@Include="' + winJoin('..', '..', 'plugins', 'org.test.plugins.dummyplugin', 'src', 'windows', 'dummy1.vcxproj') + '"][@Condition="\'$(Platform)\'==\'x64\'"]';
validateInstalledProjects('framework', frameworks[6], xpath, ['all']);
+ process.chdir(path.join(curDir, '..', '..', '..'));
+ });
+ it('Test #025 : should write to correct project files when conditions are specified', function () {
+ var curDir;
+ var xpath;
+
+ curDir = __dirname;
+ process.chdir(path.join(curDir, '..', 'fixtures', 'testProj'));
xpath = 'ProjectReference[@Include="' + winJoin('..', '..', 'plugins', 'org.test.plugins.dummyplugin', 'src', 'windows', 'dummy2.vcxproj') + '"]';
validateInstalledProjects('framework', frameworks[7], xpath, ['windows8']);
+ process.chdir(path.join(curDir, '..', '..', '..'));
+ });
+ it('Test #026 : should write to correct project files when conditions are specified', function () {
+ var curDir;
+ var xpath;
+
+ curDir = __dirname;
+ process.chdir(path.join(curDir, '..', 'fixtures', 'testProj'));
+
xpath = 'ProjectReference[@Include="' + winJoin('..', '..', 'plugins', 'org.test.plugins.dummyplugin', 'src', 'windows', 'dummy3.vcxproj') + '"]';
validateInstalledProjects('framework', frameworks[8], xpath, ['windows', 'windows8', 'windows10']);
+ process.chdir(path.join(curDir, '..', '..', '..'));
+ });
+ it('Test #027 : should write to correct project files when conditions are specified', function () {
+ var curDir;
+ var xpath;
+
+ curDir = __dirname;
+ process.chdir(path.join(curDir, '..', 'fixtures', 'testProj'));
+
xpath = 'ProjectReference[@Include="' + winJoin('..', '..', 'plugins', 'org.test.plugins.dummyplugin', 'src', 'windows', 'dummy4.vcxproj') + '"]';
validateInstalledProjects('framework', frameworks[9], xpath, ['windows', 'phone']);
@@ -344,13 +477,13 @@
platformWwwDest = path.resolve(dummyProject.platformWww, 'plugins', dummyPluginInfo.id, jsModule.src);
});
- it('should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
+ it('Test #028 : should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
install(jsModule, dummyPluginInfo, dummyProject, {usePlatformWww: true});
expect(fs.writeFileSync).toHaveBeenCalledWith(wwwDest, jasmine.any(String), 'utf-8');
expect(fs.writeFileSync).toHaveBeenCalledWith(platformWwwDest, jasmine.any(String), 'utf-8');
});
- it('should put module to www only when options.usePlatformWww flag is not specified', function () {
+ it('Test #025 : should put module to www only when options.usePlatformWww flag is not specified', function () {
install(jsModule, dummyPluginInfo, dummyProject);
expect(fs.writeFileSync).toHaveBeenCalledWith(wwwDest, jasmine.any(String), 'utf-8');
expect(fs.writeFileSync).not.toHaveBeenCalledWith(platformWwwDest, jasmine.any(String), 'utf-8');
@@ -363,18 +496,18 @@
var install = PluginHandler.getInstaller('asset');
beforeEach(function () {
- copyFileSpy.reset();
+ copyFileSpy.calls.reset();
wwwDest = path.resolve(dummyProject.www, asset.target);
platformWwwDest = path.resolve(dummyProject.platformWww, asset.target);
});
- it('should put asset to both www and platform_www when options.usePlatformWww flag is specified', function () {
+ it('Test #029 : should put asset to both www and platform_www when options.usePlatformWww flag is specified', function () {
install(asset, dummyPluginInfo, dummyProject, {usePlatformWww: true});
expect(copyFileSpy).toHaveBeenCalledWith(dummyPluginInfo.dir, asset.src, dummyProject.www, asset.target);
expect(copyFileSpy).toHaveBeenCalledWith(dummyPluginInfo.dir, asset.src, dummyProject.platformWww, asset.target);
});
- it('should put asset to www only when options.usePlatformWww flag is not specified', function () {
+ it('Test #030 : should put asset to www only when options.usePlatformWww flag is not specified', function () {
install(asset, dummyPluginInfo, dummyProject);
expect(copyFileSpy).toHaveBeenCalledWith(dummyPluginInfo.dir, asset.src, dummyProject.www, asset.target);
expect(copyFileSpy).not.toHaveBeenCalledWith(dummyPluginInfo.dir, asset.src, dummyProject.platformWww, asset.target);
@@ -387,7 +520,7 @@
var removeFileSpy = jasmine.createSpy('removeFile');
beforeEach(function () {
- PluginHandler.__set__('removeFile', removeFileSpy.andCallFake(removeFileOrig));
+ PluginHandler.__set__('removeFile', removeFileSpy.and.callFake(removeFileOrig));
});
afterEach(function () {
@@ -395,7 +528,6 @@
});
function validateUninstalledProjects(tag, elementToUninstall, xmlPath, incText, targetConditions, supportedPlatforms) {
- jasmine.getEnv().currentSpec.removeAllSpies();
var projects = copyArray(dummyProject.projects);
projects.push(dummyProject.master);
@@ -435,7 +567,7 @@
var install = PluginHandler.getInstaller('source-file');
var uninstall = PluginHandler.getUninstaller('source-file');
- it('should remove stuff by calling common.removeFile', function () {
+ it('Test #031 : should remove stuff by calling common.removeFile', function () {
var source = copyArray(valid_source);
install(source[0], dummyPluginInfo, dummyProject);
uninstall(source[0], dummyPluginInfo, dummyProject);
@@ -448,37 +580,106 @@
// project files, which is not needed.
var install = PluginHandler.getInstaller('resource-file');
- it('should remove from correct project files when conditions specified', function () {
+ it('Test #032 : should remove from correct project files when conditions specified', function () {
var resourcefiles = copyArray(valid_resourceFiles);
resourcefiles.forEach(function(resourceFile) {
install(resourceFile, dummyPluginInfo, dummyProject);
});
var path = 'ItemGroup/Content';
- var incText = computeResourcePath(resourcefiles[0]);
+ var incText = resourcefiles[0].target;
var targetConditions = {versions: undefined, deviceTarget: undefined, arch: 'x86'};
validateUninstalledProjects('resource-file', resourcefiles[0], path, incText, targetConditions, ['all']);
+ });
- incText = computeResourcePath(resourcefiles[1]);
- targetConditions = {versions: '>=8.1', deviceTarget: undefined, arch: undefined};
+ it('Test #033 : should remove from correct project files when conditions specified', function () {
+ var resourcefiles = copyArray(valid_resourceFiles);
+
+ resourcefiles.forEach(function(resourceFile) {
+ install(resourceFile, dummyPluginInfo, dummyProject);
+ });
+ var path = 'ItemGroup/Content';
+ var incText = resourcefiles[1].target;
+ var targetConditions = {versions: '>=8.1', deviceTarget: undefined, arch: undefined};
validateUninstalledProjects('resource-file', resourcefiles[1], path, incText, targetConditions, ['windows', 'phone', 'windows10']);
+ });
- incText = computeResourcePath(resourcefiles[2]);
- targetConditions = {versions: undefined, deviceTarget: 'phone', arch: undefined};
+ it('Test #034 : should remove from correct project files when conditions specified', function () {
+ var resourcefiles = copyArray(valid_resourceFiles);
+
+ resourcefiles.forEach(function(resourceFile) {
+ install(resourceFile, dummyPluginInfo, dummyProject);
+ });
+ var path = 'ItemGroup/Content';
+ var incText = resourcefiles[2].target;
+ var targetConditions = {versions: undefined, deviceTarget: 'phone', arch: undefined};
validateUninstalledProjects('resource-file', resourcefiles[2], path, incText, targetConditions, ['phone']);
+ });
- incText = computeResourcePath(resourcefiles[3]);
- targetConditions = {versions: '8.0', deviceTarget: 'windows', arch: 'x64'};
+ it('Test #035 : should remove from correct project files when conditions specified', function () {
+ var resourcefiles = copyArray(valid_resourceFiles);
+ resourcefiles.forEach(function(resourceFile) {
+ install(resourceFile, dummyPluginInfo, dummyProject);
+ });
+ var path = 'ItemGroup/Content';
+ var incText = resourcefiles[3].target;
+ var targetConditions = {versions: '8.0', deviceTarget: 'windows', arch: 'x64'};
validateUninstalledProjects('resource-file', resourcefiles[3], path, incText, targetConditions, ['windows8']);
});
+
+ it('Test #036 : should remove from correct project files when conditions specified with reference', function () {
+ var resourcereferencefiles = copyArray(valid_resourcereferenceFiles);
+
+ resourcereferencefiles.forEach(function(resourceFile) {
+ install(resourceFile, resourcePluginInfo, dummyProject);
+ });
+ var path = 'ItemGroup/Content';
+ var incText = computeResourcePath(resourcereferencefiles[0]);
+ var targetConditions = {versions: undefined, deviceTarget: undefined, arch: 'x86'};
+ validateUninstalledProjects('resource-file', resourcereferencefiles[0], path, incText, targetConditions, ['all']);
+ });
+ it('Test #036 : should remove from correct project files when conditions specified with reference', function () {
+ var resourcereferencefiles = copyArray(valid_resourcereferenceFiles);
+
+ resourcereferencefiles.forEach(function(resourceFile) {
+ install(resourceFile, resourcePluginInfo, dummyProject);
+ });
+ var path = 'ItemGroup/Content';
+ var incText = computeResourcePath(resourcereferencefiles[1]);
+ var targetConditions = {versions: '>=8.1', deviceTarget: undefined, arch: undefined};
+ validateUninstalledProjects('resource-file', resourcereferencefiles[1], path, incText, targetConditions, ['windows', 'phone', 'windows10']);
+ });
+
+ it('Test #036 : should remove from correct project files when conditions specified with reference', function () {
+ var resourcereferencefiles = copyArray(valid_resourcereferenceFiles);
+
+ resourcereferencefiles.forEach(function(resourceFile) {
+ install(resourceFile, resourcePluginInfo, dummyProject);
+ });
+ var path = 'ItemGroup/Content';
+ var incText = computeResourcePath(resourcereferencefiles[2]);
+ var targetConditions = {versions: undefined, deviceTarget: 'phone', arch: undefined};
+ validateUninstalledProjects('resource-file', resourcereferencefiles[2], path, incText, targetConditions, ['phone']);
+ });
+
+ it('Test #036 : should remove from correct project files when conditions specified with reference', function () {
+ var resourcereferencefiles = copyArray(valid_resourcereferenceFiles);
+
+ resourcereferencefiles.forEach(function(resourceFile) {
+ install(resourceFile, resourcePluginInfo, dummyProject);
+ });
+ var path = 'ItemGroup/Content';
+ var incText = computeResourcePath(resourcereferencefiles[3]);
+ var targetConditions = {versions: '8.0', deviceTarget: 'windows', arch: 'x64'};
+ validateUninstalledProjects('resource-file', resourcereferencefiles[3], path, incText, targetConditions, ['windows8']);
+ });
});
describe('of <lib-file> elements', function () {
// This could be separated into individual specs, but that results in a lot of copying and deleting the
// project files, which is not needed.
- it('should remove from correct project files when conditions specified', function () {
+ it('Test #033 : should remove from correct project files when conditions specified', function () {
var libfiles = copyArray(valid_libfiles);
-
libfiles.forEach(function(libfile) {
PluginHandler.getInstaller('lib-file')(libfile, dummyPluginInfo, dummyProject);
});
@@ -487,17 +688,41 @@
var incText = 'TestSDK1, Version=1.0';
var targetConditions = {versions: undefined, deviceTarget: undefined, arch: 'x86'};
validateUninstalledProjects('lib-file', libfiles[0], path, incText, targetConditions, ['all']);
+ });
- incText = 'TestSDK2, Version=1.0';
- targetConditions = {versions: '>=8.1', deviceTarget: undefined, arch: undefined};
+ it('Test #034 : should remove from correct project files when conditions specified', function () {
+ var libfiles = copyArray(valid_libfiles);
+ libfiles.forEach(function(libfile) {
+ PluginHandler.getInstaller('lib-file')(libfile, dummyPluginInfo, dummyProject);
+ });
+
+ var path = 'ItemGroup/SDKReference';
+ var incText = 'TestSDK2, Version=1.0';
+ var targetConditions = {versions: '>=8.1', deviceTarget: undefined, arch: undefined};
validateUninstalledProjects('lib-file', libfiles[1], path, incText, targetConditions, ['windows', 'phone', 'windows10']);
+ });
- incText = 'TestSDK3, Version=1.0';
- targetConditions = {versions: undefined, deviceTarget: 'phone', arch: undefined};
+ it('Test #035 : should remove from correct project files when conditions specified', function () {
+ var libfiles = copyArray(valid_libfiles);
+ libfiles.forEach(function(libfile) {
+ PluginHandler.getInstaller('lib-file')(libfile, dummyPluginInfo, dummyProject);
+ });
+
+ var path = 'ItemGroup/SDKReference';
+ var incText = 'TestSDK3, Version=1.0';
+ var targetConditions = {versions: undefined, deviceTarget: 'phone', arch: undefined};
validateUninstalledProjects('lib-file', libfiles[2], path, incText, targetConditions, ['phone']);
+ });
- incText = 'TestSDK4, Version=1.0';
- targetConditions = {versions: '8.0', deviceTarget: 'windows', arch: 'x86'};
+ it('Test #036 : should remove from correct project files when conditions specified', function () {
+ var libfiles = copyArray(valid_libfiles);
+ libfiles.forEach(function(libfile) {
+ PluginHandler.getInstaller('lib-file')(libfile, dummyPluginInfo, dummyProject);
+ });
+
+ var path = 'ItemGroup/SDKReference';
+ var incText = 'TestSDK4, Version=1.0';
+ var targetConditions = {versions: '8.0', deviceTarget: 'windows', arch: 'x86'};
validateUninstalledProjects('lib-file', libfiles[3], path, incText, targetConditions, ['windows8']);
});
});
@@ -505,7 +730,7 @@
describe('of <framework> elements', function () {
// This could be separated into individual specs, but that results in a lot of copying and deleting the
// project files, which is not needed.
- it('should remove from correct project files when conditions specified', function () {
+ it('Test #037 : should remove from correct project files when conditions specified', function () {
var curDir;
curDir = __dirname;
process.chdir(path.join(curDir, '..', 'fixtures', 'testProj'));
@@ -516,30 +741,100 @@
PluginHandler.getInstaller('framework')(framework, dummyPluginInfo, dummyProject);
});
-
var path2 = 'ItemGroup/Reference';
var incText = 'dummy1';
var targetConditions = {versions: undefined, deviceTarget: undefined, arch: 'x64'};
validateUninstalledProjects('framework', frameworks[0], path2, incText, targetConditions, ['all']);
- incText = 'dummy2';
- targetConditions = {versions: '>=8.0', deviceTarget: undefined, arch: undefined};
+ process.chdir(path.join(curDir, '..', '..', '..'));
+ });
+
+ it('Test #038 : should remove from correct project files when conditions specified', function () {
+ var curDir;
+ curDir = __dirname;
+ process.chdir(path.join(curDir, '..', 'fixtures', 'testProj'));
+
+ var frameworks = copyArray(valid_frameworks);
+
+ frameworks.forEach(function(framework) {
+ PluginHandler.getInstaller('framework')(framework, dummyPluginInfo, dummyProject);
+ });
+
+ var path2 = 'ItemGroup/Reference';
+ var incText = 'dummy2';
+ var targetConditions = {versions: '>=8.0', deviceTarget: undefined, arch: undefined};
validateUninstalledProjects('framework', frameworks[1], path2, incText, targetConditions, ['all']);
+ process.chdir(path.join(curDir, '..', '..', '..'));
+ });
- incText = 'dummy3';
- targetConditions = {versions: undefined, deviceTarget: 'windows', arch: undefined};
+ it('Test #039 : should remove from correct project files when conditions specified', function () {
+ var curDir;
+ curDir = __dirname;
+ process.chdir(path.join(curDir, '..', 'fixtures', 'testProj'));
+
+ var frameworks = copyArray(valid_frameworks);
+
+ frameworks.forEach(function(framework) {
+ PluginHandler.getInstaller('framework')(framework, dummyPluginInfo, dummyProject);
+ });
+
+ var path2 = 'ItemGroup/Reference';
+ var incText = 'dummy3';
+ var targetConditions = {versions: undefined, deviceTarget: 'windows', arch: undefined};
validateUninstalledProjects('framework', frameworks[2], path2, incText, targetConditions, ['windows', 'windows8', 'windows10']);
+ process.chdir(path.join(curDir, '..', '..', '..'));
+ });
- incText = 'dummy4';
- targetConditions = {versions: '8.1', deviceTarget: 'phone', arch: 'ARM'};
+ it('Test #040 : should remove from correct project files when conditions specified', function () {
+ var curDir;
+ curDir = __dirname;
+ process.chdir(path.join(curDir, '..', 'fixtures', 'testProj'));
+
+ var frameworks = copyArray(valid_frameworks);
+
+ frameworks.forEach(function(framework) {
+ PluginHandler.getInstaller('framework')(framework, dummyPluginInfo, dummyProject);
+ });
+
+ var path2 = 'ItemGroup/Reference';
+ var incText = 'dummy4';
+ var targetConditions = {versions: '8.1', deviceTarget: 'phone', arch: 'ARM'};
validateUninstalledProjects('framework', frameworks[3], path2, incText, targetConditions, ['phone']);
+ process.chdir(path.join(curDir, '..', '..', '..'));
+ });
- incText = 'dummy5';
- targetConditions = {versions: undefined, deviceTarget: 'phone', arch: undefined};
+ it('Test #041 : should remove from correct project files when conditions specified', function () {
+ var curDir;
+ curDir = __dirname;
+ process.chdir(path.join(curDir, '..', 'fixtures', 'testProj'));
+
+ var frameworks = copyArray(valid_frameworks);
+
+ frameworks.forEach(function(framework) {
+ PluginHandler.getInstaller('framework')(framework, dummyPluginInfo, dummyProject);
+ });
+
+ var path2 = 'ItemGroup/Reference';
+ var incText = 'dummy5';
+ var targetConditions = {versions: undefined, deviceTarget: 'phone', arch: undefined};
validateUninstalledProjects('framework', frameworks[4], path2, incText, targetConditions, ['phone']);
+ process.chdir(path.join(curDir, '..', '..', '..'));
+ });
- incText = 'dummy6';
- targetConditions = {versions: '>=8.1', deviceTarget: undefined, arch: undefined};
+ it('Test #042 : should remove from correct project files when conditions specified', function () {
+ var curDir;
+ curDir = __dirname;
+ process.chdir(path.join(curDir, '..', 'fixtures', 'testProj'));
+
+ var frameworks = copyArray(valid_frameworks);
+
+ frameworks.forEach(function(framework) {
+ PluginHandler.getInstaller('framework')(framework, dummyPluginInfo, dummyProject);
+ });
+
+ var path2 = 'ItemGroup/Reference';
+ var incText = 'dummy6';
+ var targetConditions = {versions: '>=8.1', deviceTarget: undefined, arch: undefined};
validateUninstalledProjects('framework', frameworks[5], path2, incText, targetConditions, ['windows', 'windows10', 'phone']);
process.chdir(path.join(curDir, '..', '..', '..'));
@@ -549,7 +844,7 @@
describe('of <framework> elements of type \'projectReference\'', function () {
// This could be separated into individual specs, but that results in a lot of copying and deleting the
// project files, which is not needed.
- it('should remove from correct project files when conditions specified', function () {
+ it('Test #043 :should remove from correct project files when conditions specified', function () {
var curDir;
curDir = __dirname;
process.chdir(path.join(curDir, '..', 'fixtures', 'testProj'));
@@ -565,16 +860,63 @@
var targetConditions = {versions: undefined, deviceTarget: undefined, arch: 'x64'};
validateUninstalledProjects('framework', frameworks[6], xmlPath, incText, targetConditions, ['all']);
- incText = winJoin('..', '..', 'plugins', dummyPluginInfo.id, frameworks[7].src);
- targetConditions = {versions: '<8.1', deviceTarget: undefined, arch: undefined};
+ process.chdir(path.join(curDir, '..', '..', '..'));
+ });
+ it('Test #044 :should remove from correct project files when conditions specified', function () {
+ var curDir;
+ curDir = __dirname;
+ process.chdir(path.join(curDir, '..', 'fixtures', 'testProj'));
+
+ var frameworks = copyArray(valid_frameworks);
+
+ frameworks.forEach(function(framework) {
+ PluginHandler.getInstaller('framework')(framework, dummyPluginInfo, dummyProject);
+ });
+
+ var xmlPath = 'ItemGroup/ProjectReference';
+
+ var incText = winJoin('..', '..', 'plugins', dummyPluginInfo.id, frameworks[7].src);
+ var targetConditions = {versions: '<8.1', deviceTarget: undefined, arch: undefined};
validateUninstalledProjects('framework', frameworks[7], xmlPath, incText, targetConditions, ['windows8']);
- incText = winJoin('..', '..', 'plugins', dummyPluginInfo.id, frameworks[8].src);
- targetConditions = {versions: undefined, deviceTarget: 'win', arch: undefined};
+ process.chdir(path.join(curDir, '..', '..', '..'));
+ });
+
+ it('Test #045 :should remove from correct project files when conditions specified', function () {
+ var curDir;
+ curDir = __dirname;
+ process.chdir(path.join(curDir, '..', 'fixtures', 'testProj'));
+
+ var frameworks = copyArray(valid_frameworks);
+
+ frameworks.forEach(function(framework) {
+ PluginHandler.getInstaller('framework')(framework, dummyPluginInfo, dummyProject);
+ });
+
+ var xmlPath = 'ItemGroup/ProjectReference';
+
+ var incText = winJoin('..', '..', 'plugins', dummyPluginInfo.id, frameworks[8].src);
+ var targetConditions = {versions: undefined, deviceTarget: 'win', arch: undefined};
validateUninstalledProjects('framework', frameworks[8], xmlPath, incText, targetConditions, ['windows', 'windows8', 'windows10']);
- incText = winJoin('..', '..', 'plugins', dummyPluginInfo.id, frameworks[9].src);
- targetConditions = {versions: '8.1', deviceTarget: 'all', arch: 'x86'};
+ process.chdir(path.join(curDir, '..', '..', '..'));
+ });
+
+ it('Test #046 :should remove from correct project files when conditions specified', function () {
+ var curDir;
+ curDir = __dirname;
+ process.chdir(path.join(curDir, '..', 'fixtures', 'testProj'));
+
+ var frameworks = copyArray(valid_frameworks);
+
+ frameworks.forEach(function(framework) {
+ PluginHandler.getInstaller('framework')(framework, dummyPluginInfo, dummyProject);
+ });
+
+ var xmlPath = 'ItemGroup/ProjectReference';
+
+ var incText = winJoin('..', '..', 'plugins', dummyPluginInfo.id, frameworks[9].src);
+ var targetConditions = {versions: '8.1', deviceTarget: 'all', arch: 'x86'};
validateUninstalledProjects('framework', frameworks[9], xmlPath, incText, targetConditions, ['windows', 'phone']);
process.chdir(path.join(curDir, '..', '..', '..'));
@@ -594,19 +936,19 @@
spyOn(shell, 'rm');
var existsSyncOrig = fs.existsSync;
- spyOn(fs, 'existsSync').andCallFake(function (file) {
+ spyOn(fs, 'existsSync').and.callFake(function (file) {
if ([wwwDest, platformWwwDest].indexOf(file) >= 0 ) return true;
return existsSyncOrig.call(fs, file);
});
});
- it('should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
+ it('Test #047 : should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
uninstall(jsModule, dummyPluginInfo, dummyProject, {usePlatformWww: true});
expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), wwwDest);
expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), platformWwwDest);
});
- it('should put module to www only when options.usePlatformWww flag is not specified', function () {
+ it('Test #048 : should put module to www only when options.usePlatformWww flag is not specified', function () {
uninstall(jsModule, dummyPluginInfo, dummyProject);
expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), wwwDest);
expect(shell.rm).not.toHaveBeenCalledWith(jasmine.any(String), platformWwwDest);
@@ -625,19 +967,19 @@
spyOn(shell, 'rm');
var existsSyncOrig = fs.existsSync;
- spyOn(fs, 'existsSync').andCallFake(function (file) {
+ spyOn(fs, 'existsSync').and.callFake(function (file) {
if ([wwwDest, platformWwwDest].indexOf(file) >= 0 ) return true;
return existsSyncOrig.call(fs, file);
});
});
- it('should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
+ it('Test #049 : should put module to both www and platform_www when options.usePlatformWww flag is specified', function () {
uninstall(asset, dummyPluginInfo, dummyProject, {usePlatformWww: true});
expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), wwwDest);
expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), platformWwwDest);
});
- it('should put module to www only when options.usePlatformWww flag is not specified', function () {
+ it('Test #050 : should put module to www only when options.usePlatformWww flag is not specified', function () {
uninstall(asset, dummyPluginInfo, dummyProject);
expect(shell.rm).toHaveBeenCalledWith(jasmine.any(String), wwwDest);
expect(shell.rm).not.toHaveBeenCalledWith(jasmine.any(String), platformWwwDest);
diff --git a/spec/unit/run.spec.js b/spec/unit/run.spec.js
index 6ffcda0..a17b58f 100644
--- a/spec/unit/run.spec.js
+++ b/spec/unit/run.spec.js
@@ -251,15 +251,15 @@
it('spec.8 should accept --archs parameter either as cli or as platform arg', function(done) {
- spyOn(utils, 'isCordovaProject').andReturn(true);
- spyOn(packages, 'getPackage').andReturn(Q({ arch: 'arm' }));
- spyOn(packages, 'deployToDesktop').andReturn(Q());
+ spyOn(utils, 'isCordovaProject').and.returnValue(true);
+ spyOn(packages, 'getPackage').and.returnValue(Q({ arch: 'arm' }));
+ spyOn(packages, 'deployToDesktop').and.returnValue(Q());
var anyString = jasmine.any(String);
var expectedDeployOptions = jasmine.objectContaining({arch: 'arm'});
var fail = jasmine.createSpy('fail')
- .andCallFake(function (err) {
+ .and.callFake(function (err) {
console.error(err);
});
@@ -284,9 +284,9 @@
it('spec.9 should fall back to anycpu if --archs parameter is not specified', function(done) {
- spyOn(utils, 'isCordovaProject').andReturn(true);
- spyOn(packages, 'getPackage').andReturn(Q({ arch: 'anycpu' }));
- spyOn(packages, 'deployToDesktop').andReturn(Q());
+ spyOn(utils, 'isCordovaProject').and.returnValue(true);
+ spyOn(packages, 'getPackage').and.returnValue(Q({ arch: 'anycpu' }));
+ spyOn(packages, 'deployToDesktop').and.returnValue(Q());
var anyString = jasmine.any(String);
var expectedDeployOptions = jasmine.objectContaining({arch: 'anycpu'});
diff --git a/template/CordovaApp.Phone.jsproj b/template/CordovaApp.Phone.jsproj
index fb900e3..4dc71e5 100644
--- a/template/CordovaApp.Phone.jsproj
+++ b/template/CordovaApp.Phone.jsproj
@@ -79,7 +79,9 @@
<AppxManifest Include="package.phone.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
- <Content Include="images\*.png" Exclude="images\*.scale-180.*" />
+ <Content Exclude="images\*SplashScreen.*" Include="images\*.png" />
+ <Content Exclude="images\*SplashScreen.*" Include="images\*.jpg" />
+ <Content Exclude="images\*SplashScreen.*" Include="images\*.jpeg" />
</ItemGroup>
<ItemGroup>
<SDKReference Include="Microsoft.Phone.WinJS.2.1, Version=1.0" />
@@ -97,4 +99,8 @@
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
</PropertyGroup>
-->
+ <PropertyGroup>
+ <PreBuildEvent>node "$(ProjectDir)\\cordova\\prebuild-phone-81.js"</PreBuildEvent>
+ <DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
+ </PropertyGroup>
</Project>
\ No newline at end of file
diff --git a/template/CordovaApp.Windows.jsproj b/template/CordovaApp.Windows.jsproj
index 7bb077d..35c8f68 100644
--- a/template/CordovaApp.Windows.jsproj
+++ b/template/CordovaApp.Windows.jsproj
@@ -79,7 +79,9 @@
<AppxManifest Include="package.windows.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
- <Content Include="images\*.png" Exclude="images\*.scale-240.*" />
+ <Content Exclude="images\*SplashScreenPhone*;images\*.scale-240.*" Include="images\*.png" />
+ <Content Exclude="images\*SplashScreenPhone*;images\*.scale-240.*" Include="images\*.jpg" />
+ <Content Exclude="images\*SplashScreenPhone*;images\*.scale-240.*" Include="images\*.jpeg" />
</ItemGroup>
<ItemGroup>
<SDKReference Include="Microsoft.WinJS.2.0, Version=1.0" />
@@ -97,4 +99,8 @@
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
</PropertyGroup>
-->
+ <PropertyGroup>
+ <PreBuildEvent>node "$(ProjectDir)\\cordova\\prebuild-81.js"</PreBuildEvent>
+ <DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
+ </PropertyGroup>
</Project>
\ No newline at end of file
diff --git a/template/CordovaApp.Windows10.jsproj b/template/CordovaApp.Windows10.jsproj
index 076444d..541228e 100644
--- a/template/CordovaApp.Windows10.jsproj
+++ b/template/CordovaApp.Windows10.jsproj
@@ -98,11 +98,18 @@
<AppxManifest Include="package.windows10.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
- <Content Include="images\*.png" Exclude="images\*.scale-240.*" />
+ <Content Exclude="images\*SplashScreenPhone*;images\*.scale-240.*" Include="images\*.png" />
+ <Content Exclude="images\*SplashScreenPhone*;images\*.scale-240.*" Include="images\*.jpg" />
+ <Content Exclude="images\*SplashScreenPhone*;images\*.scale-240.*" Include="images\*.jpeg" />
+ <Content Include="Properties\Default.rd.xml" />
</ItemGroup>
<Import Project="CordovaApp.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).targets" />
<Target AfterTargets="ResolveAssemblyReferences" BeforeTargets="AfterResolveReferences" Condition="'$(Platform)' == 'AnyCPU'" Name="DetectMangedWinMDWithAnyCpu">
<Error Condition="'%(_ResolveAssemblyReferenceResolvedFiles.WinMDFile)' == 'true' AND '%(_ResolveAssemblyReferenceResolvedFiles.WinMDFileType)' == 'Managed'" Text="The following component requires .NET Native compilation which is not available when targeting 'Windows10' and 'AnyCPU'. Consider changing the targeted processor architecture to one of the following: 'x86, x64, ARM' (if you are using command line this could be done by adding '--archs' parameter, for example: 'cordova build windows --archs=x64'). %(_ResolveAssemblyReferenceResolvedFiles.Identity)" />
</Target>
+ <PropertyGroup>
+ <PreBuildEvent>node "$(ProjectDir)\\cordova\\prebuild-10.js"</PreBuildEvent>
+ <DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
+ </PropertyGroup>
</Project>
\ No newline at end of file
diff --git a/template/Properties/Default.rd.xml b/template/Properties/Default.rd.xml
new file mode 100644
index 0000000..7c40ffe
--- /dev/null
+++ b/template/Properties/Default.rd.xml
@@ -0,0 +1,31 @@
+<!--
+ This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most
+ developers. However, you can modify these parameters to modify the behavior of the .NET Native
+ optimizer.
+
+ Runtime Directives are documented at https://go.microsoft.com/fwlink/?LinkID=391919
+
+ To fully enable reflection for App1.MyClass and all of its public/private members
+ <Type Name="App1.MyClass" Dynamic="Required All"/>
+
+ To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32
+ <TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />
+
+ Using the Namespace directive to apply reflection policy to all the types in a particular namespace
+ <Namespace Name="DataClasses.ViewModels" Seralize="All" />
+-->
+
+<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
+ <Application>
+ <!--
+ An Assembly element with Name="*Application*" applies to all assemblies in
+ the application package. The asterisks are not wildcards.
+ -->
+ <Assembly Name="*Application*" Dynamic="Required All" />
+
+
+ <!-- Add your application specific runtime directives here. -->
+
+
+ </Application>
+</Directives>
\ No newline at end of file
diff --git a/template/cordova/Api.js b/template/cordova/Api.js
index 1fb62ce..125e3c5 100644
--- a/template/cordova/Api.js
+++ b/template/cordova/Api.js
@@ -22,6 +22,10 @@
var JsprojManager = require('./lib/JsprojManager');
var PluginManager = require('cordova-common').PluginManager;
var CordovaLogger = require('cordova-common').CordovaLogger;
+var PlatformMunger = require('./lib/ConfigChanges.js').PlatformMunger;
+var PlatformJson = require('cordova-common').PlatformJson;
+var PluginInfo = require('./lib/PluginInfo').PluginInfo;
+var PluginInfoProvider = require('cordova-common').PluginInfoProvider;
var PLATFORM = 'windows';
@@ -86,14 +90,24 @@
* @return {Promise<PlatformApi>} Promise either fulfilled with PlatformApi
* instance or rejected with CordovaError.
*/
-Api.createPlatform = function (destinationDir, projectConfig, options, eventEmitter) {
- setupEvents(eventEmitter);
- return require('../../bin/lib/create')
- .create(destinationDir, projectConfig, options)
- .then(function () {
- var PlatformApi = require(path.resolve(destinationDir, 'cordova/Api'));
- return new PlatformApi(PLATFORM, destinationDir, eventEmitter);
- });
+Api.createPlatform = function (destinationDir, projectConfig, options, events) {
+ setupEvents(events);
+ var result;
+
+ try {
+ result = require('../../bin/lib/create')
+ .create(destinationDir, projectConfig, options)
+ .then(function () {
+ var PlatformApi = require(path.resolve(destinationDir, 'cordova/Api'));
+ return new PlatformApi(PLATFORM, destinationDir, events);
+ });
+ }
+ catch(e) {
+ events.emit('error','createPlatform is not callable from the windows project API.');
+ throw(e);
+ }
+
+ return result;
};
/**
@@ -106,19 +120,25 @@
* should override the default one from platform.
* @param {Boolean} [options.link=false] Flag that indicates that platform's sources
* will be linked to installed platform instead of copying.
- * @param {EventEmitter} [eventEmitter] The emitter that will be used for logging
+ * @param {EventEmitter} [events] The emitter that will be used for logging
*
* @return {Promise<PlatformApi>} Promise either fulfilled with PlatformApi
* instance or rejected with CordovaError.
*/
-Api.updatePlatform = function (destinationDir, options, eventEmitter) {
- setupEvents(eventEmitter);
- return require('../../bin/lib/update')
- .update(destinationDir, options)
- .then(function () {
- var PlatformApi = require(path.resolve(destinationDir, 'cordova/Api'));
- return new PlatformApi(PLATFORM, destinationDir, eventEmitter);
- });
+Api.updatePlatform = function (destinationDir, options, events) {
+ setupEvents(events);
+ try {
+ return require('../../bin/lib/update')
+ .update(destinationDir, options)
+ .then(function () {
+ var PlatformApi = require(path.resolve(destinationDir, 'cordova/Api'));
+ return new PlatformApi(PLATFORM, destinationDir, events);
+ });
+ }
+ catch(e) {
+ events.emit('error','updatePlatform is not callable from the windows project API.');
+ throw(e);
+ }
};
/**
@@ -181,6 +201,9 @@
var self = this;
+ // We need to use custom PluginInfo to trigger windows-specific processing
+ // of changes in .appxmanifest files. See PluginInfo.js for details
+ var pluginInfo = new PluginInfo(plugin.dir);
var jsProject = JsprojManager.getProject(this.root);
installOptions = installOptions || {};
installOptions.variables = installOptions.variables || {};
@@ -189,8 +212,11 @@
installOptions.variables.PACKAGE_NAME = jsProject.getPackageName();
}
- return PluginManager.get(this.platform, this.locations, jsProject)
- .addPlugin(plugin, installOptions)
+ var platformJson = PlatformJson.load(this.root, this.platform);
+ var pluginManager = PluginManager.get(this.platform, this.locations, jsProject);
+ pluginManager.munger = new PlatformMunger(this.platform, this.locations.root, platformJson, new PluginInfoProvider());
+ return pluginManager
+ .addPlugin(pluginInfo, installOptions)
.then(function () {
// CB-11657 Add BOM to www files here because files added by plugin
// probably don't have it. Prepare would add BOM but it might not be called
@@ -216,9 +242,18 @@
*/
Api.prototype.removePlugin = function (plugin, uninstallOptions) {
var self = this;
+
+ // We need to use custom PluginInfo to trigger windows-specific processing
+ // of changes in .appxmanifest files. See PluginInfo.js for details
+ var pluginInfo = new PluginInfo(plugin.dir);
var jsProject = JsprojManager.getProject(this.root);
- return PluginManager.get(this.platform, this.locations, jsProject)
- .removePlugin(plugin, uninstallOptions)
+ var platformJson = PlatformJson.load(this.root, this.platform);
+ var pluginManager = PluginManager.get(this.platform, this.locations, jsProject);
+ // CB-11933 We override this field by windows specific one because windows has special logic
+ // for appxmanifest's capabilities removal (see also https://issues.apache.org/jira/browse/CB-11066)
+ pluginManager.munger = new PlatformMunger(this.platform, this.locations.root, platformJson, new PluginInfoProvider());
+ return pluginManager
+ .removePlugin(pluginInfo, uninstallOptions)
.then(function () {
// CB-11657 Add BOM to cordova_plugins, since it is was
// regenerated after plugin uninstallation and does not have BOM
diff --git a/template/cordova/build b/template/cordova/build
index 9816d41..18762e2 100644
--- a/template/cordova/build
+++ b/template/cordova/build
@@ -49,6 +49,7 @@
console.log(' --packageThumbprint : Thumbprint associated with the certificate.');
console.log(' --publisherId : Sets publisher id field in manifest.');
console.log(' --buildConfig : Sets build settings from configuration file.');
+ console.log(' --buildFlag : Sets build flag to pass to MSBuild (can be specified multiple times)');
console.log('');
console.log('examples:');
console.log(' build ');
@@ -59,6 +60,7 @@
console.log(' build --packageCertificateKeyFile="CordovaApp_TemporaryKey.pfx"');
console.log(' build --publisherId="CN=FakeCorp, C=US"');
console.log(' build --buildConfig="build.json"');
+ console.log(' build --buildFlag="/clp:Verbosity=normal" --buildFlag="/p:myBuildProperty=Foo"');
console.log('');
process.exit(0);
@@ -71,7 +73,8 @@
'debug' : Boolean,
'release' : Boolean,
'nobuild': Boolean,
- 'buildConfig' : path
+ 'buildConfig' : path,
+ 'buildFlag': [String, Array]
}, { d : '--verbose', r: '--release' });
// Make buildOptions compatible with PlatformApi build method spec
diff --git a/template/cordova/lib/AppxManifest.js b/template/cordova/lib/AppxManifest.js
index 6740191..4b478de 100644
--- a/template/cordova/lib/AppxManifest.js
+++ b/template/cordova/lib/AppxManifest.js
@@ -20,6 +20,7 @@
var fs = require('fs');
var util = require('util');
var et = require('elementtree');
+var path = require('path');
var xml= require('cordova-common').xmlHelpers;
var UAP_RESTRICTED_CAPS = ['enterpriseAuthentication', 'sharedUserCertificates',
@@ -72,6 +73,13 @@
this.hasPhoneIdentity = this.prefix === 'uap:' || this.prefix === 'm3:';
}
+// Static read-only property to get capabilities which need to be prefixed with uap
+Object.defineProperty(AppxManifest, 'CapsNeedUapPrefix', {
+ writable: false,
+ configurable: false,
+ value: CAPS_NEEDING_UAPNS
+});
+
/**
* @static
* @constructs AppxManifest|Win10AppxManifest
@@ -385,16 +393,39 @@
return this.setBackgroundColor(color);
} catch (e) { return this; }
},
+ getForegroundText: function () {
+ return visualElements.attrib.ForegroundText;
+ },
+ setForegroundText: function (color) {
+ // If color is not set, fall back to 'light' by default
+ visualElements.attrib.ForegroundText = color || 'light';
+
+ return this;
+ },
getSplashBackgroundColor: function () {
var splashNode = visualElements.find('./' + self.prefix + 'SplashScreen');
return splashNode && splashNode.attrib.BackgroundColor;
},
setSplashBackgroundColor: function (color) {
var splashNode = visualElements.find('./' + self.prefix + 'SplashScreen');
- if (color && splashNode) {
- splashNode.attrib.BackgroundColor = refineColor(color);
- } else if (!color) {
- delete splashNode.attrib.BackgroundColor;
+ if (splashNode) {
+ if (color) {
+ splashNode.attrib.BackgroundColor = refineColor(color);
+ } else {
+ delete splashNode.attrib.BackgroundColor;
+ }
+ }
+ return this;
+ },
+ getSplashScreenExtension: function (extension) {
+ var splashNode = visualElements.find('./' + self.prefix + 'SplashScreen');
+ return splashNode && splashNode.attrib.Image && path.extname(splashNode.attrib.Image);
+ },
+ setSplashScreenExtension: function (extension) {
+ var splashNode = visualElements.find('./' + self.prefix + 'SplashScreen');
+ if (splashNode) {
+ var oldPath = splashNode.attrib.Image;
+ splashNode.attrib.Image = path.dirname(oldPath) + '\\' + path.basename(oldPath, path.extname(oldPath)) + extension;
}
return this;
},
@@ -590,6 +621,10 @@
result.getToastCapable = function () {};
result.setToastCapable = function () { return this; };
+ // ForegroundText was removed in Windows 10 as well
+ result.getForegroundText = function () {};
+ result.setForegroundText = function () { return this; };
+
return result;
};
diff --git a/template/cordova/lib/ConfigChanges.js b/template/cordova/lib/ConfigChanges.js
index 7e15606..c07a77a 100644
--- a/template/cordova/lib/ConfigChanges.js
+++ b/template/cordova/lib/ConfigChanges.js
@@ -15,7 +15,12 @@
*/
var util = require('util');
+var path = require('path');
var CommonMunger = require('cordova-common').ConfigChanges.PlatformMunger;
+var CapsNeedUapPrefix = require(path.join(__dirname, 'AppxManifest')).CapsNeedUapPrefix;
+
+var CAPS_SELECTOR = '/Package/Capabilities';
+var WINDOWS10_MANIFEST = 'package.windows10.appxmanifest';
function PlatformMunger(platform, project_dir, platformJson, pluginInfoProvider) {
CommonMunger.apply(this, arguments);
@@ -34,54 +39,126 @@
* need to be removed or added to the file
*/
PlatformMunger.prototype.apply_file_munge = function (file, munge, remove) {
- // Call parent class' method
- PlatformMunger.super_.prototype.apply_file_munge.call(this, file, munge, remove);
- // CB-11066 If this is a windows10 manifest and we're removing the changes
- // then we also need to check if there are <Capability> elements were previously
- // added and schedule removal of corresponding <uap:Capability> elements
- if (remove && file === 'package.windows10.appxmanifest') {
- var uapCapabilitiesMunge = generateUapCapabilities(munge);
- // We do not check whether generated munge is empty or not before calling
- // 'apply_file_munge' since applying empty one is just a no-op
- PlatformMunger.super_.prototype.apply_file_munge.call(this, file, uapCapabilitiesMunge, remove);
+ // Create a copy to avoid modification of original munge
+ var mungeCopy = cloneObject(munge);
+ var capabilities = mungeCopy.parents[CAPS_SELECTOR];
+
+ if (capabilities) {
+ // Add 'uap' prefixes for windows 10 manifest
+ if (file === WINDOWS10_MANIFEST) {
+ capabilities = generateUapCapabilities(capabilities);
+ }
+
+ // Remove duplicates and sort capabilities when installing plugin
+ if (!remove) {
+ capabilities = getUniqueCapabilities(capabilities).sort(compareCapabilities);
+ }
+
+ // Put back capabilities into munge's copy
+ mungeCopy.parents[CAPS_SELECTOR] = capabilities;
}
+
+ PlatformMunger.super_.prototype.apply_file_munge.call(this, file, mungeCopy, remove);
};
+// Recursive function to clone an object
+function cloneObject(obj) {
+ if (obj === null || typeof obj !== 'object') {
+ return obj;
+ }
+
+ var copy = obj.constructor();
+ Object.keys(obj).forEach(function(key) {
+ copy[key] = cloneObject(obj[key]);
+ });
+
+ return copy;
+}
+
+/**
+ * Retrieve capabality name from xml field
+ * @param {Object} capability with xml field like <Capability Name="CapabilityName">
+ * @return {String} name of capability
+ */
+function getCapabilityName(capability) {
+ var reg = /Name\s*=\s*"(.*?)"/;
+ return capability.xml.match(reg)[1];
+}
+
+/**
+ * Remove capabilities with same names
+ * @param {Object} an array of capabilities
+ * @return {Object} an unique array of capabilities
+ */
+function getUniqueCapabilities(capabilities) {
+ return capabilities.reduce(function(uniqueCaps, currCap) {
+
+ var isRepeated = uniqueCaps.some(function(cap) {
+ return getCapabilityName(cap) === getCapabilityName(currCap);
+ });
+
+ return isRepeated ? uniqueCaps : uniqueCaps.concat([currCap]);
+ }, []);
+}
+
+/**
+ * Comparator function to pass to Array.sort
+ * @param {Object} firstCap first capability
+ * @param {Object} secondCap second capability
+ * @return {Number} either -1, 0 or 1
+ */
+function compareCapabilities(firstCap, secondCap) {
+ var firstCapName = getCapabilityName(firstCap);
+ var secondCapName = getCapabilityName(secondCap);
+
+ if (firstCapName < secondCapName) {
+ return -1;
+ }
+
+ if (firstCapName > secondCapName) {
+ return 1;
+ }
+
+ return 0;
+}
+
+
/**
* Generates a new munge that contains <uap:Capability> elements created based on
* corresponding <Capability> elements from base munge. If there are no such elements
* found in base munge, the empty munge is returned (selectors might be present under
* the 'parents' key, but they will contain no changes).
*
- * @param {Object} munge A munge that we need to check for <Capability> elements
- * @return {Object} A munge with 'uap'-prefixed capabilities or empty one
+ * @param {Object} capabilities A list of capabilities
+ * @return {Object} A list with 'uap'-prefixed capabilities
*/
-function generateUapCapabilities(munge) {
+function generateUapCapabilities(capabilities) {
function hasCapabilityChange(change) {
- return /^\s*<Capability\s/.test(change.xml);
+ return /^\s*<(\w+:)?(Device)?Capability\s/.test(change.xml);
}
function createPrefixedCapabilityChange(change) {
+ if (CapsNeedUapPrefix.indexOf(getCapabilityName(change)) < 0) {
+ return change;
+ }
+
+ // If capability is already prefixed, avoid adding another prefix
+ var replaceXML = change.xml.indexOf('uap:') > 0 ? change.xml : change.xml.replace(/Capability/, 'uap:Capability');
return {
- xml: change.xml.replace(/Capability/, 'uap:Capability'),
+ xml: replaceXML,
count: change.count,
before: change.before
};
}
- // Iterate through all selectors in munge
- return Object.keys(munge.parents)
- .reduce(function (result, selector) {
- result.parents[selector] = munge.parents[selector]
- // For every xml change check if it adds a <Capability> element ...
- .filter(hasCapabilityChange)
- // ... and create a duplicate with 'uap:' prefix
- .map(createPrefixedCapabilityChange);
+ return capabilities
+ // For every xml change check if it adds a <Capability> element ...
+ .filter(hasCapabilityChange)
+ // ... and create a duplicate with 'uap:' prefix
+ .map(createPrefixedCapabilityChange);
- return result;
- }, { parents: {} });
}
exports.PlatformMunger = PlatformMunger;
diff --git a/template/cordova/lib/JsprojManager.js b/template/cordova/lib/JsprojManager.js
index 21ee808..28b2fa3 100644
--- a/template/cordova/lib/JsprojManager.js
+++ b/template/cordova/lib/JsprojManager.js
@@ -122,6 +122,7 @@
children.push(copyToOutputDirectory);
var item = createItemGroupElement('ItemGroup/Content', sourcePath, targetConditions, children);
+
this._getMatchingProjects(targetConditions).forEach(function (project) {
project.appendToRoot(item);
});
@@ -134,7 +135,7 @@
});
},
- addReference: function (relPath, targetConditions) {
+ addReference: function (relPath, targetConditions, implPath) {
events.emit('verbose', 'jsprojManager.addReference(incText: ' + relPath + ', targetConditions: ' + JSON.stringify(targetConditions) + ')');
// add hint path with full path
@@ -149,6 +150,13 @@
children.push(mdFileTag);
}
+ // We only need to add <Implementation> tag when dll base name differs from winmd name
+ if (implPath && path.basename(relPath, '.winmd') !== path.basename(implPath, '.dll')) {
+ var implementTag = new et.Element('Implementation');
+ implementTag.text = path.basename(implPath);
+ children.push(implementTag);
+ }
+
var item = createItemGroupElement('ItemGroup/Reference', path.basename(relPath, extName), targetConditions, children);
this._getMatchingProjects(targetConditions).forEach(function (project) {
project.appendToRoot(item);
diff --git a/template/cordova/lib/MSBuildTools.js b/template/cordova/lib/MSBuildTools.js
index 7cc6794..6da98c8 100644
--- a/template/cordova/lib/MSBuildTools.js
+++ b/template/cordova/lib/MSBuildTools.js
@@ -29,7 +29,7 @@
this.path = path;
}
-MSBuildTools.prototype.buildProject = function(projFile, buildType, buildarch, otherConfigProperties) {
+MSBuildTools.prototype.buildProject = function(projFile, buildType, buildarch, buildFlags) {
events.emit('log', 'Building project: ' + projFile);
events.emit('log', '\tConfiguration : ' + buildType);
events.emit('log', '\tPlatform : ' + buildarch);
@@ -46,11 +46,8 @@
'/p:Configuration=' + buildType,
'/p:Platform=' + buildarch];
- if (otherConfigProperties) {
- var keys = Object.keys(otherConfigProperties);
- keys.forEach(function(key) {
- args.push('/p:' + key + '=' + otherConfigProperties[key]);
- });
+ if (buildFlags) {
+ args = args.concat(buildFlags);
}
var that = this;
diff --git a/template/cordova/lib/PluginHandler.js b/template/cordova/lib/PluginHandler.js
index e2511f6..c264f20 100644
--- a/template/cordova/lib/PluginHandler.js
+++ b/template/cordova/lib/PluginHandler.js
@@ -53,18 +53,36 @@
},
'resource-file':{
install:function(obj, plugin, project, options) {
- // do not copy, but reference the file in the plugin folder. This allows to
- // have multiple source files map to the same target and select the appropriate
- // one based on the current build settings, e.g. architecture.
- // also, we don't check for existence. This allows to insert build variables
- // into the source file name, e.g.
- // <resource-file src="$(Platform)/My.dll" target="My.dll" />
- var relativeSrcPath = getPluginFilePath(plugin, obj.src, project.projectFolder);
- project.addResourceFileToProject(relativeSrcPath, obj.target, getTargetConditions(obj));
+ if (obj.reference) {
+ // do not copy, but reference the file in the plugin folder. This allows to
+ // have multiple source files map to the same target and select the appropriate
+ // one based on the current build settings, e.g. architecture.
+ // also, we don't check for existence. This allows to insert build variables
+ // into the source file name, e.g.
+ // <resource-file src="$(Platform)/My.dll" target="My.dll" />
+ var relativeSrcPath = getPluginFilePath(plugin, obj.src, project.projectFolder);
+ project.addResourceFileToProject(relativeSrcPath, obj.target, getTargetConditions(obj));
+ } else {
+ // if target already exists, emit warning to consider using a reference instead of copying
+ if (fs.existsSync(path.resolve(project.root, obj.target))) {
+ events.emit('warn', '<resource-file> with target ' + obj.target + ' already exists and will be overwritten ' +
+ 'by a <resource-file> with the same target. Consider using the attribute reference="true" in the ' +
+ '<resource-file> tag to avoid overwriting files with the same target. Using reference will not copy files ' +
+ 'to the destination, instead will create a reference to the source path.');
+ }
+ // as per specification resource-file target is specified relative to platform root
+ copyFile(plugin.dir, obj.src, project.root, obj.target);
+ project.addResourceFileToProject(obj.target, obj.target, getTargetConditions(obj));
+ }
},
uninstall:function(obj, plugin, project, options) {
- var relativeSrcPath = getPluginFilePath(plugin, obj.src, project.projectFolder);
- project.removeResourceFileFromProject(relativeSrcPath, getTargetConditions(obj));
+ if (obj.reference) {
+ var relativeSrcPath = getPluginFilePath(plugin, obj.src, project.projectFolder);
+ project.removeResourceFileFromProject(relativeSrcPath, getTargetConditions(obj));
+ } else {
+ removeFile(project.root, obj.target);
+ project.removeResourceFileFromProject(obj.target, getTargetConditions(obj));
+ }
}
},
'lib-file': {
@@ -86,6 +104,7 @@
var dest = src;
var type = obj.type;
var targetDir = obj.targetDir || '';
+ var implementPath = obj.implementation;
if(type === 'projectReference') {
dest = path.join(path.relative(project.projectFolder, plugin.dir), targetDir, src);
@@ -94,7 +113,10 @@
// path.join ignores empty paths passed so we don't check whether targetDir is not empty
dest = path.join('plugins', plugin.id, targetDir, path.basename(src));
copyFile(plugin.dir, src, project.root, dest);
- project.addReference(dest, getTargetConditions(obj));
+ if (implementPath) {
+ copyFile(plugin.dir, implementPath, project.root, path.join(path.dirname(dest), path.basename(implementPath)));
+ }
+ project.addReference(dest, getTargetConditions(obj), implementPath);
}
},
@@ -204,7 +226,7 @@
dest = path.resolve(project_dir, dest);
// check that dest path is located in project directory
- if (dest.indexOf(project_dir) !== 0)
+ if (dest.indexOf(path.resolve(project_dir)) !== 0)
throw new CordovaError('Destination "' + dest + '" for source file "' + src + '" is located outside the project');
shell.mkdir('-p', path.dirname(dest));
diff --git a/template/cordova/lib/PluginInfo.js b/template/cordova/lib/PluginInfo.js
new file mode 100644
index 0000000..78c9593
--- /dev/null
+++ b/template/cordova/lib/PluginInfo.js
@@ -0,0 +1,139 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var semver = require('semver');
+var CommonPluginInfo = require('cordova-common').PluginInfo;
+
+var MANIFESTS = {
+ 'windows': {
+ '8.1.0': 'package.windows.appxmanifest',
+ '10.0.0': 'package.windows10.appxmanifest'
+ },
+ 'phone': {
+ '8.1.0': 'package.phone.appxmanifest',
+ '10.0.0': 'package.windows10.appxmanifest'
+ },
+ 'all': {
+ '8.1.0': ['package.windows.appxmanifest', 'package.phone.appxmanifest'],
+ '10.0.0': 'package.windows10.appxmanifest'
+ }
+};
+
+var SUBSTS = ['package.phone.appxmanifest', 'package.windows.appxmanifest', 'package.windows10.appxmanifest'];
+var TARGETS = ['windows', 'phone', 'all'];
+
+function processChanges(changes) {
+ var hasManifestChanges = changes.some(function(change) {
+ return change.target === 'package.appxmanifest';
+ });
+
+ if (!hasManifestChanges) {
+ return changes;
+ }
+
+ // Demux 'package.appxmanifest' into relevant platform-specific appx manifests.
+ // Only spend the cycles if there are version-specific plugin settings
+ var oldChanges = changes;
+ changes = [];
+
+ oldChanges.forEach(function(change) {
+ // Only support semver/device-target demux for package.appxmanifest
+ // Pass through in case something downstream wants to use it
+ if (change.target !== 'package.appxmanifest') {
+ changes.push(change);
+ return;
+ }
+
+ var manifestsForChange = getManifestsForChange(change);
+ changes = changes.concat(demuxChangeWithSubsts(change, manifestsForChange));
+ });
+
+ return changes;
+}
+
+function demuxChangeWithSubsts(change, manifestFiles) {
+ return manifestFiles.map(function(file) {
+ return createReplacement(file, change);
+ });
+}
+
+function getManifestsForChange(change) {
+ var hasTarget = (typeof change.deviceTarget !== 'undefined');
+ var hasVersion = (typeof change.versions !== 'undefined');
+
+ var targetDeviceSet = hasTarget ? change.deviceTarget : 'all';
+
+ if (TARGETS.indexOf(targetDeviceSet) === -1) {
+ // target-device couldn't be resolved, fix it up here to a valid value
+ targetDeviceSet = 'all';
+ }
+
+ // No semver/device-target for this config-file, pass it through
+ if (!(hasTarget || hasVersion)) {
+ return SUBSTS;
+ }
+
+ var knownWindowsVersionsForTargetDeviceSet = Object.keys(MANIFESTS[targetDeviceSet]);
+ return knownWindowsVersionsForTargetDeviceSet.reduce(function(manifestFiles, winver) {
+ if (hasVersion && !semver.satisfies(winver, change.versions)) {
+ return manifestFiles;
+ }
+ return manifestFiles.concat(MANIFESTS[targetDeviceSet][winver]);
+ }, []);
+}
+
+// This is a local function that creates the new replacement representing the
+// mutation. Used to save code further down.
+function createReplacement(manifestFile, originalChange) {
+ var replacement = {
+ target: manifestFile,
+ parent: originalChange.parent,
+ after: originalChange.after,
+ xmls: originalChange.xmls,
+ versions: originalChange.versions,
+ deviceTarget: originalChange.deviceTarget
+ };
+ return replacement;
+}
+
+
+/*
+A class for holidng the information currently stored in plugin.xml
+It's inherited from cordova-common's PluginInfo class
+In addition it overrides getConfigFiles, getEditConfigs, getFrameworks methods to use windows-specific logic
+ */
+function PluginInfo(dirname) {
+ // We're not using `util.inherit' because original PluginInfo defines
+ // its' methods inside of constructor
+ CommonPluginInfo.apply(this, arguments);
+ var parentGetConfigFiles = this.getConfigFiles;
+ var parentGetEditConfigs = this.getEditConfigs;
+
+ this.getEditConfigs = function(platform) {
+ var editConfigs = parentGetEditConfigs(platform);
+ return processChanges(editConfigs);
+ };
+
+ this.getConfigFiles = function(platform) {
+ var configFiles = parentGetConfigFiles(platform);
+ return processChanges(configFiles);
+ };
+}
+
+exports.PluginInfo = PluginInfo;
diff --git a/template/cordova/lib/build.js b/template/cordova/lib/build.js
index 6c173a6..b9bbfeb 100644
--- a/template/cordova/lib/build.js
+++ b/template/cordova/lib/build.js
@@ -161,7 +161,8 @@
'packageCertificateKeyFile': String,
'packageThumbprint': String,
'publisherId': String,
- 'buildConfig': String
+ 'buildConfig': String,
+ 'buildFlag': [String, Array]
}, {}, options.argv, 0);
var config = {};
@@ -197,12 +198,16 @@
}
// if build.json is provided, parse it
- var buildConfigPath = options.buildConfig;
+ var buildConfigPath = options.buildConfig || args.buildConfig;
if (buildConfigPath) {
buildConfig = parseBuildConfig(buildConfigPath, config.buildType);
for (var prop in buildConfig) { config[prop] = buildConfig[prop]; }
}
+ // Merge buildFlags from build config and CLI arguments into
+ // single array ensuring that ones from CLI take a precedence
+ config.buildFlags = [].concat(buildConfig.buildFlag || [], args.buildFlag || []);
+
// CLI arguments override build.json config
if (args.packageCertificateKeyFile) {
args.packageCertificateKeyFile = path.resolve(process.cwd(), args.packageCertificateKeyFile);
@@ -260,6 +265,10 @@
result.publisherId = windowsInfo.publisherId;
}
+ if (windowsInfo.buildFlag) {
+ result.buildFlag = windowsInfo.buildFlag;
+ }
+
return result;
}
@@ -288,7 +297,7 @@
if (!msbuild) {
return Q.reject(new CordovaError('No valid MSBuild was detected for the selected target.'));
}
- events.emit('vebose', 'Using MSBuild v' + msbuild.version + ' from ' + msbuild.path);
+ events.emit('verbose', 'Using MSBuild v' + msbuild.version + ' from ' + msbuild.path);
var myBuildTargets = filterSupportedTargets(selectedBuildTargets, msbuild);
var buildConfigs = [];
@@ -326,13 +335,25 @@
build.arch = 'anycpu';
}
- var otherProperties = { };
- // Only add the CordovaBundlePlatforms argument when on the last build step
- if (shouldBundle && index === configsArray.length - 1) {
- otherProperties.CordovaBundlePlatforms = bundleTerms;
- } else if (shouldBundle) {
- otherProperties.CordovaBundlePlatforms = build.arch;
+ // Send build flags to MSBuild
+ var otherProperties = [].concat(config.buildFlags);
+
+ if (shouldBundle) {
+ // Only add the CordovaBundlePlatforms argument when on the last build step
+ var bundleArchs = (index === configsArray.length - 1) ? bundleTerms : build.arch;
+ otherProperties.push('/p:CordovaBundlePlatforms=' + bundleArchs);
+ } else {
+ // https://issues.apache.org/jira/browse/CB-12416
+ // MSBuild uses AppxBundle=Always by default which leads to a bundle created even if
+ // --bundle was not passed - override that:
+ otherProperties.push('/p:AppxBundle=Never');
}
+
+ // https://issues.apache.org/jira/browse/CB-12298
+ if (config.targetProject === 'windows10' && config.buildType === 'release') {
+ otherProperties.push('/p:UapAppxPackageBuildMode=StoreUpload');
+ }
+
return msbuild.buildProject(path.join(ROOT, build.target), config.buildType, build.arch, otherProperties);
});
}, Q());
diff --git a/template/cordova/lib/prepare.js b/template/cordova/lib/prepare.js
index 53838d5..da6c846 100644
--- a/template/cordova/lib/prepare.js
+++ b/template/cordova/lib/prepare.js
@@ -48,6 +48,14 @@
'<!--\n This file is automatically generated.\n' +
' Do not modify this file - YOUR CHANGES WILL BE ERASED!\n-->\n';
+var SUPPORTED_IMAGE_EXTENSIONS = ['.png', '.jpg', '.jpeg'];
+var SPLASH_SCREEN_SIZE_LIMIT = 200 * 1024; // 200 KBytes
+var TARGET_PROJECT_81 = 'TARGET_PROJECT_81',
+ TARGET_PROJECT_WP81 = 'TARGET_PROJECT_WP81',
+ TARGET_PROJECT_10 = 'TARGET_PROJECT_10';
+var SPLASH_SCREEN_DESKTOP_TARGET_NAME = 'SplashScreen';
+var SPLASH_SCREEN_PHONE_TARGET_NAME = 'SplashScreenPhone';
+
/** Note: this is only for backward compatibility, since it is being called directly from windows_parser */
module.exports.applyPlatformConfig = function() {
var projectRoot = path.join(__dirname, '../..');
@@ -131,6 +139,7 @@
// Apply background color, splashscreen background color, etc.
manifest.getVisualElements()
.trySetBackgroundColor(config.getPreference('BackgroundColor'))
+ .setForegroundText(config.getPreference('ForegroundText'))
.setSplashBackgroundColor(config.getPreference('SplashScreenBackgroundColor'))
.setToastCapable(config.getPreference('WindowsToastCapable'))
.setOrientation(config.getPreference('Orientation'));
@@ -296,48 +305,83 @@
manifest.getApplication().setAccessRules(whitelistRules);
}
-function mapImageResources(images, imagesDir) {
- var pathMap = {};
+// Platform default images
+var PLATFORM_IMAGES = [
+ {dest: 'Square150x150Logo.scale-100', width: 150, height: 150},
+ {dest: 'Square30x30Logo.scale-100', width: 30, height: 30},
+ {dest: 'StoreLogo.scale-100', width: 50, height: 50},
+ {dest: 'SplashScreen.scale-100', width: 620, height: 300, targetProject: TARGET_PROJECT_10},
+ {dest: 'SplashScreen.scale-125', width: 775, height: 375, targetProject: TARGET_PROJECT_10},
+ {dest: 'SplashScreen.scale-140', width: 868, height: 420, targetProject: TARGET_PROJECT_81},
+ {dest: 'SplashScreen.scale-150', width: 930, height: 450, targetProject: TARGET_PROJECT_10},
+ {dest: 'SplashScreen.scale-180', width: 1116, height: 540, targetProject: TARGET_PROJECT_81},
+ {dest: 'SplashScreen.scale-200', width: 1240, height: 600, targetProject: TARGET_PROJECT_10},
+ {dest: 'SplashScreen.scale-400', width: 2480, height: 1200, targetProject: TARGET_PROJECT_10},
+ // scaled images are specified here for backward compatibility only so we can find them by size
+ {dest: 'StoreLogo.scale-240', width: 120, height: 120},
+ {dest: 'Square44x44Logo.scale-100', width: 44, height: 44},
+ {dest: 'Square44x44Logo.scale-240', width: 106, height: 106},
+ {dest: 'Square70x70Logo.scale-100', width: 70, height: 70},
+ {dest: 'Square71x71Logo.scale-100', width: 71, height: 71},
+ {dest: 'Square71x71Logo.scale-240', width: 170, height: 170},
+ {dest: 'Square150x150Logo.scale-240', width: 360, height: 360},
+ {dest: 'Square310x310Logo.scale-100', width: 310, height: 310},
+ {dest: 'Wide310x150Logo.scale-100', width: 310, height: 150},
+ {dest: 'Wide310x150Logo.scale-240', width: 744, height: 360},
+ {dest: 'SplashScreenPhone.scale-100', width: 480, height: 800, targetProject: TARGET_PROJECT_WP81},
+ {dest: 'SplashScreenPhone.scale-140', width: 672, height: 1120, targetProject: TARGET_PROJECT_WP81},
+ {dest: 'SplashScreenPhone.scale-240', width: 1152, height: 1920, targetProject: TARGET_PROJECT_WP81}
+];
- // Platform default images
- var platformImages = [
- {dest: 'Square150x150Logo.scale-100.png', width: 150, height: 150},
- {dest: 'Square30x30Logo.scale-100.png', width: 30, height: 30},
- {dest: 'StoreLogo.scale-100.png', width: 50, height: 50},
- {dest: 'SplashScreen.scale-100.png', width: 620, height: 300},
- // scaled images are specified here for backward compatibility only so we can find them by size
- {dest: 'StoreLogo.scale-240.png', width: 120, height: 120},
- {dest: 'Square44x44Logo.scale-100.png', width: 44, height: 44},
- {dest: 'Square44x44Logo.scale-240.png', width: 106, height: 106},
- {dest: 'Square70x70Logo.scale-100.png', width: 70, height: 70},
- {dest: 'Square71x71Logo.scale-100.png', width: 71, height: 71},
- {dest: 'Square71x71Logo.scale-240.png', width: 170, height: 170},
- {dest: 'Square150x150Logo.scale-240.png', width: 360, height: 360},
- {dest: 'Square310x310Logo.scale-100.png', width: 310, height: 310},
- {dest: 'Wide310x150Logo.scale-100.png', width: 310, height: 150},
- {dest: 'Wide310x150Logo.scale-240.png', width: 744, height: 360},
- {dest: 'SplashScreenPhone.scale-240.png', width: 1152, height: 1920}
- ];
-
- function findPlatformImage(width, height) {
- if (!width && !height){
- // this could be default image,
- // Windows requires specific image dimension so we can't apply it
- return null;
- }
- for (var idx in platformImages){
- var res = platformImages[idx];
- // If only one of width or height is not specified, use another parameter for comparation
- // If both specified, compare both.
- if ((!width || (width == res.width)) &&
- (!height || (height == res.height))){
- return res;
- }
- }
+function findPlatformImage(width, height) {
+ if (!width && !height){
+ // this could be default image,
+ // Windows requires specific image dimension so we can't apply it
return null;
}
+ for (var idx in PLATFORM_IMAGES){
+ var res = PLATFORM_IMAGES[idx];
+ // If only one of width or height is not specified, use another parameter for comparation
+ // If both specified, compare both.
+ if ((!width || (width == res.width)) &&
+ (!height || (height == res.height))){
+ return res;
+ }
+ }
+ return null;
+}
+
+/** Maps MRT splashscreen image to its target project defined in PLATFORM_IMAGES -> 8.1|WP8.1|10
+ * This assumes we have different scales used for 8.1 and 10 projects.
+ * The only intersection is scale-100, which is treated as Win10 project' splashscreen (because
+ * size limit applies to Win10 project so we'll need to check it).
+ * @param {MRTImage} mrtImage
+ * @return {String} targetProject defined in PLATFORM_IMAGES
+ */
+function mrtSplashScreenToTargetProject(mrtImage) {
+ // Gives something like -> splashscreen.scale-100
+ var splashDestToFind = [mrtImage.basename, mrtImage.qualifiers].join('.').toLowerCase();
+ var matchingSplashScreen = PLATFORM_IMAGES.filter(function (img) {
+ return img.dest.toLowerCase() === splashDestToFind;
+ })[0];
+
+ return matchingSplashScreen && matchingSplashScreen.targetProject;
+}
+
+function mapImageResources(images, imagesDir) {
+ function exceedsSizeLimit(filePath) {
+ return fs.statSync(filePath).size > SPLASH_SCREEN_SIZE_LIMIT;
+ }
+
+ var pathMap = {};
images.forEach(function (img) {
+ var ext = path.extname(img.src).toLowerCase();
+ if (SUPPORTED_IMAGE_EXTENSIONS.indexOf(ext) === -1) {
+ events.emit('warn', '"' + ext + '" extension is not supported, skipping. Supported image extensions are ' + JSON.stringify(SUPPORTED_IMAGE_EXTENSIONS));
+ return;
+ }
+
if (img.target) {
// Parse source path into new MRTImage
var imageToCopy = new MRTImage(img.src);
@@ -352,6 +396,13 @@
events.emit('warn', 'No images found for target: ' + img.target);
} else {
candidates.forEach(function(mrtImage) {
+ if (img.target === SPLASH_SCREEN_DESKTOP_TARGET_NAME &&
+ mrtSplashScreenToTargetProject(mrtImage) === TARGET_PROJECT_10 &&
+ exceedsSizeLimit(mrtImage.path)) {
+ events.emit('warn', '"' + mrtImage.path + '" file size exceeds the limit of ' + SPLASH_SCREEN_SIZE_LIMIT + ' bytes, skipping.');
+ return;
+ }
+
// copy images with new base name but keeping qualifier
var targetPath = path.join(imagesDir, mrtImage.generateFilenameFrom(img.target));
pathMap[targetPath] = mrtImage.path;
@@ -361,7 +412,13 @@
// find target image by size
var targetImg = findPlatformImage(img.width, img.height);
if (targetImg) {
- var targetPath = path.join(imagesDir, targetImg.dest);
+ if (targetImg.targetProject === TARGET_PROJECT_10 &&
+ exceedsSizeLimit(img.src)) {
+ events.emit('warn', '"' + img.src + '" file size exceeds the limit of ' + SPLASH_SCREEN_SIZE_LIMIT + ' bytes, skipping.');
+ return;
+ }
+
+ var targetPath = path.join(imagesDir, targetImg.dest) + ext;
pathMap[targetPath] = img.src;
} else {
events.emit('warn', 'The following image was skipped because it has an unsupported size (' + img.width + 'x' + img.height + '): ' + img.src);
@@ -438,6 +495,104 @@
};
}
+/**
+ * @param {Object} splash
+ * @returns {String} 'SplashScreen'|'SplashScreenPhone'
+ */
+function getTargetForImage(splash) {
+ if (splash.target) {
+ // MRT syntax:
+ return splash.target;
+ }
+
+ // Fall back on find by size for old non-MRT syntax:
+ var targetImg = findPlatformImage(splash.width, splash.height);
+ if (!targetImg.targetProject) {
+ return;
+ }
+
+ if (targetImg.targetProject === TARGET_PROJECT_81 || targetImg.targetProject === TARGET_PROJECT_10) {
+ return SPLASH_SCREEN_DESKTOP_TARGET_NAME;
+ }
+
+ if (targetImg.targetProject === TARGET_PROJECT_WP81) {
+ return SPLASH_SCREEN_PHONE_TARGET_NAME;
+ }
+}
+
+// Updates manifests to match the app splash screen image types (PNG/JPG/JPEG)
+function updateSplashScreenImageExtensions(cordovaProject, locations) {
+
+ // Saving all extensions used for targets to verify them later
+ var extensionsUsed = {};
+
+ function checkThatExtensionsAreNotMixed() {
+ for (var target in extensionsUsed) {
+ /*jshint loopfunc: true */
+ if (extensionsUsed.hasOwnProperty(target)) {
+ var extensionsUsedForTarget = extensionsUsed[target];
+
+ // Check that extensions are not mixed:
+ if (extensionsUsedForTarget.length > 1 && extensionsUsedForTarget.some(function(item) {
+ return item !== extensionsUsedForTarget[0];
+ })) {
+ events.emit('warn', '"' + target + '" splash screens have mixed file extensions which is not supported. Some of the images will not be used.');
+ }
+ }
+ }
+ }
+
+ function checkTargetMatchAndUpdateUsedExtensions(img, target) {
+ var matchesTarget = getTargetForImage(img) === target;
+
+ if (matchesTarget === true) {
+ extensionsUsed[target] = extensionsUsed[target] || [];
+ extensionsUsed[target].push(path.extname(img.src.toLowerCase()));
+ }
+
+ return matchesTarget;
+ }
+
+ function updateSplashExtensionInManifest(manifestFileName, splashScreen) {
+ var manifest = AppxManifest.get(path.join(locations.root, manifestFileName));
+ var newExtension = path.extname(splashScreen.src);
+
+ if (manifest.getVisualElements().getSplashScreenExtension() !== newExtension) {
+ events.emit('verbose', 'Set ' + manifestFileName + ' SplashScreen image extension to "' + newExtension + '"');
+ manifest.getVisualElements().setSplashScreenExtension(newExtension);
+ manifest.write();
+ }
+ }
+
+ var splashScreens = cordovaProject.projectConfig.getSplashScreens('windows');
+
+ var desktopSplashScreen = splashScreens.filter(function(img) {
+ return checkTargetMatchAndUpdateUsedExtensions(img, SPLASH_SCREEN_DESKTOP_TARGET_NAME);
+ })[0];
+
+ var phoneSplashScreen = splashScreens.filter(function(img) {
+ return checkTargetMatchAndUpdateUsedExtensions(img, SPLASH_SCREEN_PHONE_TARGET_NAME);
+ })[0];
+
+ checkThatExtensionsAreNotMixed();
+
+ var manifestSplashScreenMap = {};
+ manifestSplashScreenMap[MANIFEST_WINDOWS] = desktopSplashScreen;
+ manifestSplashScreenMap[MANIFEST_WINDOWS10] = desktopSplashScreen;
+ manifestSplashScreenMap[MANIFEST_PHONE] = phoneSplashScreen;
+
+ for (var manifest in manifestSplashScreenMap) {
+ if (manifestSplashScreenMap.hasOwnProperty(manifest)) {
+ var splashScreen = manifestSplashScreenMap[manifest];
+ if (!splashScreen) {
+ return;
+ }
+
+ updateSplashExtensionInManifest(manifest, splashScreen);
+ }
+ }
+}
+
module.exports.prepare = function (cordovaProject, options) {
var self = this;
@@ -458,6 +613,11 @@
})
.then(function () {
copyImages(cordovaProject, self.locations);
+
+ // Update SplashScreen image extensions in the manifests
+ // TODO: Do this only when config.xml changes
+ updateSplashScreenImageExtensions(cordovaProject, self.locations);
+
// CB-5421 Add BOM to all html, js, css files
// to ensure app can pass Windows Store Certification
addBOMSignature(self.locations.www);
diff --git a/template/cordova/prebuild-10.js b/template/cordova/prebuild-10.js
new file mode 100644
index 0000000..c3183ff
--- /dev/null
+++ b/template/cordova/prebuild-10.js
@@ -0,0 +1,20 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+var patch = require('./prebuild');
+patch('10');
diff --git a/template/cordova/prebuild-81.js b/template/cordova/prebuild-81.js
new file mode 100644
index 0000000..c37284b
--- /dev/null
+++ b/template/cordova/prebuild-81.js
@@ -0,0 +1,20 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+var patch = require('./prebuild');
+patch('8.1');
diff --git a/template/cordova/prebuild-phone-81.js b/template/cordova/prebuild-phone-81.js
new file mode 100644
index 0000000..d3f7fa8
--- /dev/null
+++ b/template/cordova/prebuild-phone-81.js
@@ -0,0 +1,20 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+var patch = require('./prebuild');
+patch('phone-8.1');
diff --git a/template/cordova/prebuild.js b/template/cordova/prebuild.js
new file mode 100644
index 0000000..a7526db
--- /dev/null
+++ b/template/cordova/prebuild.js
@@ -0,0 +1,87 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+// https://issues.apache.org/jira/browse/CB-11658 activated event is not fired on Windows 10 RS1
+// Patching start page to include WinJS/base.js reference to HTML as a workaround
+
+module.exports = function patch(platform) {
+ console.log('Patching ' + platform + ' in prebuild event...');
+
+ var shell = require('shelljs');
+ var path = require('path');
+ var url = require('url');
+
+ var basejsSrcMap = {
+ '10': '/www/WinJS/js/base.js',
+ '8.1': '//Microsoft.WinJS.2.0/js/base.js',
+ 'phone-8.1': '//Microsoft.Phone.WinJS.2.1/js/base.js'
+ };
+ var escapedBasejsSrcMap = {
+ '10': '\/www\/WinJS\/js\/base\.js',
+ '8.1': '\/\/Microsoft\.WinJS\.2\.0\/js\/base\.js',
+ 'phone-8.1': '\/\/Microsoft\.Phone\.WinJS\.2\.1\/js\/base\.js'
+ };
+ var basejsSrc = basejsSrcMap[platform];
+
+ var appxmanifestMap = {
+ '10': 'package.windows10.appxmanifest',
+ '8.1': 'package.windows.appxmanifest',
+ 'phone-8.1': 'package.phone.appxmanifest'
+ };
+
+ // 1. Find start page path in appxmanifest
+ var AppxManifest = require('./lib/AppxManifest');
+ var appxmanifest = AppxManifest.get(path.join(__dirname, '..', appxmanifestMap[platform]));
+ var startPage = url.parse(appxmanifest.getApplication().getStartPage());
+
+ if (startPage.protocol && startPage.protocol.indexOf('http') === 0) {
+ console.warn('Warning: Can\'t modify external content.src. You should update your server-side pages to reference WinJS directly in HTML.');
+ return;
+ }
+
+ // Discard scheme and identity name (host)
+ startPage = startPage.pathname;
+
+ // 2. Check if start page HTML contains base.js reference
+ var startPageFilePath = shell.ls(path.join(__dirname, '..', startPage))[0];
+ var reBaseJs = new RegExp(escapedBasejsSrcMap[platform], 'i');
+
+ if (!startPageFilePath) {
+ console.warn('Warning: Start page is missing on the disk. The build must go on but note that this will cause WACK failures.');
+ return;
+ }
+
+ if (shell.grep(reBaseJs, startPageFilePath).length === 0) {
+ // 3. If it doesn't - patch page to include base.js ref before cordova.js
+ var appendBaseJsRe = /( *)(<script\s+(?:type="text\/javascript"\s+)?src="(.*\/)?cordova\.js">\s*<\/script>)/;
+ var subst = '$1<script type="text/javascript" src="' + basejsSrc + '"></script>\n$1$2';
+
+ shell.sed('-i', appendBaseJsRe, subst, startPageFilePath);
+ console.log('Injected base.js reference to the ' + startPage);
+
+ // 4. Remove all 'wrong' base.js references, which might left from another project type build:
+ for (var plat in basejsSrcMap) {
+ if (plat !== platform) {
+ var wrongBaseJsRe = new RegExp('( *)(<script\\s+(?:type="text\\/javascript"\\s+)?src="' + escapedBasejsSrcMap[plat] + '">\\s*<\\/script>)(\\s*)');
+ console.log('Removing ' + wrongBaseJsRe + ' from ' + startPage);
+ shell.sed('-i', wrongBaseJsRe, '$1', startPageFilePath);
+ }
+ }
+ }
+};
diff --git a/template/cordova/version b/template/cordova/version
index c2746d0..0bc326f 100644
--- a/template/cordova/version
+++ b/template/cordova/version
@@ -20,7 +20,7 @@
*/
// Coho updates this line:
-var VERSION = "4.5.0-dev";
+var VERSION = "5.1.0-dev";
module.exports.version = VERSION;
diff --git a/template/package.windows10.appxmanifest b/template/package.windows10.appxmanifest
index e59e019..9df82fa 100644
--- a/template/package.windows10.appxmanifest
+++ b/template/package.windows10.appxmanifest
@@ -46,7 +46,7 @@
<Applications>
<Application
- Id="$safeprojectname$"
+ Id="App"
StartPage="www/index.html">
<uap:VisualElements
@@ -57,9 +57,9 @@
Square44x44Logo="images\Square44x44Logo.png">
<uap:SplashScreen Image="images\splashscreen.png" />
- <uap:DefaultTile ShortName="$projectname$"
+ <uap:DefaultTile ShortName="$projectname$"
Square310x310Logo="images\Square310x310Logo.png"
- Square71x71Logo="images\Square71x71Logo.png"
+ Square71x71Logo="images\Square71x71Logo.png"
Wide310x150Logo="images\Wide310x150Logo.png" />
</uap:VisualElements>
diff --git a/template/www/cordova.js b/template/www/cordova.js
index 05fcb83..222e9d8 100644
--- a/template/www/cordova.js
+++ b/template/www/cordova.js
@@ -1,5 +1,5 @@
// Platform: windows
-// d403ce434788ffe1937711d6ebcbcc837fcbcb14
+// 7c5fcc5a5adfbf3fb8ceaf36fbdd4bd970bd9c20
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -19,7 +19,7 @@
under the License.
*/
;(function() {
-var PLATFORM_VERSION_BUILD_LABEL = '4.5.0-dev';
+var PLATFORM_VERSION_BUILD_LABEL = '5.1.0-dev';
// file: src/scripts/require.js
/*jshint -W079 */
@@ -697,8 +697,13 @@
}
};
-function forceFunction(f) {
- if (typeof f != 'function') throw "Function required as first argument!";
+function checkSubscriptionArgument(argument) {
+ if (typeof argument !== "function" && typeof argument.handleEvent !== "function") {
+ throw new Error(
+ "Must provide a function or an EventListener object " +
+ "implementing the handleEvent interface."
+ );
+ }
}
/**
@@ -708,28 +713,39 @@
* and a guid that can be used to stop subscribing to the channel.
* Returns the guid.
*/
-Channel.prototype.subscribe = function(f, c) {
- // need a function to call
- forceFunction(f);
+Channel.prototype.subscribe = function(eventListenerOrFunction, eventListener) {
+ checkSubscriptionArgument(eventListenerOrFunction);
+ var handleEvent, guid;
+
+ if (eventListenerOrFunction && typeof eventListenerOrFunction === "object") {
+ // Received an EventListener object implementing the handleEvent interface
+ handleEvent = eventListenerOrFunction.handleEvent;
+ eventListener = eventListenerOrFunction;
+ } else {
+ // Received a function to handle event
+ handleEvent = eventListenerOrFunction;
+ }
+
if (this.state == 2) {
- f.apply(c || this, this.fireArgs);
+ handleEvent.apply(eventListener || this, this.fireArgs);
return;
}
- var func = f,
- guid = f.observer_guid;
- if (typeof c == "object") { func = utils.close(c, f); }
+ guid = eventListenerOrFunction.observer_guid;
+ if (typeof eventListener === "object") {
+ handleEvent = utils.close(eventListener, handleEvent);
+ }
if (!guid) {
- // first time any channel has seen this subscriber
+ // First time any channel has seen this subscriber
guid = '' + nextGuid++;
}
- func.observer_guid = guid;
- f.observer_guid = guid;
+ handleEvent.observer_guid = guid;
+ eventListenerOrFunction.observer_guid = guid;
// Don't add the same handler more than once.
if (!this.handlers[guid]) {
- this.handlers[guid] = func;
+ this.handlers[guid] = handleEvent;
this.numHandlers++;
if (this.numHandlers == 1) {
this.onHasSubscribersChange && this.onHasSubscribersChange();
@@ -740,12 +756,20 @@
/**
* Unsubscribes the function with the given guid from the channel.
*/
-Channel.prototype.unsubscribe = function(f) {
- // need a function to unsubscribe
- forceFunction(f);
+Channel.prototype.unsubscribe = function(eventListenerOrFunction) {
+ checkSubscriptionArgument(eventListenerOrFunction);
+ var handleEvent, guid, handler;
- var guid = f.observer_guid,
- handler = this.handlers[guid];
+ if (eventListenerOrFunction && typeof eventListenerOrFunction === "object") {
+ // Received an EventListener object implementing the handleEvent interface
+ handleEvent = eventListenerOrFunction.handleEvent;
+ } else {
+ // Received a function to handle event
+ handleEvent = eventListenerOrFunction;
+ }
+
+ guid = handleEvent.observer_guid;
+ handler = this.handlers[guid];
if (handler) {
delete this.handlers[guid];
this.numHandlers--;
@@ -817,29 +841,50 @@
});
-// file: D:/cordova/cordova-windows/cordova-js-src/confighelper.js
+// file: f:/coho/cordova-windows/cordova-js-src/confighelper.js
define("cordova/confighelper", function(require, exports, module) {
-// config.xml wrapper (non-node ConfigParser analogue)
-var config;
-function Config(xhr) {
- function loadPreferences(xhr) {
- var parser = new DOMParser();
- var doc = parser.parseFromString(xhr.responseText, "application/xml");
+// config.xml and AppxManifest.xml wrapper (non-node ConfigParser analogue)
+var configCache = {};
+var utils = require("cordova/utils");
- var preferences = doc.getElementsByTagName("preference");
- return Array.prototype.slice.call(preferences);
- }
+var isPhone = (cordova.platformId == 'windows') && WinJS.Utilities.isPhone;
+var isWin10UWP = navigator.appVersion.indexOf('MSAppHost/3.0') !== -1;
+var splashScreenTagName = isWin10UWP ? "SplashScreen" : (isPhone ? "m3:SplashScreen" : "m2:SplashScreen");
- this.xhr = xhr;
- this.preferences = loadPreferences(this.xhr);
+function XmlFile(text) {
+ this.text = text;
}
-function readConfig(success, error) {
+XmlFile.prototype.loadTags = function (tagName) {
+ var parser;
+ if (!this.doc) {
+ parser = new DOMParser();
+ this.doc = parser.parseFromString(this.text, "application/xml");
+ }
+
+ var tags = this.doc.getElementsByTagName(tagName);
+ return Array.prototype.slice.call(tags);
+}
+
+function Config(text) {
+ XmlFile.apply(this, arguments);
+ this.preferences = this.loadTags("preference");
+}
+
+function Manifest(text) {
+ XmlFile.apply(this, arguments);
+ this.splashScreen = this.loadTags(splashScreenTagName)[0];
+}
+
+utils.extend(Config, XmlFile);
+utils.extend(Manifest, XmlFile);
+
+function requestFile(filePath, success, error) {
var xhr;
- if (typeof config != 'undefined') {
- success(config);
+ if (typeof configCache[filePath] != 'undefined') {
+ success(configCache[filePath]);
}
function fail(msg) {
@@ -853,11 +898,11 @@
var xhrStatusChangeHandler = function () {
if (xhr.readyState == 4) {
if (xhr.status == 200 || xhr.status == 304 || xhr.status == 0 /* file:// */) {
- config = new Config(xhr);
- success(config);
+ configCache[filePath] = xhr.responseText;
+ success(xhr.responseText);
}
else {
- fail('[Windows][cordova.js][xhrStatusChangeHandler] Could not XHR config.xml: ' + xhr.statusText);
+ fail('[Windows][cordova.js][xhrStatusChangeHandler] Could not XHR ' + filePath + ': ' + xhr.statusText);
}
}
};
@@ -866,18 +911,30 @@
xhr.addEventListener("load", xhrStatusChangeHandler);
try {
- xhr.open("get", "/config.xml", true);
+ xhr.open("get", filePath, true);
xhr.send();
} catch (e) {
- fail('[Windows][cordova.js][readConfig] Could not XHR config.xml: ' + JSON.stringify(e));
+ fail('[Windows][cordova.js][xhrFile] Could not XHR ' + filePath + ': ' + JSON.stringify(e));
}
}
+function readConfig(success, error) {
+ requestFile("/config.xml", function (contents) {
+ success(new Config(contents));
+ }, error);
+}
+
+function readManifest(success, error) {
+ requestFile("/AppxManifest.xml", function (contents) {
+ success(new Manifest(contents));
+ }, error);
+}
+
/**
* Reads a preference value from config.xml.
* Returns preference value or undefined if it does not exist.
* @param {String} preferenceName Preference name to read */
-Config.prototype.getPreferenceValue = function getPreferenceValue(preferenceName) {
+Config.prototype.getPreferenceValue = function (preferenceName) {
var preferenceItem = this.preferences && this.preferences.filter(function (item) {
return item.attributes['name'].value === preferenceName;
});
@@ -887,11 +944,19 @@
}
}
+/**
+ * Reads SplashScreen image path
+ */
+Manifest.prototype.getSplashScreenImagePath = function () {
+ return this.splashScreen.attributes['Image'].value;
+}
+
exports.readConfig = readConfig;
+exports.readManifest = readManifest;
});
-// file: D:/cordova/cordova-windows/cordova-js-src/exec.js
+// file: f:/coho/cordova-windows/cordova-js-src/exec.js
define("cordova/exec", function(require, exports, module) {
/*jslint sloppy:true, plusplus:true*/
@@ -1482,7 +1547,7 @@
});
-// file: D:/cordova/cordova-windows/cordova-js-src/platform.js
+// file: f:/coho/cordova-windows/cordova-js-src/platform.js
define("cordova/platform", function(require, exports, module) {
module.exports = {
@@ -1493,7 +1558,6 @@
channel = cordova.require('cordova/channel'),
platform = require('cordova/platform'),
modulemapper = require('cordova/modulemapper'),
- configHelper = require('cordova/confighelper'),
utils = require('cordova/utils');
modulemapper.clobbers('cordova/exec/proxy', 'cordova.commandProxy');
@@ -1507,7 +1571,8 @@
var onWinJSReady = function () {
var app = WinJS.Application,
- splashscreen = require('cordova/splashscreen');
+ splashscreen = require('cordova/splashscreen'),
+ configHelper = require('cordova/confighelper');
modulemapper.clobbers('cordova/splashscreen', 'navigator.splashscreen');
@@ -1544,8 +1609,14 @@
return;
}
- e.setPromise(makePromise(configHelper.readConfig).then(function (config) {
- splashscreen.firstShow(config, e);
+ var manifest;
+
+ e.setPromise(makePromise(configHelper.readManifest).then(function (manifestTmp) {
+ manifest = manifestTmp;
+ return makePromise(configHelper.readConfig);
+ })
+ .then(function (config) {
+ splashscreen.firstShow(config, manifest, e);
}).then(function () {
// Avoids splashimage flicker on Windows Phone 8.1/10
return WinJS.Promise.timeout();
@@ -1554,13 +1625,22 @@
}));
};
- app.addEventListener("checkpoint", checkpointHandler);
- app.addEventListener("activated", activationHandler, false);
- Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", resumingHandler, false);
+ // CB-12193 CoreWindow and some WinRT APIs are not available in webview
+ var isCoreWindowAvailable = false;
+ try {
+ Windows.UI.ViewManagement.ApplicationView.getForCurrentView();
+ isCoreWindowAvailable = true;
+ } catch (e) { }
- injectBackButtonHandler();
+ if (isCoreWindowAvailable) {
+ app.addEventListener("checkpoint", checkpointHandler);
+ app.addEventListener("activated", activationHandler, false);
+ Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", resumingHandler, false);
- app.start();
+ injectBackButtonHandler();
+
+ app.start();
+ }
};
function appendScript(scriptElem, loadedCb) {
@@ -1801,18 +1881,24 @@
});
-// file: D:/cordova/cordova-windows/cordova-js-src/splashscreen.js
+// file: f:/coho/cordova-windows/cordova-js-src/splashscreen.js
define("cordova/splashscreen", function(require, exports, module) {
-var isPhone = (cordova.platformId == 'windows') && WinJS.Utilities.isPhone;
var isWp81 = navigator.appVersion.indexOf("Windows Phone 8.1") !== -1;
var isWp10 = navigator.appVersion.indexOf("Windows Phone 10") !== -1;
+var isPhoneDevice = isWp81 || isWp10;
var isWin10UWP = navigator.appVersion.indexOf('MSAppHost/3.0') !== -1;
var isHosted = window.location.protocol.indexOf('http') === 0;
-var splashImageSrc = ((isHosted || isWin10UWP) ? 'ms-appx-web' : 'ms-appx') + ':///images/'
- + (isPhone ? 'splashscreenphone.png' : 'splashscreen.png');
+var isMsAppxWeb = window.location.protocol.indexOf('ms-appx-web') === 0;
-var splashElement = null, extendedSplashImage = null, extendedSplashProgress = null;
+var schema = (isHosted || isWin10UWP && isMsAppxWeb) ? 'ms-appx-web' : 'ms-appx';
+var fileName = isWp81 ? 'splashscreenphone.png' : 'splashscreen.png';
+var splashImageSrc = schema + ':///images/' + fileName;
+
+var splashElement = null,
+ extendedSplashImage = null,
+ extendedSplashProgress = null,
+ extendedSplashImageHelper = null;
//// <Config and initialization>
var DEFAULT_SPLASHSCREEN_DURATION = 3000, // in milliseconds
@@ -1822,6 +1908,8 @@
PROGRESSRING_BOTTOM_MARGIN = 10; // needed for windows 10 min height window
var bgColor = "#464646",
+ titleInitialBgColor,
+ titleBgColor,
autoHideSplashScreen = true,
splashScreenDelay = DEFAULT_SPLASHSCREEN_DURATION,
fadeSplashScreen = true,
@@ -1840,8 +1928,11 @@
}
}
-function readPreferencesFromCfg(cfg) {
+function readPreferencesFromCfg(cfg, manifest) {
try {
+ // Update splashscreen image path to match application manifest
+ splashImageSrc = schema + ':///' + manifest.getSplashScreenImagePath().replace(/\\/g, '/');
+
bgColor = cfg.getPreferenceValue('SplashScreenBackgroundColor') || bgColor;
bgColor = bgColor.replace('0x', '#').replace('0X', '#');
if (bgColor.length > 7) {
@@ -1849,6 +1940,13 @@
bgColor = bgColor.slice(0, 1) + bgColor.slice(3, bgColor.length);
}
+ titleBgColor = {
+ a: 255,
+ r: parseInt(bgColor.slice(1, 3), 16),
+ g: parseInt(bgColor.slice(3, 5), 16),
+ b: parseInt(bgColor.slice(5, 7), 16)
+ };
+
autoHideSplashScreen = readBoolFromCfg('AutoHideSplashScreen', autoHideSplashScreen, cfg);
splashScreenDelay = cfg.getPreferenceValue('SplashScreenDelay') || splashScreenDelay;
@@ -1869,23 +1967,8 @@
return window.innerHeight > window.innerWidth;
}
-// Shift down the image to be vertical centered
-function centerY() {
- if (isPortrait()) {
- if (window.screen.deviceYDPI === 172) { // 720p 4.7"
- extendedSplashImage.style.transform = "translateY(22px)";
- } else if (window.screen.deviceYDPI === 230) { // 1080p 5.5"
- extendedSplashImage.style.transform = "translateY(25px)";
- } else if (window.screen.deviceYDPI === 211) { // 1080p 6"
- extendedSplashImage.style.transform = "translateY(27px)";
- }
- } else {
- extendedSplashImage.style.transform = "";
- }
-}
-
-function init(config) {
- readPreferencesFromCfg(config);
+function init(config, manifest) {
+ readPreferencesFromCfg(config, manifest);
var splashscreenStyles = document.createElement("link");
splashscreenStyles.rel = 'stylesheet';
@@ -1904,6 +1987,9 @@
splashElement.classList.add('hidden');
splashElement.style.backgroundColor = bgColor;
+ extendedSplashImageHelper = document.createElement('span');
+ extendedSplashImageHelper.id = 'extendedSplashImageHelper';
+
extendedSplashImage = document.createElement('img');
extendedSplashImage.id = 'extendedSplashImage';
extendedSplashImage.alt = 'Splash screen image';
@@ -1913,8 +1999,6 @@
draggableAttr.value = 'false';
extendedSplashImage.attributes.setNamedItem(draggableAttr);
- extendedSplashImage.style.left = '0px';
-
// This helps prevent flickering by making the system wait until your image has been rendered
// before it switches to your extended splash screen.
var onloadAttr = document.createAttribute('onload');
@@ -1927,29 +2011,18 @@
extendedSplashProgress.classList.add('win-medium');
extendedSplashProgress.classList.add('win-ring');
- if (isWp81 || isWp10) {
- extendedSplashImage.style.maxWidth = "100%";
- extendedSplashImage.style.maxHeight = "100%";
- extendedSplashImage.src = splashImageSrc;
- // center horizontally
- extendedSplashImage.style.margin = "0 auto";
- extendedSplashImage.style.display = "block";
- // center vertically
- extendedSplashImage.style.position = "relative";
- extendedSplashImage.style.top = "50%";
+ extendedSplashImage.src = splashImageSrc;
- // Workaround for intial splashimage jump
- if (isWp10) {
- extendedSplashImage.style.transform = "translateY(-50%)";
- } else {
- centerY();
- }
+ if (isPhoneDevice) {
+ extendedSplashImage.classList.add('phone');
}
if (isWp81) {
extendedSplashProgress.classList.add('extended-splash-progress-phone');
} else if (isWp10) {
extendedSplashProgress.classList.add('extended-splash-progress-wp10');
+ } else {
+ extendedSplashProgress.classList.add('extended-splash-progress-desktop');
}
if (!showSplashScreenSpinner) {
@@ -1959,6 +2032,7 @@
extendedSplashProgress.style.color = splashScreenSpinnerColor;
}
+ splashElement.appendChild(extendedSplashImageHelper);
splashElement.appendChild(extendedSplashImage);
splashElement.appendChild(extendedSplashProgress);
@@ -1982,14 +2056,53 @@
document.body.style['-ms-content-zooming'] = origZooming;
}
+// Enter fullscreen mode
+function enterFullScreen() {
+ if (Windows.UI.ViewManagement.ApplicationViewBoundsMode) { // else crash on 8.1
+ var view = Windows.UI.ViewManagement.ApplicationView.getForCurrentView();
+ view.setDesiredBoundsMode(Windows.UI.ViewManagement.ApplicationViewBoundsMode.useCoreWindow);
+ view.suppressSystemOverlays = true;
+ }
+}
+
+// Exit fullscreen mode
+function exitFullScreen() {
+ if (Windows.UI.ViewManagement.ApplicationViewBoundsMode) { // else crash on 8.1
+ var view = Windows.UI.ViewManagement.ApplicationView.getForCurrentView();
+ view.setDesiredBoundsMode(Windows.UI.ViewManagement.ApplicationViewBoundsMode.useVisible);
+ view.suppressSystemOverlays = false;
+ }
+}
+
+// Make title bg color match splashscreen bg color
+function colorizeTitleBar() {
+ var appView = Windows.UI.ViewManagement.ApplicationView.getForCurrentView();
+ if (appView.titleBar) {
+ titleInitialBgColor = appView.titleBar.backgroundColor;
+
+ appView.titleBar.backgroundColor = titleBgColor;
+ appView.titleBar.buttonBackgroundColor = titleBgColor;
+ }
+}
+
+// Revert title bg color
+function revertTitleBarColor() {
+ var appView = Windows.UI.ViewManagement.ApplicationView.getForCurrentView();
+ if (appView.titleBar) {
+ appView.titleBar.backgroundColor = titleInitialBgColor;
+ appView.titleBar.buttonBackgroundColor = titleInitialBgColor;
+ }
+}
+
// Displays the extended splash screen. Pass the splash screen object retrieved during activation.
function show() {
+ enterFullScreen();
+ colorizeTitleBar();
disableUserInteraction();
-
positionControls();
// Once the extended splash screen is setup, apply the CSS style that will make the extended splash screen visible.
- WinJS.Utilities.removeClass(extendedSplashScreen, 'hidden');
+ WinJS.Utilities.removeClass(splashElement, 'hidden');
}
function positionControls() {
@@ -2006,13 +2119,13 @@
}
// Position the extended splash screen image in the same location as the system splash screen image.
- if (isPhone) {
+ if (isPhoneDevice) {
extendedSplashImage.style.top = 0;
extendedSplashImage.style.left = 0;
- centerY();
} else {
- extendedSplashImage.style.top = splash.imageLocation.y + 'px';
+ // Avoiding subtle image shift on desktop
extendedSplashImage.style.left = splash.imageLocation.x + 'px';
+ extendedSplashImage.style.top = splash.imageLocation.y + 'px';
}
if (!isWp81) {
@@ -2032,7 +2145,7 @@
// Checks whether the extended splash screen is visible and returns a boolean.
function isVisible() {
- return !(WinJS.Utilities.hasClass(extendedSplashScreen, 'hidden'));
+ return !(WinJS.Utilities.hasClass(splashElement, 'hidden'));
}
function fadeOut(el, duration, finishCb) {
@@ -2052,13 +2165,25 @@
function hide() {
if (isVisible()) {
var hideFinishCb = function () {
- WinJS.Utilities.addClass(extendedSplashScreen, 'hidden');
- extendedSplashScreen.style.opacity = 1;
+ WinJS.Utilities.addClass(splashElement, 'hidden');
+ splashElement.style.opacity = 1;
enableUserInteraction();
+ exitFullScreen();
+ }
+
+ // Color reversion before fading is over looks better:
+ revertTitleBarColor();
+
+ // https://issues.apache.org/jira/browse/CB-11751
+ // This can occur when we directly replace whole document.body f.e. in a router.
+ // Note that you should disable the splashscreen in this case or update a container element instead.
+ if (document.getElementById(splashElement.id) == null) {
+ hideFinishCb();
+ return;
}
if (fadeSplashScreen) {
- fadeOut(extendedSplashScreen, fadeSplashScreenDuration, hideFinishCb);
+ fadeOut(splashElement, fadeSplashScreenDuration, hideFinishCb);
} else {
hideFinishCb();
}
@@ -2103,8 +2228,8 @@
//// </Events>
module.exports = {
- firstShow: function (config, activatedEventArgs) {
- init(config);
+ firstShow: function (config, manifest, activatedEventArgs) {
+ init(config, manifest);
activated(activatedEventArgs);
if (!isVisible() && (splashScreenDelay > 0 || !autoHideSplashScreen)) {
@@ -2234,7 +2359,10 @@
retVal = {};
for(i in obj){
- if((!(i in retVal) || retVal[i] != obj[i]) && typeof obj[i] != 'undefined') {
+ // https://issues.apache.org/jira/browse/CB-11522 'unknown' type may be returned in
+ // custom protocol activation case on Windows Phone 8.1 causing "No such interface supported" exception
+ // on cloning.
+ if((!(i in retVal) || retVal[i] != obj[i]) && typeof obj[i] != 'undefined' && typeof obj[i] != 'unknown') {
retVal[i] = utils.clone(obj[i]);
}
}
diff --git a/template/www/css/splashscreen.css b/template/www/css/splashscreen.css
index 46e347a..74dd681 100644
--- a/template/www/css/splashscreen.css
+++ b/template/www/css/splashscreen.css
@@ -35,8 +35,24 @@
display: none;
}
+#extendedSplashImageHelper {
+ vertical-align: middle;
+ display: inline-block;
+ height: 100%;
+}
+
#extendedSplashImage {
position: absolute;
+ left: 0px;
+ max-height: 100%;
+ max-width: 100%;
+ vertical-align: middle;
+}
+
+#extendedSplashImage.phone {
+ position: relative;
+ margin: 0 auto;
+ display: inline-block;
}
/* ProgressRing */
@@ -62,6 +78,7 @@
width: 100%;
top: calc(100% - 140px);
text-align: center;
+ display: block;
}
.win-ring.win-medium.extended-splash-progress-wp10 {
@@ -70,6 +87,13 @@
left: calc(50% - 20px);
}
+.win-ring.win-medium.extended-splash-progress-desktop {
+ position: absolute;
+ width: 100%;
+ top: 0px;
+ left: 0px;
+}
+
#extendedSplashProgress.hidden {
display: none;
}