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/01/25 18:12:26 UTC

[cordova-windows] branch janpio-CB-13829 updated (abbecdc -> 5fa5ebb)

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

janpio pushed a change to branch janpio-CB-13829
in repository https://gitbox.apache.org/repos/asf/cordova-windows.git.


    from abbecdc  CB-13829 Introduce variable `silent` to control output of commands
     new 5840c51  fix first failing test for new default `appx`
     new aabbf01  document/structure current state of tests (although some are still failing)
     new f02e419  extrat file and subdir+file expect code into function
     new 332a017  add build target override `8.1` (8.1-win + 8.1-phone)
     new e2790a5  add test for new override
     new 781c5e9  remove duplicated getBuildTargets (and update its internal usage)
     new 5fa5ebb  more tests fixed

The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 spec/e2e/endtoend.spec.js     | 103 +++++++++++++++++++++++------
 template/cordova/lib/build.js | 148 +++++++++++++-----------------------------
 2 files changed, 129 insertions(+), 122 deletions(-)

-- 
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


[cordova-windows] 01/07: fix first failing test for new default `appx`

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

janpio pushed a commit to branch janpio-CB-13829
in repository https://gitbox.apache.org/repos/asf/cordova-windows.git

commit 5840c51d47041a74a49d879f81bdbb6c14354fcb
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Thu Jan 25 16:10:46 2018 +0100

    fix first failing test for new default `appx`
---
 spec/e2e/endtoend.spec.js | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/spec/e2e/endtoend.spec.js b/spec/e2e/endtoend.spec.js
index c3e3f96..4facaca 100644
--- a/spec/e2e/endtoend.spec.js
+++ b/spec/e2e/endtoend.spec.js
@@ -55,11 +55,24 @@ describe('Cordova create and build', function () {
         expect(fs.existsSync(projectFolder)).toBe(true);
     });
 
