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/15 15:29:51 UTC

[cordova-windows] branch janpio-MSBUILDDIR_2 created (now d7f639d)

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

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


      at d7f639d  console.log msbuild command and params that are used to build

This branch includes the following new commits:

     new ba5c1fe  MSBUILDDIR for MSBuild selection
     new 60f879e  Change order of builds on AppVeyor
     new 723914e  Use MSBUILDDIR on AppVeyor
     new 8b535d8  avoid crosspolution in tests that rely on ENV vars (uh, ugly)
     new d7f639d  console.log msbuild command and params that are used to build

The 5 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.


-- 
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/05: Use MSBUILDDIR on AppVeyor

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

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

commit 723914e0d4fa1e611634709b3cb6a99fe50d4083
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Thu Feb 15 12:49:35 2018 +0100

    Use MSBUILDDIR on AppVeyor
---
 appveyor.yml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/appveyor.yml b/appveyor.yml
index 28247ec..19e7f28 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -25,6 +25,10 @@ environment:
       APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
 
     - nodejs_version: "6"
+      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
+      MSBUILDDIR: "C:\\Program Files (x86)\\MSBuild\\14.0\\bin\\"
+
+    - nodejs_version: "6"
       APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
 
     - nodejs_version: "4"

-- 
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/05: avoid crosspolution in tests that rely on ENV vars (uh, ugly)

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

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

commit 8b535d8a9ddd7ea798097f9e9d66e1fd701bd8ea
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Thu Feb 15 13:00:38 2018 +0100

    avoid crosspolution in tests that rely on ENV vars (uh, ugly)
---
 spec/unit/build.spec.js | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/spec/unit/build.spec.js b/spec/unit/build.spec.js
