You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by br...@apache.org on 2019/12/23 03:30:52 UTC

[cordova-windows] 02/02: do not build Windows [Phone] 8.1 projects

This is an automated email from the ASF dual-hosted git repository.

brodybits pushed a commit to branch brodybits-uwp-only-test-wip0549
in repository https://gitbox.apache.org/repos/asf/cordova-windows.git

commit ef3b81ce6df623fbbb01468a541717f20575f3ff
Author: Christopher J. Brody <ch...@brody.consulting>
AuthorDate: Sun Dec 22 22:28:32 2019 -0500

    do not build Windows [Phone] 8.1 projects
    
    skip affected unit & e2e tests (for now, at least)
    
    update some related help text
    
    Co-authored-by: Jan Piotrowski <pi...@gmail.com>
    Co-authored-by: Christopher J. Brody <ch...@brody.consulting>
---
 bin/lib/check_reqs.js         |  5 +++++
 spec/e2e/endtoend.spec.js     | 20 ++++++++++----------
 spec/unit/build.spec.js       |  8 ++++----
 template/cordova/lib/build.js | 15 ++-------------
 template/cordova/run          |  7 +++----
 5 files changed, 24 insertions(+), 31 deletions(-)

diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index 086d109..bb0bc05 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -68,6 +68,11 @@ function getMinimalRequiredVersionFor (requirement, windowsTargetVersion, window
     if (windowsPhoneTargetVersion === '8' || windowsPhoneTargetVersion === '8.0') {
         throw new CordovaError('8.0 is not a valid version for windows-phone-target-version (use the wp8 Cordova platform instead)');
     }
+
+    if (windowsTargetVersion === '8.1' || windowsPhoneTargetVersion === '8.1') {
+        throw new CordovaError('Windows (Phone) 8.1 projects are deprecated. To use you may downgrade to cordova-windows@7.');
+    }
+
     var windowsReqVersion = Version.tryParse(REQUIRED_VERSIONS[windowsTargetVersion][requirement]);
     var phoneReqVersion = Version.tryParse(REQUIRED_VERSIONS[windowsPhoneTargetVersion][requirement]);
 
diff --git a/spec/e2e/endtoend.spec.js b/spec/e2e/endtoend.spec.js
index b33e013..7ef12cd 100644
--- a/spec/e2e/endtoend.spec.js
+++ b/spec/e2e/endtoend.spec.js
@@ -173,17 +173,17 @@ describe('Cordova create and build', function () {
             }
         });
 
