You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ja...@apache.org on 2018/02/27 12:43:22 UTC
[cordova-windows] 04/26: remove 8.1 code
This is an automated email from the ASF dual-hosted git repository.
janpio pushed a commit to branch janpio-win10only
in repository https://gitbox.apache.org/repos/asf/cordova-windows.git
commit d36554a6a34d4997869436de1325024cb2eedafc
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Thu Feb 15 19:17:38 2018 +0100
remove 8.1 code
---
bin/lib/check_reqs.js | 18 +----------------
cordova-js-src/platform.js | 38 +++++++++++-------------------------
cordova-js-src/splashscreen.js | 5 ++---
template/cordova/lib/AppxManifest.js | 3 ---
template/cordova/lib/MSBuildTools.js | 8 +-------
template/cordova/lib/build.js | 12 ------------
template/cordova/lib/deployment.js | 9 ++-------
template/cordova/prebuild.js | 12 +++---------
8 files changed, 20 insertions(+), 85 deletions(-)
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index 5006f34..e388cf5 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -41,13 +41,6 @@ try {
// reference: https://msdn.microsoft.com/en-us/library/bb164659(v=vs.120).aspx
var VS2013_UPDATE2_RC = new Version(12, 0, 30324);
var REQUIRED_VERSIONS = {
- '8.1': {
- os: '6.3',
- msbuild: '12.0',
- visualstudio: '12.0',
- windowssdk: '8.1',
- phonesdk: '8.1'
- },
'10.0': {
// Note that Windows 10 target is also supported on Windows 7, so this should look
// like '6.1 || >=6.3', but due to Version module restricted functionality we handle
@@ -187,18 +180,9 @@ function getInstalledWindowsSdks () {
*/
function getInstalledPhoneSdks () {
var installedSdks = [];
- return spawn('reg', ['query', 'HKLM\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows Phone\\v8.1', '/v', 'InstallationFolder', '/reg:32'])
+ return spawn('reg', ['query', 'HKLM\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v10.0', '/v', 'InstallationFolder', '/reg:32'])
.fail(function () { return ''; })
.then(function (output) {
- var match = /\\Microsoft SDKs\\Windows Phone\\v(\d+\.\d+)\s*InstallationFolder\s+REG_SZ\s+(.*)/gim.exec(output);
- if (match && shell.test('-e', path.join(match[2], 'SDKManifest.xml'))) {
- installedSdks.push(Version.tryParse(match[1]));
- }
- }).then(function () {
- return spawn('reg', ['query', 'HKLM\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v10.0', '/v', 'InstallationFolder', '/reg:32']);
- }).fail(function () {
- return '';
- }).then(function (output) {
var match = /\\Microsoft SDKs\\Windows\\v(\d+\.\d+)\s*InstallationFolder\s+REG_SZ\s+(.*)/gim.exec(output);
if (match && shell.test('-e', path.join(match[2], 'SDKManifest.xml'))) {
installedSdks.push(Version.tryParse(match[1]));
diff --git a/cordova-js-src/platform.js b/cordova-js-src/platform.js
index 4bc4025..d920f64 100644
--- a/cordova-js-src/platform.js
+++ b/cordova-js-src/platform.js
@@ -119,17 +119,7 @@ module.exports = {
if (!window.WinJS) {
var scriptElem = document.createElement("script");
-
- if (navigator.appVersion.indexOf('MSAppHost/3.0') !== -1) {
- // Windows 10 UWP
- scriptElem.src = '/www/WinJS/js/base.js';
- } else if (navigator.appVersion.indexOf("Windows Phone 8.1;") !== -1) {
- // windows phone 8.1 + Mobile IE 11
- scriptElem.src = "//Microsoft.Phone.WinJS.2.1/js/base.js";
- } else if (navigator.appVersion.indexOf("MSAppHost/2.0;") !== -1) {
- // windows 8.1 + IE 11
- scriptElem.src = "//Microsoft.WinJS.2.0/js/base.js";
- }
+ scriptElem.src = '/www/WinJS/js/base.js';
scriptElem.addEventListener("load", onWinJSReady);
document.head.appendChild(scriptElem);
}
@@ -169,21 +159,15 @@ function injectBackButtonHandler() {
}
};
- // Only load this code if we're running on Win10 in a non-emulated app frame, otherwise crash \o/
- if (navigator.appVersion.indexOf('MSAppHost/3.0') !== -1) { // Windows 10 UWP (PC/Tablet/Phone)
- var navigationManager = Windows.UI.Core.SystemNavigationManager.getForCurrentView();
- // Inject a listener for the backbutton on the document.
- backButtonChannel.onHasSubscribersChange = function () {
- // If we just attached the first handler or detached the last handler,
- // let native know we need to override the back button.
- navigationManager.appViewBackButtonVisibility = (this.numHandlers > 0) ?
- Windows.UI.Core.AppViewBackButtonVisibility.visible :
- Windows.UI.Core.AppViewBackButtonVisibility.collapsed;
- };
+ var navigationManager = Windows.UI.Core.SystemNavigationManager.getForCurrentView();
+ // Inject a listener for the backbutton on the document.
+ backButtonChannel.onHasSubscribersChange = function () {
+ // If we just attached the first handler or detached the last handler,
+ // let native know we need to override the back button.
+ navigationManager.appViewBackButtonVisibility = (this.numHandlers > 0) ?
+ Windows.UI.Core.AppViewBackButtonVisibility.visible :
+ Windows.UI.Core.AppViewBackButtonVisibility.collapsed;
+ };
- navigationManager.addEventListener("backrequested", backRequestedHandler, false);
- } else { // Windows 8.1 Phone
- // inject new back button handler
- app.onbackclick = backRequestedHandler;
- }
+ navigationManager.addEventListener("backrequested", backRequestedHandler, false);
}
diff --git a/cordova-js-src/splashscreen.js b/cordova-js-src/splashscreen.js
index 97fd86c..7cddd35 100644
--- a/cordova-js-src/splashscreen.js
+++ b/cordova-js-src/splashscreen.js
@@ -19,15 +19,14 @@
*
*/
-var isWp81 = navigator.appVersion.indexOf("Windows Phone 8.1") !== -1;
var isWp10 = navigator.appVersion.indexOf("Windows Phone 10") !== -1;
-var isPhoneDevice = isWp81 || isWp10;
+var isPhoneDevice = isWp10;
var isWin10UWP = navigator.appVersion.indexOf('MSAppHost/3.0') !== -1;
var isHosted = window.location.protocol.indexOf('http') === 0;
var isMsAppxWeb = window.location.protocol.indexOf('ms-appx-web') === 0;
var schema = (isHosted || isWin10UWP && isMsAppxWeb) ? 'ms-appx-web' : 'ms-appx';
-var fileName = isWp81 ? 'splashscreenphone.png' : 'splashscreen.png';
+var fileName = 'splashscreen.png';
var splashImageSrc = schema + ':///images/' + fileName;
var splashElement = null,
diff --git a/template/cordova/lib/AppxManifest.js b/template/cordova/lib/AppxManifest.js
index acaeefd..a2d4e8c 100644
--- a/template/cordova/lib/AppxManifest.js
+++ b/template/cordova/lib/AppxManifest.js
@@ -43,15 +43,12 @@ var KNOWN_ORIENTATIONS = {
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'
}
};
diff --git a/template/cordova/lib/MSBuildTools.js b/template/cordova/lib/MSBuildTools.js
index 2a0de96..7399e32 100644
--- a/template/cordova/lib/MSBuildTools.js
+++ b/template/cordova/lib/MSBuildTools.js
@@ -59,13 +59,7 @@ MSBuildTools.prototype.buildProject = function (projFile, buildType, buildarch,
var promise;
// Check if SDK required to build the respective platform is present. If not present, return with corresponding error, else call msbuild.
- if (projFile.indexOf('CordovaApp.Phone.jsproj') > -1) {
- promise = checkPhoneSDK();
- } else if (projFile.indexOf('CordovaApp.Windows.jsproj') > -1) {
- promise = checkWinSDK('8.1');
- } else {
- promise = checkWinSDK('10.0');
- }
+ promise = checkWinSDK('10.0');
return promise.then(function () {
console.log('buildProject spawn:', path.join(that.path, 'msbuild'), [projFile].concat(args), { stdio: 'inherit' });
diff --git a/template/cordova/lib/build.js b/template/cordova/lib/build.js
index d172736..c8a8d78 100644
--- a/template/cordova/lib/build.js
+++ b/template/cordova/lib/build.js
@@ -116,9 +116,6 @@ function getBuildTargets (isWinSwitch, isPhoneSwitch, projOverride, buildConfig)
if (isPhoneSwitch || noSwitches) { // if --phone or no arg
var windowsPhoneTargetVersion = configXML.getWindowsPhoneTargetVersion();
switch (windowsPhoneTargetVersion.toLowerCase()) {
- case '8.1':
- targets.push(projFiles.phone);
- break;
case '10.0':
case 'uap':
case 'uwp':
@@ -137,15 +134,6 @@ function getBuildTargets (isWinSwitch, isPhoneSwitch, projOverride, buildConfig)
// apply build target override if one was specified
if (projOverride) {
switch (projOverride.toLowerCase()) {
- case '8.1':
- targets = [projFiles.win, projFiles.phone];
- break;
- case '8.1-phone':
- targets = [projFiles.phone];
- break;
- case '8.1-win':
- targets = [projFiles.win];
- break;
case 'uap':
case 'uwp':
targets = [projFiles.win10];
diff --git a/template/cordova/lib/deployment.js b/template/cordova/lib/deployment.js
index 080f936..6ae6b31 100644
--- a/template/cordova/lib/deployment.js
+++ b/template/cordova/lib/deployment.js
@@ -71,8 +71,7 @@ DeploymentTool.prototype.uninstallAppPackage = function (packageInfo, targetDevi
};
/**
- * Gets a list of installed apps on the target device. This function is not supported for
- * Windows Phone 8.1.
+ * Gets a list of installed apps on the target device.
* @param targetDevice {Object} An object returned from a successful call to enumerateDevices.
* @returns A Promise for an array of app names.
*/
@@ -95,11 +94,7 @@ DeploymentTool.prototype.launchApp = function (packageInfo, targetDevice) {
* @param targetOsVersion {String} The version of the
*/
DeploymentTool.getDeploymentTool = function (targetOsVersion) {
- if (targetOsVersion === '8.1') {
- return new AppDeployCmdTool(targetOsVersion);
- } else {
- return new WinAppDeployCmdTool(targetOsVersion);
- }
+ return new WinAppDeployCmdTool(targetOsVersion);
};
// DeviceInfo is an opaque object passed to install/uninstall.
diff --git a/template/cordova/prebuild.js b/template/cordova/prebuild.js
index 1c0abc8..6223c48 100644
--- a/template/cordova/prebuild.js
+++ b/template/cordova/prebuild.js
@@ -30,21 +30,15 @@ module.exports = function patch (platform) {
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'
+ '10': '/www/WinJS/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'
+ '10': '\/www\/WinJS\/js\/base\.js'
};
var basejsSrc = basejsSrcMap[platform];
var appxmanifestMap = {
- '10': 'package.windows10.appxmanifest',
- '8.1': 'package.windows.appxmanifest',
- 'phone-8.1': 'package.phone.appxmanifest'
+ '10': 'package.windows10.appxmanifest'
};
// 1. Find start page path in appxmanifest
--
To stop receiving notification emails like this one, please contact
janpio@apache.org.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org