index ad25c99..f9f55fa 100644
--- a/spec/unit/build.spec.js
+++ b/spec/unit/build.spec.js
@@ -376,6 +376,9 @@ describe('run method', function () {
         var msBuildBinPath = path.join(customMSBuildPath, 'MSBuild/15.0/Bin');
         var customMSBuildVersion = '15.0';
         process.env.VSINSTALLDIR = customMSBuildPath;
+        // avoid crosspollution with MSBUILDDIR
+        var backupMSBUILDDIR = process.env.MSBUILDDIR;
+        delete process.env.MSBUILDDIR;
 
         spyOn(MSBuildTools, 'getMSBuildToolsAt')
             .and.returnValue(Q({
@@ -392,6 +395,7 @@ describe('run method', function () {
                 expect(fail).not.toHaveBeenCalled();
                 expect(MSBuildTools.getMSBuildToolsAt).toHaveBeenCalledWith(msBuildBinPath);
                 delete process.env.VSINSTALLDIR;
+                process.env.MSBUILDDIR = backupMSBUILDDIR;
                 done();
             });
     });
@@ -400,6 +404,9 @@ describe('run method', function () {
         var msBuildBinPath = path.join('/some/path', 'MSBuild/15.0/Bin');
         var customMSBuildVersion = '15.0';
         process.env.MSBUILDDIR = msBuildBinPath;
+        // avoid crosspollution with VSINSTALLDIR
+        var backupVSINSTALLDIR = process.env.VSINSTALLDIR;
+        delete process.env.VSINSTALLDIR;
 
         spyOn(MSBuildTools, 'getMSBuildToolsAt')
             .and.returnValue(Q({
@@ -416,6 +423,7 @@ describe('run method', function () {
                 expect(fail).not.toHaveBeenCalled();
                 expect(MSBuildTools.getMSBuildToolsAt).toHaveBeenCalledWith(msBuildBinPath);
                 delete process.env.MSBUILDDIR;
+                process.env.VSINSTALLDIR = backupVSINSTALLDIR;
                 done();
             });
     });

-- 
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/05: Change order of builds on AppVeyor

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

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

commit 60f879eb7e7177213b87fa2b5d9aa71948de7792
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Thu Feb 15 12:49:24 2018 +0100

    Change order of builds on AppVeyor
---
 appveyor.yml | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/appveyor.yml b/appveyor.yml
index 382664e..28247ec 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -19,13 +19,19 @@
 # appveyor file
 # http://www.appveyor.com/docs/appveyor-yml
 
-image:
-- Visual Studio 2015
-- Visual Studio 2017
 environment:
   matrix:
-    - nodejs_version: "4"
     - nodejs_version: "6"
+      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
+
+    - nodejs_version: "6"
+      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
+
+    - nodejs_version: "4"
+      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
+
+    - nodejs_version: "4"
+      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
 
 install:
   - ps: Install-Product node $env:nodejs_version

-- 
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/05: console.log msbuild command and params that are used to build

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

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

commit d7f639d37a3f1f660289b9131fc7f183c51de981
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Thu Feb 15 15:33:26 2018 +0100

    console.log msbuild command and params that are used to build
---
 template/cordova/lib/MSBuildTools.js | 1 +
 1 file changed, 1 insertion(+)

diff --git a/template/cordova/lib/MSBuildTools.js b/template/cordova/lib/MSBuildTools.js
index dd04b8f..c65e169 100644
--- a/template/cordova/lib/MSBuildTools.js
+++ b/template/cordova/lib/MSBuildTools.js
@@ -68,6 +68,7 @@ MSBuildTools.prototype.buildProject = function (projFile, buildType, buildarch,
     }
 
     return promise.then(function () {
+        console.log('buildProject spawn:', path.join(that.path, 'msbuild'), [projFile].concat(args), { stdio: 'inherit' });
         return spawn(path.join(that.path, 'msbuild'), [projFile].concat(args), { stdio: 'inherit' });
     });
 };

-- 
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/05: MSBUILDDIR for MSBuild selection

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

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

commit ba5c1fe76ccc0736dea16323e8490fb2ff9ca8ab
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Thu Feb 15 12:48:33 2018 +0100

    MSBUILDDIR for MSBuild selection
---
 spec/unit/build.spec.js              | 26 +++++++++++++++++++++++++-
 template/cordova/lib/MSBuildTools.js | 21 ++++++++++++++++++++-
 2 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/spec/unit/build.spec.js b/spec/unit/build.spec.js
index 81b2ada..ad25c99 100644
--- a/spec/unit/build.spec.js
+++ b/spec/unit/build.spec.js
@@ -371,7 +371,7 @@ describe('run method', function () {
             });
     });
 
-    it('spec.14 should use user-specified msbuild if VSINSTALLDIR variable is set', function (done) {
+    it('spec.14a should use user-specified msbuild if VSINSTALLDIR variable is set', function (done) {
         var customMSBuildPath = '/some/path';
         var msBuildBinPath = path.join(customMSBuildPath, 'MSBuild/15.0/Bin');
         var customMSBuildVersion = '15.0';
@@ -396,6 +396,30 @@ describe('run method', function () {
             });
     });
 
+    it('spec.14b should use user-specified msbuild if MSBUILDDIR variable is set', function (done) {
+        var msBuildBinPath = path.join('/some/path', 'MSBuild/15.0/Bin');
+        var customMSBuildVersion = '15.0';
+        process.env.MSBUILDDIR = msBuildBinPath;
+
+        spyOn(MSBuildTools, 'getMSBuildToolsAt')
+            .and.returnValue(Q({
+                path: msBuildBinPath,
+                version: customMSBuildVersion,
+                buildProject: jasmine.createSpy('buildProject').and.returnValue(Q())
+            }));
+
+        var fail = jasmine.createSpy('fail');
+
+        build.run({})
+            .fail(fail)
+            .finally(function () {
+                expect(fail).not.toHaveBeenCalled();
+                expect(MSBuildTools.getMSBuildToolsAt).toHaveBeenCalledWith(msBuildBinPath);
+                delete process.env.MSBUILDDIR;
+                done();
+            });
+    });
+
     it('spec.15a should choose latest version if there are multiple versions available with minor version difference', function (done) {
         var fail = jasmine.createSpy('fail');
         var buildTools14 = { version: '14.0', buildProject: jasmine.createSpy('buildTools14'), path: testPath };
diff --git a/template/cordova/lib/MSBuildTools.js b/template/cordova/lib/MSBuildTools.js
index fa05e73..dd04b8f 100644
--- a/template/cordova/lib/MSBuildTools.js
+++ b/template/cordova/lib/MSBuildTools.js
@@ -75,9 +75,28 @@ MSBuildTools.prototype.buildProject = function (projFile, buildType, buildarch,
 // check_reqs.js -> checkMSBuild()
 module.exports.findAllAvailableVersions = function () {
     console.log('findAllAvailableVersions');
+
+    var msBuildPath = '';
+
+    // Use MSBUILDDIR environment variable if defined to find MSBuild.
+    // MSBUILDDIR = C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
+    // MSBUILDDIR = C:\Program Files (x86)\MSBuild\14.0\bin\
+    if (process.env.MSBUILDDIR) {
+        console.log('ENV var MSBUILDDIR is set', process.env.MSBUILDDIR);
+        msBuildPath = process.env.MSBUILDDIR;
+        return module.exports.getMSBuildToolsAt(msBuildPath)
+            .then(function (msBuildTools) {
+                return [msBuildTools];
+            })
+            // If MSBUILDDIR is not specified or doesn't contain a valid MSBuild
+            // - fall back to default discovery mechanism.
+            .catch(findAllAvailableVersionsFallBack);
+    }
+
     // CB-11548 use VSINSTALLDIR environment if defined to find MSBuild.
     if (process.env.VSINSTALLDIR) {
-        var msBuildPath = path.join(process.env.VSINSTALLDIR, 'MSBuild/15.0/Bin');
+        console.log('ENV var VSINSTALLDIR is set', process.env.VSINSTALLDIR);
+        msBuildPath = path.join(process.env.VSINSTALLDIR, 'MSBuild/15.0/Bin');
         return module.exports.getMSBuildToolsAt(msBuildPath)
             .then(function (msBuildTools) {
                 return [msBuildTools];

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