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

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

commit 933d2f23832b80e52be977714d2333fdddfbf0d5
Author: Jan Piotrowski <piotrow...@gmail.com>
AuthorDate: Wed Feb 14 19:17:05 2018 +0100

    move method
---
 template/cordova/lib/MSBuildTools.js | 54 ++++++++++++++++++------------------
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/template/cordova/lib/MSBuildTools.js 
b/template/cordova/lib/MSBuildTools.js
index fa4ca38..adb2676 100644
--- a/template/cordova/lib/MSBuildTools.js
+++ b/template/cordova/lib/MSBuildTools.js
@@ -210,6 +210,33 @@ module.exports.getAvailableUAPVersions = function () {
     return result;
 };
 
+// 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];
+    }
+};
+
 /**
  * Lists all VS 2017+ instances dirs in ProgramData
  *
@@ -259,30 +286,3 @@ 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];
-    }
-};

-- 
To stop receiving notification emails like this one, please contact
jan...@apache.org.

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

Reply via email to