-    it('spec.2 should build project', function () {
+    it('spec.2a should build default (win10) project', function () {
         shell.exec(buildScriptPath + '', {silent: silent});
         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);
+        var subDir = 'CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test';
+        expect(packages.filter(function (file) { return file.match(subDir); }).length).toBe(1);
+        verifySubDirContainsFile(subDir, 'CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx');
+    });
+
+    it('spec.2b should build 8.1 win project', function () {
+        shell.exec(buildScriptPath + ' --appx=8.1-win', {silent: silent});
+        var packages = shell.ls(appPackagesFolder);
+        expect(packages.filter(function (file) { return file.match(/.*Windows.*\.appxupload/); }).length).toBe(1);
+    });
+
+    it('spec.2c should build 8.1 phone project', function () {
+        shell.exec(buildScriptPath + ' --appx=8.1-phone', {silent: silent});
+        var packages = shell.ls(appPackagesFolder);
+        expect(packages.filter(function (file) { return file.match(/.*Phone.*\.appxupload*/); }).length).toBe(1);
     });
 
     it('spec.3 should build project for particular CPU', function () {

-- 
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


[cordova-windows] 03/07: extrat file and subdir+file expect code into function

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

janpio pushed a commit to branch janpio-CB-13829
in repository https://gitbox.apache.org/repos/asf/cordova-windows.git

commit f02e4190b98079ee276bec34d278f78c78a92072
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Thu Jan 25 16:52:09 2018 +0100

    extrat file and subdir+file expect code into function
---
 spec/e2e/endtoend.spec.js | 33 ++++++++++++++++++++++-----------
 1 file changed, 22 insertions(+), 11 deletions(-)

diff --git a/spec/e2e/endtoend.spec.js b/spec/e2e/endtoend.spec.js
index 1f803a1..f4b8bd0 100644
--- a/spec/e2e/endtoend.spec.js
+++ b/spec/e2e/endtoend.spec.js
@@ -42,6 +42,17 @@ describe('Cordova create and build', function () {
         expect(packages.filter(function (file) { return file.match(fileName); }).length).toBe(1);
     }
 
+    function _expectExist(fileNamePattern) {
+        var packages = shell.ls(appPackagesFolder);
+        expect(packages.filter(function (file) { return file.match(fileNamePattern); }).length).toBe(1);
+    }
+
+    function _expectSubdirAndFileExist(subDirName, fileName) {
+        var packages = shell.ls(appPackagesFolder);
+        _expectExist(subDirName);
+        verifySubDirContainsFile(subDirName, fileName);
+    }
+
     beforeEach(function () {
         shell.exec(path.join('bin', 'create') + ' "' + projectFolder + '" com.test.app 応用', {silent: silent});
     });
@@ -55,28 +66,28 @@ describe('Cordova create and build', function () {
         expect(fs.existsSync(projectFolder)).toBe(true);
     });
 
-    // default build
+    // default
     
-    it('spec.2a should build default (win10) project', function () {
+    it('spec.2 should build default (win10) project', function () {
         shell.exec(buildScriptPath + '', {silent: silent});
-        var packages = shell.ls(appPackagesFolder);
-        var subDir = 'CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test';
-        expect(packages.filter(function (file) { return file.match(subDir); }).length).toBe(1);
-        verifySubDirContainsFile(subDir, 'CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx');
+        _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test', 'CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx');
     });
 
-    // --appx 8.1
+    // --appx
+
+    it('spec.2a should build win10 project', function () {
+        shell.exec(buildScriptPath + ' --appx=uap', {silent: silent});
+        _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test', 'CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx');
+    });
 
     it('spec.2b should build 8.1 win project', function () {
         shell.exec(buildScriptPath + ' --appx=8.1-win', {silent: silent});
-        var packages = shell.ls(appPackagesFolder);
-        expect(packages.filter(function (file) { return file.match(/.*Windows.*\.appxupload/); }).length).toBe(1);
+        _expectExist(/.*Windows.*\.appxupload/);
     });
 
     it('spec.2c should build 8.1 phone project', function () {
         shell.exec(buildScriptPath + ' --appx=8.1-phone', {silent: silent});
-        var packages = shell.ls(appPackagesFolder);
-        expect(packages.filter(function (file) { return file.match(/.*Phone.*\.appxupload*/); }).length).toBe(1);
+        _expectExist(/.*Phone.*\.appxupload/);
     });
 
     // --archs

-- 
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


[cordova-windows] 05/07: add test for new override

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

janpio pushed a commit to branch janpio-CB-13829
in repository https://gitbox.apache.org/repos/asf/cordova-windows.git

commit e2790a5e884046fed31d991162de8d844fb102d2
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Thu Jan 25 17:05:01 2018 +0100

    add test for new override
---
 spec/e2e/endtoend.spec.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/spec/e2e/endtoend.spec.js b/spec/e2e/endtoend.spec.js
index f4b8bd0..49484ea 100644
--- a/spec/e2e/endtoend.spec.js
+++ b/spec/e2e/endtoend.spec.js
@@ -90,6 +90,12 @@ describe('Cordova create and build', function () {
         _expectExist(/.*Phone.*\.appxupload/);
     });
 
+    it('spec.2c should build 8.1 win + phone project', function () {
+        shell.exec(buildScriptPath + ' --appx=8.1', {silent: silent});
+        _expectExist(/.*Windows.*\.appxupload/);
+        _expectExist(/.*Phone.*\.appxupload/);
+    });
+
     // --archs
     
     it('spec.3 should build project for particular CPU', function () {

-- 
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


[cordova-windows] 07/07: more tests fixed

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

janpio pushed a commit to branch janpio-CB-13829
in repository https://gitbox.apache.org/repos/asf/cordova-windows.git

commit 5fa5ebb43ba4226d94448dada438bfef4f049639
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Thu Jan 25 19:12:16 2018 +0100

    more tests fixed
---
 spec/e2e/endtoend.spec.js | 51 +++++++++++++++++++++++++++++++++--------------
 1 file changed, 36 insertions(+), 15 deletions(-)

diff --git a/spec/e2e/endtoend.spec.js b/spec/e2e/endtoend.spec.js
index 49484ea..ec58952 100644
--- a/spec/e2e/endtoend.spec.js
+++ b/spec/e2e/endtoend.spec.js
@@ -34,7 +34,7 @@ describe('Cordova create and build', function () {
     var buildDirectory = path.join(__dirname, '../..');
     var appPackagesFolder = path.join(buildDirectory, projectFolder, 'AppPackages');
     var buildScriptPath = '"' + path.join(buildDirectory, projectFolder, 'cordova', 'build') + '"';
-    var silent = true;
+    var silent = false;
 
     function verifySubDirContainsFile (subDirName, fileName) {
         var subDir = path.join(appPackagesFolder, subDirName);
@@ -98,24 +98,45 @@ describe('Cordova create and build', function () {
 
     // --archs
     
-    it('spec.3 should build project for particular CPU', function () {
+    it('spec.3a should build project for particular CPU', function () {
         shell.exec(buildScriptPath + ' --archs=\"x64\"', {silent: silent}); /* eslint no-useless-escape : 0 */
-        var packages = shell.ls(appPackagesFolder);
-        expect(packages.filter(function (file) { return file.match(/.*Phone.*x64.*\.appx.*/); }).length).toBe(1);
-        expect(packages.filter(function (file) { return file.match(/.*Windows.*x64.*\.appx.*/); }).length).toBe(1);
+        _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_x64_debug_Test', 'CordovaApp.Windows10_1.0.0.0_x64_debug.appx');
+    });
+
+    it('spec.3b should build project 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.4 should build project for CPUs separated by whitespaces', function () {
+    it('spec.3c should build project 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 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.4a should build project for CPUs separated by whitespaces', function () {
         shell.exec(buildScriptPath + ' --archs=\"x64 x86 arm anycpu\"', {silent: silent}); /* eslint no-useless-escape : 0 */
-        var packages = shell.ls(appPackagesFolder);
-        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.*/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.*/i); }).length).toBe(1);
+        _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_x64_debug_Test', 'CordovaApp.Windows10_1.0.0.0_x64_debug.appx');
+        _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_x86_debug_Test', 'CordovaApp.Windows10_1.0.0.0_x86_debug.appx');
+        _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_arm_debug_Test', 'CordovaApp.Windows10_1.0.0.0_arm_debug.appx');
+        _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test', 'CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx');
+    });
+
+    it('spec.4b should build project 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/);
+        _expectExist(/.*Phone.*arm.*\.appxupload/);
+        _expectExist(/.*Phone.*AnyCPU.*\.appxupload/i);
+        _expectExist(/.*Windows.*x64.*\.appxupload/);
+        _expectExist(/.*Windows.*x86.*\.appxupload/);
+        _expectExist(/.*Windows.*arm.*\.appxupload/);
+        _expectExist(/.*Windows.*anycpu.*\.appxupload/i);
     });
 
     // "InProcessServer extension"

-- 
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


[cordova-windows] 02/07: document/structure current state of tests (although some are still failing)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

janpio pushed a commit to branch janpio-CB-13829
in repository https://gitbox.apache.org/repos/asf/cordova-windows.git

commit aabbf01bf7d5c9b5f5e15806273a7016ed5fda19
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Thu Jan 25 16:14:29 2018 +0100

    document/structure current state of tests (although some are still failing)
---
 spec/e2e/endtoend.spec.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/spec/e2e/endtoend.spec.js b/spec/e2e/endtoend.spec.js
index 4facaca..1f803a1 100644
--- a/spec/e2e/endtoend.spec.js
+++ b/spec/e2e/endtoend.spec.js
@@ -55,6 +55,8 @@ describe('Cordova create and build', function () {
         expect(fs.existsSync(projectFolder)).toBe(true);
     });
 
+    // default build
+    
     it('spec.2a should build default (win10) project', function () {
         shell.exec(buildScriptPath + '', {silent: silent});
         var packages = shell.ls(appPackagesFolder);
@@ -63,6 +65,8 @@ describe('Cordova create and build', function () {
         verifySubDirContainsFile(subDir, 'CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx');
     });
 
+    // --appx 8.1
+
     it('spec.2b should build 8.1 win project', function () {
         shell.exec(buildScriptPath + ' --appx=8.1-win', {silent: silent});
         var packages = shell.ls(appPackagesFolder);
@@ -75,6 +79,8 @@ describe('Cordova create and build', function () {
         expect(packages.filter(function (file) { return file.match(/.*Phone.*\.appxupload*/); }).length).toBe(1);
     });
 
+    // --archs
+    
     it('spec.3 should build project for particular CPU', function () {
         shell.exec(buildScriptPath + ' --archs=\"x64\"', {silent: silent}); /* eslint no-useless-escape : 0 */
         var packages = shell.ls(appPackagesFolder);
@@ -95,6 +101,8 @@ describe('Cordova create and build', function () {
         expect(packages.filter(function (file) { return file.match(/.*Windows.*anycpu.*\.appx.*/i); }).length).toBe(1);
     });
 
+    // "InProcessServer extension"
+
     it('spec.5 should build project containing plugin with InProcessServer extension', function (done) {
         var extensionsPluginInfo, api;
 
@@ -123,6 +131,8 @@ describe('Cordova create and build', function () {
             });
     });
 
+    // --release 8.1
+
     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: silent});
         var packages = shell.ls(appPackagesFolder);
@@ -140,6 +150,8 @@ describe('Cordova create and build', function () {
         expect(packages.filter(function (file) { return file.match(/.*\.appxupload$/); }).length).toBe(3);
     });
 
+    // --release 10
+
     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: silent});
         var packages = shell.ls(appPackagesFolder);
@@ -172,6 +184,8 @@ describe('Cordova create and build', function () {
         verifySubDirContainsFile(x86SubDir, 'CordovaApp.Windows10_1.0.0.0_x86.appx');
     });
 
+    // --release 8.1
+
     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: silent});
         var packages = shell.ls(appPackagesFolder);

-- 
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


[cordova-windows] 06/07: remove duplicated getBuildTargets (and update its internal usage)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

janpio pushed a commit to branch janpio-CB-13829
in repository https://gitbox.apache.org/repos/asf/cordova-windows.git

commit 781c5e9b73450b801bbf31bd77d025db3a085154
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Thu Jan 25 19:01:55 2018 +0100

    remove duplicated getBuildTargets (and update its internal usage)
---
 template/cordova/lib/build.js | 150 +++++++++++++-----------------------------
 1 file changed, 45 insertions(+), 105 deletions(-)

diff --git a/template/cordova/lib/build.js b/template/cordova/lib/build.js
index 2f3ef8d..e4c6113 100644
--- a/template/cordova/lib/build.js
+++ b/template/cordova/lib/build.js
@@ -76,24 +76,8 @@ module.exports.run = function run (buildOptions) {
 };
 
 // returns list of projects to be built based on config.xml and additional parameters (-appx)
-module.exports.getBuildTargets = function (isWinSwitch, isPhoneSwitch, projOverride) {
+function getBuildTargets (isWinSwitch, isPhoneSwitch, projOverride, buildConfig = null) {
 
-    // apply build target override if one was specified
-    if (projOverride) {
-        switch (projOverride.toLowerCase()) {
-        case '8.1':
-            return [projFiles.win, projFiles.phone];
-        case '8.1-phone':
-            return [projFiles.phone];
-        case '8.1-win':
-            return [projFiles.win];
-        case 'uap':
-            return [projFiles.win10];
-        default:
-            events.emit('warn', 'Ignoring unrecognized --appx parameter passed to build: "' + projOverride + '"');
-            break;
-        }
-    }
 
     var configXML = new ConfigParser(path.join(ROOT, 'config.xml'));
     var targets = [];
@@ -139,8 +123,50 @@ module.exports.getBuildTargets = function (isWinSwitch, isPhoneSwitch, projOverr
         }
     }
 
+    // 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':
+            targets = [projFiles.win10];
+            break;
+        default:
+            events.emit('warn', 'Ignoring unrecognized --appx parameter passed to build: "' + projOverride + '"');
+            break;
+        }
+    }
+
+    if(buildConfig !== null) {
+        // As part of reworking how build and package determine the winning project, set the 'target type' project
+        // as part of build configuration.  This will be used for determining the binary to 'run' after build is done.
+        if (targets.length > 0) {
+            switch (targets[0]) {
+            case projFiles.phone:
+                buildConfig.targetProject = 'phone';
+                break;
+            case projFiles.win10:
+                buildConfig.targetProject = 'windows10';
+                break;
+            case projFiles.win:
+                /* falls through */
+            default:
+                buildConfig.targetProject = 'windows';
+                break;
+            }
+        }
+    }
+
     return targets;
 };
+module.exports.getBuildTargets = getBuildTargets;
 
 /**
  * Parses and validates buildOptions object and platform-specific CLI arguments,
@@ -278,7 +304,7 @@ function parseBuildConfig (buildConfigPath, buildType) {
 function updateManifestWithPublisher (allMsBuildVersions, config) {
     if (!config.publisherId) return;
 
-    var selectedBuildTargets = getBuildTargets(config);
+    var selectedBuildTargets = getBuildTargets(config.win, config.phone, config.projVerOverride, config);
     var msbuild = getLatestMSBuild(allMsBuildVersions);
     var myBuildTargets = filterSupportedTargets(selectedBuildTargets, msbuild);
     var manifestFiles = myBuildTargets.map(function (proj) {
@@ -293,7 +319,7 @@ function updateManifestWithPublisher (allMsBuildVersions, config) {
 
 function buildTargets (allMsBuildVersions, config) {
     // filter targets to make sure they are supported on this development machine
-    var selectedBuildTargets = getBuildTargets(config);
+    var selectedBuildTargets = getBuildTargets(config.win, config.phone, config.projVerOverride, config);
     var msbuild = getLatestMSBuild(allMsBuildVersions);
     if (!msbuild) {
         return Q.reject(new CordovaError('No valid MSBuild was detected for the selected target.'));
@@ -411,92 +437,6 @@ function clearIntermediatesAndGetPackage (bundleTerms, config, hasAnyCpu) {
     return pckage.getPackageFileInfo(finalFile);
 }
 
-// Can update buildConfig in the following ways:
-//  * Sets targetProject property, the project to launch when complete
-function getBuildTargets (buildConfig) {
-    var configXML = new ConfigParser(path.join(ROOT, 'config.xml'));
-    var targets = [];
-    var noSwitches = !(buildConfig.phone || buildConfig.win);
-
-    // Windows
-    if (buildConfig.win || noSwitches) { // if --win or no arg
-        var windowsTargetVersion = configXML.getWindowsTargetVersion();
-        switch (windowsTargetVersion) {
-        case '8':
-        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;
-        case '10.0':
-        case 'UAP':
-            targets.push(projFiles.win10);
-            break;
-        default:
-            throw new Error('Unsupported windows-target-version value: ' + windowsTargetVersion);
-        }
-    }
-
-    // Windows Phone
-    if (buildConfig.phone || noSwitches) { // if --phone or no arg
-        var windowsPhoneTargetVersion = configXML.getWindowsPhoneTargetVersion();
-        switch (windowsPhoneTargetVersion) {
-        case '8.1':
-            targets.push(projFiles.phone);
-            break;
-        case '10.0':
-        case 'UAP':
-            if (!buildConfig.win && !noSwitches) {
-                // Already built due to --win or no switches
-                // and since the same thing can be run on Phone as Windows,
-                // we can skip this one.
-                targets.push(projFiles.win10);
-            }
-            break;
-        default:
-            throw new Error('Unsupported windows-phone-target-version value: ' + windowsPhoneTargetVersion);
-        }
-    }
-
-    // apply build target override if one was specified
-    if (buildConfig.projVerOverride) {
-        switch (buildConfig.projVerOverride) {
-        case '8.1-phone':
-            targets = [projFiles.phone];
-            break;
-        case '8.1-win':
-            targets = [projFiles.win];
-            break;
-        case 'uap':
-            targets = [projFiles.win10];
-            break;
-        default:
-            events.emit('warn', 'Ignoring unrecognized --appx parameter passed to build: "' + buildConfig.projVerOverride + '"');
-            break;
-        }
-    }
-
-    // As part of reworking how build and package determine the winning project, set the 'target type' project
-    // as part of build configuration.  This will be used for determining the binary to 'run' after build is done.
-    if (targets.length > 0) {
-        switch (targets[0]) {
-        case projFiles.phone:
-            buildConfig.targetProject = 'phone';
-            break;
-        case projFiles.win10:
-            buildConfig.targetProject = 'windows10';
-            break;
-        case projFiles.win:
-            /* falls through */
-        default:
-            buildConfig.targetProject = 'windows';
-            break;
-        }
-    }
-
-    return targets;
-}
-
 function getLatestMSBuild (allMsBuildVersions) {
     var availableVersions = allMsBuildVersions
         .filter(function (buildTools) {

-- 
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


[cordova-windows] 04/07: add build target override `8.1` (8.1-win + 8.1-phone)

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

janpio pushed a commit to branch janpio-CB-13829
in repository https://gitbox.apache.org/repos/asf/cordova-windows.git

commit 332a017ff98fb4e96da263ab8069853dbf39afe3
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Thu Jan 25 17:04:38 2018 +0100

    add build target override `8.1` (8.1-win + 8.1-phone)
---
 template/cordova/lib/build.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/template/cordova/lib/build.js b/template/cordova/lib/build.js
index 5a2934d..2f3ef8d 100644
--- a/template/cordova/lib/build.js
+++ b/template/cordova/lib/build.js
@@ -81,6 +81,8 @@ module.exports.getBuildTargets = function (isWinSwitch, isPhoneSwitch, projOverr
     // apply build target override if one was specified
     if (projOverride) {
         switch (projOverride.toLowerCase()) {
+        case '8.1':
+            return [projFiles.win, projFiles.phone];
         case '8.1-phone':
             return [projFiles.phone];
         case '8.1-win':

-- 
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