-        it('spec.2d should build 8.1 win project', function () {
+        xit('spec.2d should build 8.1 win project', function () {
             shell.exec(buildScriptPath + ' --appx=8.1-win', { silent: silent });
             _expectExist(/.*Windows.*\.appxupload/);
         });
 
-        it('spec.2e should build 8.1 phone project', function () {
+        xit('spec.2e should build 8.1 phone project', function () {
             shell.exec(buildScriptPath + ' --appx=8.1-phone', { silent: silent });
             _expectExist(/.*Phone.*\.appxupload/);
         });
 
-        it('spec.2f should build 8.1 win + phone project', function () {
+        xit('spec.2f should build 8.1 win + phone project', function () {
             shell.exec(buildScriptPath + ' --appx=8.1', { silent: silent });
             _expectExist(/.*Windows.*\.appxupload/);
             _expectExist(/.*Phone.*\.appxupload/);
@@ -191,23 +191,23 @@ describe('Cordova create and build', function () {
 
         // --archs
 
-        it('spec.3b should build project (8.1) for particular CPU', function () {
+        xit('spec.3b should build project (8.1) for particular CPU', function () {
             shell.exec(buildScriptPath + ' --appx=8.1 --archs=\"x64\"', { silent: silent }); /* eslint no-useless-escape : 0 */
             _expectExist(/.*Phone.*x64.*\.appxupload/);
             _expectExist(/.*Windows.*x64.*\.appxupload/);
         });
 
-        it('spec.3c should build project (8.1-win) for particular CPU', function () {
+        xit('spec.3c should build project (8.1-win) for particular CPU', function () {
             shell.exec(buildScriptPath + ' --appx=8.1-win --archs=\"x64\"', { silent: silent }); /* eslint no-useless-escape : 0 */
             _expectExist(/.*Windows.*x64.*\.appxupload/);
         });
 
-        it('spec.3d should build project (8.1-phone) for particular CPU', function () {
+        xit('spec.3d should build project (8.1-phone) for particular CPU', function () {
             shell.exec(buildScriptPath + ' --appx=8.1-phone --archs=\"x64\"', { silent: silent }); /* eslint no-useless-escape : 0 */
             _expectExist(/.*Phone.*x64.*\.appxupload/);
         });
 
-        it('spec.4b should build project (8.1) for CPUs separated by whitespaces', function () {
+        xit('spec.4b should build project (8.1) for CPUs separated by whitespaces', function () {
             shell.exec(buildScriptPath + ' --appx=8.1 --archs=\"x64 x86 arm anycpu\"', { silent: silent }); /* eslint no-useless-escape : 0 */
             _expectExist(/.*Phone.*x86.*\.appxupload/);
             _expectExist(/.*Phone.*x64.*\.appxupload/);
@@ -221,7 +221,7 @@ describe('Cordova create and build', function () {
 
         // "InProcessServer extension"
 
-        it('spec.5b should build project (8.1) containing plugin with InProcessServer extension', function () {
+        xit('spec.5b should build project (8.1) containing plugin with InProcessServer extension', function () {
             var extensionsPluginInfo, api;
 
             extensionsPluginInfo = new PluginInfo(extensionsPlugin);
@@ -240,7 +240,7 @@ describe('Cordova create and build', function () {
 
         // --release --bundle
 
-        it('spec.6b should generate appxupload and appxbundle for Windows Phone 8.1 project bundle release build', function () {
+        xit('spec.6b should generate appxupload and appxbundle for Windows Phone 8.1 project bundle release build', function () {
             shell.exec(buildScriptPath + ' --release --appx=8.1-phone --bundle --archs=\"x64 x86 arm\"', { silent: silent });
             _expectExist(/.*bundle\.appxupload$/, 3);
             _expectSubdirAndFileExist('CordovaApp.Phone_1.0.0.0_Test', 'CordovaApp.Phone_1.0.0.0_x64_x86_arm.appxbundle');
@@ -248,7 +248,7 @@ describe('Cordova create and build', function () {
 
         // --release (non-bundle)
 
-        it('spec.8 for a non-bundle case for Windows Phone 8.1 it should build appx in separate dirs for each architecture', function () {
+        xit('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 --appx=8.1-phone --phone --archs=\"x86 arm\"', { silent: silent });
             _expectExist(/.*\.appxupload$/, 2);
             _expectSubdirAndFileExist('CordovaApp.Phone_1.0.0.0_arm_Test', 'CordovaApp.Phone_1.0.0.0_arm.appx');
diff --git a/spec/unit/build.spec.js b/spec/unit/build.spec.js
index 4023ea1..c4ae315 100644
--- a/spec/unit/build.spec.js
+++ b/spec/unit/build.spec.js
@@ -257,7 +257,7 @@ describe('run method', function () {
         );
     });
 
-    it('spec.9 should call buildProject of MSBuildTools if built for windows 8.1', function () {
+    xit('spec.9 should call buildProject of MSBuildTools if built for windows 8.1', function () {
         var buildSpy = jasmine.createSpy();
 
         createFindAllAvailableVersionsMock([{ version: '14.0', buildProject: buildSpy, path: testPath }]);
@@ -284,7 +284,7 @@ describe('run method', function () {
         );
     });
 
-    it('spec.11 should call buildProject of MSBuildTools if built for windows phone 8.1', function () {
+    xit('spec.11 should call buildProject of MSBuildTools if built for windows phone 8.1', function () {
         var buildSpy = jasmine.createSpy();
 
         createFindAllAvailableVersionsMock([{ version: '14.0', buildProject: buildSpy, path: testPath }]);
@@ -311,7 +311,7 @@ describe('run method', function () {
         );
     });
 
-    it('spec.13a should be able to override target via --appx parameter', function () {
+    xit('spec.13a should be able to override target via --appx parameter', function () {
         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');
@@ -327,7 +327,7 @@ describe('run method', function () {
             });
     });
 
-    it('spec.13b should be able to override target via --appx parameter', function () {
+    xit('spec.13b should be able to override target via --appx parameter', function () {
         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');
diff --git a/template/cordova/lib/build.js b/template/cordova/lib/build.js
index eccb5c8..d4b6eb2 100644
--- a/template/cordova/lib/build.js
+++ b/template/cordova/lib/build.js
@@ -100,8 +100,7 @@ function getBuildTargets (isWinSwitch, isPhoneSwitch, projOverride, buildConfig)
         case '8.0':
             throw new CordovaError('windows8 platform is deprecated. To use windows-target-version=8.0 you must downgrade to cordova-windows@4.');
         case '8.1':
-            targets.push(projFiles.win);
-            break;
+            throw new CordovaError('windows8.1 platform is deprecated. To use windows-target-version=8.1 you must downgrade to cordova-windows@7.');
         case '10.0':
         case 'uap':
         case 'uwp':
@@ -117,8 +116,7 @@ function getBuildTargets (isWinSwitch, isPhoneSwitch, projOverride, buildConfig)
         var windowsPhoneTargetVersion = configXML.getWindowsPhoneTargetVersion();
         switch (windowsPhoneTargetVersion.toLowerCase()) {
         case '8.1':
-            targets.push(projFiles.phone);
-            break;
+            throw new CordovaError('windows-phone 8.1 platform is deprecated - to use, downgrade to cordova-windows@7.');
         case '10.0':
         case 'uap':
         case 'uwp':
@@ -137,15 +135,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/run b/template/cordova/run
index 704b37f..ed4da01 100644
--- a/template/cordova/run
+++ b/template/cordova/run
@@ -41,9 +41,8 @@ if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(args[2]) > -1) {
     console.log('                    architectures are used.');
     console.log('    --phone, --win');
     console.log('                  : Specifies project type to deploy');
-    console.log('    --appx=<8.1-win|8.1-phone|uap|uwp>');
-    console.log('                  : Overrides windows-target-version to build Windows 8.1, ');
-    console.log('                              Windows Phone 8.1, or Windows 10.');
+    console.log('    --appx=<uap|uwp>');
+    console.log('                  : Overrides windows-target-version');
     console.log('    --win10tools  : Uses Windows 10 deployment tools (used for a Windows 8.1 app when');
     console.log('                         being deployed to a Windows 10 device)');
     console.log('Examples:');
@@ -54,7 +53,7 @@ if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(args[2]) > -1) {
     console.log('    run --device --release');
     console.log('    run --emulator --debug');
     console.log('    run --archs="x64 x86 arm" --no-bundle');
-    console.log('    run --device --appx=phone-8.1');
+    console.log('    run --device --appx=uwp');
     console.log('    run --device --archs="x64 x86 arm"');
     console.log('');
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org