msbuild plugin for gulp. Inspired by grunt-msbuild
First, install gulp-msbuild
as a development dependency:
npm install --save-dev gulp-msbuild
Then, add it to your gulpfile.js
:
var gulp = require("gulp");
var msbuild = require("gulp-msbuild");
gulp.task("default", function() {
return gulp.src("./project.sln")
.pipe(msbuild());
});
Example
var gulp = require("gulp");
var msbuild = require("gulp-msbuild");
gulp.task("default", function() {
return gulp.src("./project.sln")
.pipe(msbuild({
targets: ['Clean', 'Build'],
toolsVersion: 3.5
})
);
});
Show output of msbuild
Default: false
Show errors of msbuild
Default: true
If the MSBuild job fails with an error, this will cause the gulp-msbuild stream to return an error thus causing the gulp task to fail. This is useful if using an automated build server such as Jenkins where a failing MSBuild should also cause the overall build job to fail.
Default: false
Logs the msbuild command that will be executed.
Default: false
Specifies the largest amount of data allowed on stdout or stderr - if this value is exceeded then the msbuild child process is killed.
Default: 500*1024
Specify Build Targets
Default:
['Rebuild']
Specify Build Configuration (Release or Debug)
Default: Release
Hint: You can also specify the Build Configuration using the properties option
properties: { Configuration: 'Debug' }
Specify the .NET Tools-Version
Default: 4.0
Possible Values: 1.0, 1.1, 2.0, 3.5, 4.0, 12.0, 14.0
Specify the Architecture
Default: Auto-detected
Possible Values: x86, x64
Example:
msbuild({ architecture: 'x86' })
Specify Custom Build Properties
Default: none
Example:
msbuild({ properties: { WarningLevel: 2 } })
Specify the Build Verbosity
Default: normal
Possible Values: quiet, minimal, normal, detailed, diagnostic
Specify Maximal CPU-Count to use
Default: 0 = Automatic selection
Possible Values: -1 (MSBuild Default), 0 (Automatic), > 0 (Concrete value)
Suppress Startup Banner and Copyright Message of MSBuild
Default: false
Specify the parameters for the MSBuild File Logger.
Default: None
Example:
msbuild({ fileLoggerParameters: 'LogFile=Build.log;Append;Verbosity=diagnostic' })
Specify the parameters for the MSBuild Console Logger. (See fileLoggerParameters for a usage example)
Default: None
For a more detailed description of each MSBuild Option see the MSBuild Command-Line Reference