cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [1/2] git commit: CB-6397 [windows8] Use the latest version of MSBuild Tools installed to build the app
Date Tue, 08 Apr 2014 20:03:20 GMT
Repository: cordova-windows
Updated Branches:
  refs/heads/master c4dabc9fd -> a3d0be201


CB-6397 [windows8] Use the latest version of MSBuild Tools installed to build the app


Project: http://git-wip-us.apache.org/repos/asf/cordova-windows/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-windows/commit/599a78bc
Tree: http://git-wip-us.apache.org/repos/asf/cordova-windows/tree/599a78bc
Diff: http://git-wip-us.apache.org/repos/asf/cordova-windows/diff/599a78bc

Branch: refs/heads/master
Commit: 599a78bcec6fb200bb2e0e7116acd78452277212
Parents: ca106cf
Author: sgrebnov <v-segreb@microsoft.com>
Authored: Thu Apr 3 21:12:07 2014 +0400
Committer: sgrebnov <v-segreb@microsoft.com>
Committed: Thu Apr 3 21:12:07 2014 +0400

----------------------------------------------------------------------
 windows8/template/cordova/lib/build.js | 30 ++++++++---------------------
 1 file changed, 8 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/599a78bc/windows8/template/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/windows8/template/cordova/lib/build.js b/windows8/template/cordova/lib/build.js
index 77296e0..812c08b 100644
--- a/windows8/template/cordova/lib/build.js
+++ b/windows8/template/cordova/lib/build.js
@@ -107,29 +107,15 @@ function getSolutionDir(path) {
 
 // returns full path to msbuild tools required to build the project
 function getMSBuildToolsPath(path) {
-    // target windows8 by default
-    var MSBuildVer = '4.0';
-    var installInstructions = 'Please install the .NET Framework v4.0.';
-    // windows8.1 template requires msbuild v12.0
-    // get tools version from jsproj file
-    var proj_folder = fso.GetFolder(path);
-    var proj_files = new Enumerator(proj_folder.Files);
-    for (;!proj_files.atEnd(); proj_files.moveNext()) {
-        if (fso.GetExtensionName(proj_files.item()) == 'jsproj' && 
-            fso.OpenTextFile(proj_files.item(), 1).ReadAll().indexOf('ToolsVersion="12.0"')
> 0) {
-                MSBuildVer = '12.0';
-                installInstructions = 'Please install Microsoft Visual Studio 2013 or later';
-        }
+    // use the latest version of the msbuild tools available on this machine
+    var toolsVersions = ['12.0', '4.0'];
+    for (idx in toolsVersions) {
+        try {
+            return wscript_shell.RegRead('HKLM\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\'
+ toolsVersions[idx] + '\\MSBuildToolsPath');
+        } catch(err) {}
     }
-    Log('\tMSBuild version required: ' + MSBuildVer);
-    try {
-        return wscript_shell.RegRead('HKLM\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\'
+ MSBuildVer + '\\MSBuildToolsPath');
-    } catch (err) {
-        Log(installInstructions, true);
-        WScript.Quit(2);
-    }
-    
-    return MSBuildToolsPath;
+    Log('MSBuild tools have not been found. Please install Microsoft Visual Studio 2012 or
later', true);
+    WScript.Quit(2);
 }
 
 // builds the project and .xap in debug mode


Mime
View raw message