Skip to content

Commit

Permalink
Automatically detect MSBuild tools version in Windows platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Schulte committed Apr 6, 2016
1 parent 97545e3 commit 94b15ef
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,23 @@ gulp.task('regenerate:expected:samples:azure', function(){
}
});

var msBuildToolsVersion = 12.0;
if (isWindows) {
fs.readdirSync('C:/Program Files (x86)/MSBuild/').forEach(function (item) {
var itemAsFloat = parseFloat(item);
if (itemAsFloat > msBuildToolsVersion) {
msBuildToolsVersion = itemAsFloat;
}
});
}

var msbuildDefaults = {
stdout: process.stdout,
stderr: process.stderr,
maxBuffer: MAX_BUFFER,
verbosity: 'minimal',
errorOnFail: true,
toolsVersion: 12.0
toolsVersion: msBuildToolsVersion
};

gulp.task('clean:node_modules', function(cb) {
Expand Down

0 comments on commit 94b15ef

Please sign in to comment.