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/13 18:10:29 UTC
[cordova-windows] branch janpio-rework_MSBuildTools created (now
2014e20)
This is an automated email from the ASF dual-hosted git repository.
janpio pushed a change to branch janpio-rework_MSBuildTools
in repository https://gitbox.apache.org/repos/asf/cordova-windows.git.
at 2014e20 output path to used MSBuildTools in during build
This branch includes the following new commits:
new 0ecda20 notes on method usage
new 2bed154 move getLatestMSBuild over to MSBuildTools
new 2014e20 output path to used MSBuildTools in during build
The 3 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/03: output path to used MSBuildTools in during
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-rework_MSBuildTools
in repository https://gitbox.apache.org/repos/asf/cordova-windows.git
commit 2014e205e28b7ea76766c5df54b5436b028bf53b
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Tue Feb 13 18:29:35 2018 +0100
output path to used MSBuildTools in during build
---
template/cordova/lib/MSBuildTools.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/template/cordova/lib/MSBuildTools.js b/template/cordova/lib/MSBuildTools.js
index f974872..eb9d7f0 100644
--- a/template/cordova/lib/MSBuildTools.js
+++ b/template/cordova/lib/MSBuildTools.js
@@ -35,7 +35,7 @@ MSBuildTools.prototype.buildProject = function (projFile, buildType, buildarch,
events.emit('log', '\tConfiguration : ' + buildType);
events.emit('log', '\tPlatform : ' + buildarch);
events.emit('log', '\tBuildflags : ' + buildFlags);
- events.emit('log', '\tMSBuildTools : ' + msbuild.path);
+ events.emit('log', '\tMSBuildTools : ' + this.path);
var checkWinSDK = function (target_platform) {
return require('./check_reqs').isWinSDKPresent(target_platform);
--
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/03: move getLatestMSBuild over to MSBuildTools
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
janpio pushed a commit to branch janpio-rework_MSBuildTools
in repository https://gitbox.apache.org/repos/asf/cordova-windows.git
commit 2bed15493bd5458a850e6b8f0068e5d9f365f8f8
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Tue Feb 13 18:29:12 2018 +0100
move getLatestMSBuild over to MSBuildTools
---
template/cordova/lib/MSBuildTools.js | 28 ++++++++++++++++++++++++++++
template/cordova/lib/build.js | 27 ++-------------------------
2 files changed, 30 insertions(+), 25 deletions(-)
diff --git a/template/cordova/lib/MSBuildTools.js b/template/cordova/lib/MSBuildTools.js
index ada837a..f974872 100644
--- a/template/cordova/lib/MSBuildTools.js
+++ b/template/cordova/lib/MSBuildTools.js
@@ -35,6 +35,7 @@ MSBuildTools.prototype.buildProject = function (projFile, buildType, buildarch,
events.emit('log', '\tConfiguration : ' + buildType);
events.emit('log', '\tPlatform : ' + buildarch);
events.emit('log', '\tBuildflags : ' + buildFlags);
+ events.emit('log', '\tMSBuildTools : ' + msbuild.path);
var checkWinSDK = function (target_platform) {
return require('./check_reqs').isWinSDKPresent(target_platform);
@@ -233,3 +234,30 @@ module.exports.getWillowInstallations = function () {
});
return installations;
};
+
+// gets the latest MSBuild version from a list of versions
+module.exports.getLatestMSBuild = function (allMsBuildVersions) {
+ events.emit('verbose', 'getLatestMSBuild');
+
+ var availableVersions = allMsBuildVersions
+ .filter(function (buildTools) {
+ // Sanitize input - filter out tools w/ invalid versions
+ return Version.tryParse(buildTools.version);
+ }).sort(function (a, b) {
+ // Sort tools list - use parsed Version objects for that
+ // to respect both major and minor versions segments
+ var parsedA = Version.fromString(a.version);
+ var parsedB = Version.fromString(b.version);
+
+ if (parsedA.gt(parsedB)) return -1;
+ if (parsedA.eq(parsedB)) return 0;
+ return 1;
+ });
+
+ console.log('availableVersions', availableVersions);
+
+ if (availableVersions.length > 0) {
+ // After sorting the first item will be the highest version available
+ return availableVersions[0];
+ }
+};
diff --git a/template/cordova/lib/build.js b/template/cordova/lib/build.js
index eeaa7e3..9dbaeef 100644
--- a/template/cordova/lib/build.js
+++ b/template/cordova/lib/build.js
@@ -24,7 +24,6 @@ var shell = require('shelljs');
var utils = require('./utils');
var prepare = require('./prepare');
var pckage = require('./package');
-var Version = require('./Version');
var MSBuildTools = require('./MSBuildTools');
var AppxManifest = require('./AppxManifest');
var ConfigParser = require('./ConfigParser');
@@ -305,7 +304,7 @@ function updateManifestWithPublisher (allMsBuildVersions, config) {
if (!config.publisherId) return;
var selectedBuildTargets = getBuildTargets(config.win, config.phone, config.projVerOverride, config);
- var msbuild = getLatestMSBuild(allMsBuildVersions);
+ var msbuild = MSBuildTools.getLatestMSBuild(allMsBuildVersions);
var myBuildTargets = filterSupportedTargets(selectedBuildTargets, msbuild);
var manifestFiles = myBuildTargets.map(function (proj) {
return projFilesToManifests[proj];
@@ -320,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.win, config.phone, config.projVerOverride, config);
- var msbuild = getLatestMSBuild(allMsBuildVersions);
+ var msbuild = MSBuildTools.getLatestMSBuild(allMsBuildVersions);
if (!msbuild) {
return Q.reject(new CordovaError('No valid MSBuild was detected for the selected target.'));
}
@@ -437,28 +436,6 @@ function clearIntermediatesAndGetPackage (bundleTerms, config, hasAnyCpu) {
return pckage.getPackageFileInfo(finalFile);
}
-function getLatestMSBuild (allMsBuildVersions) {
- var availableVersions = allMsBuildVersions
- .filter(function (buildTools) {
- // Sanitize input - filter out tools w/ invalid versions
- return Version.tryParse(buildTools.version);
- }).sort(function (a, b) {
- // Sort tools list - use parsed Version objects for that
- // to respect both major and minor versions segments
- var parsedA = Version.fromString(a.version);
- var parsedB = Version.fromString(b.version);
-
- if (parsedA.gt(parsedB)) return -1;
- if (parsedA.eq(parsedB)) return 0;
- return 1;
- });
-
- if (availableVersions.length > 0) {
- // After sorting the first item will be the highest version available
- return availableVersions[0];
- }
-}
-
// TODO: Fix this so that it outlines supported versions based on version criteria:
// - v14: Windows 8.1, Windows 10
// - v12: Windows 8.1
--
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/03: notes on method 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-rework_MSBuildTools
in repository https://gitbox.apache.org/repos/asf/cordova-windows.git
commit 0ecda20cd0716ed1e8e01c6fe5c55780d03d1b7a
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Tue Feb 13 17:23:52 2018 +0100
notes on method usage
---
template/cordova/lib/MSBuildTools.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/template/cordova/lib/MSBuildTools.js b/template/cordova/lib/MSBuildTools.js
index 7710372..ada837a 100644
--- a/template/cordova/lib/MSBuildTools.js
+++ b/template/cordova/lib/MSBuildTools.js
@@ -70,6 +70,7 @@ MSBuildTools.prototype.buildProject = function (projFile, buildType, buildarch,
};
// returns full path to msbuild tools required to build the project and tools version
+// check_reqs.js -> run()
module.exports.findAvailableVersion = function () {
var versions = ['15.0', '14.0', '12.0', '4.0'];
@@ -92,6 +93,8 @@ function findAllAvailableVersionsFallBack () {
});
}
+// build.js -> run()
+// check_reqs.js -> checkMSBuild()
module.exports.findAllAvailableVersions = function () {
// CB-11548 use VSINSTALLDIR environment if defined to find MSBuild. If VSINSTALLDIR
// is not specified or doesn't contain the MSBuild path we are looking for - fall back
@@ -155,7 +158,8 @@ function checkMSBuildVersion (version) {
});
}
-/// returns an array of available UAP Versions
+// returns an array of available UAP Versions
+// prepare.js
module.exports.getAvailableUAPVersions = function () {
var programFilesFolder = process.env['ProgramFiles(x86)'] || process.env['ProgramFiles'];
// No Program Files folder found, so we won't be able to find UAP SDK
--
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