Skip to content

IlyaBiryukov/gulp-msbuild

 
 

Repository files navigation

gulp-msbuild

NPM NPM downloads Travis Coveralls David License

msbuild plugin for gulp. Inspired by grunt-msbuild

Usage

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());
});

Options

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
			})
		);
});

stdout

Show output of msbuild

Default: false

stderr

Show errors of msbuild

Default: true

errorOnFail

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

logCommand

Logs the msbuild command that will be executed.

Default: false

maxBuffer

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

targets

Specify Build Targets

Default:

['Rebuild']

configuration

Specify Build Configuration (Release or Debug)

Default: Release

Hint: You can also specify the Build Configuration using the properties option

properties: { Configuration: 'Debug' }

toolsVersion

Specify the .NET Tools-Version

Default: 4.0

Possible Values: 1.0, 1.1, 2.0, 3.5, 4.0, 12.0, 14.0

architecture

Specify the Architecture

Default: Auto-detected

Possible Values: x86, x64

Example:

msbuild({ architecture: 'x86' })

properties

Specify Custom Build Properties

Default: none

Example:

msbuild({ properties: { WarningLevel: 2 } })

verbosity

Specify the Build Verbosity

Default: normal

Possible Values: quiet, minimal, normal, detailed, diagnostic

maxcpucount

Specify Maximal CPU-Count to use

Default: 0 = Automatic selection

Possible Values: -1 (MSBuild Default), 0 (Automatic), > 0 (Concrete value)

nologo

Suppress Startup Banner and Copyright Message of MSBuild

Default: false

fileLoggerParameters

Specify the parameters for the MSBuild File Logger.

Default: None

Example:

msbuild({ fileLoggerParameters: 'LogFile=Build.log;Append;Verbosity=diagnostic' })

consoleLoggerParameters

Specify the parameters for the MSBuild Console Logger. (See fileLoggerParameters for a usage example)

Default: None

MSBuild Command-Line Reference

For a more detailed description of each MSBuild Option see the MSBuild Command-Line Reference

License

MIT License

About

msbuild plugin for gulp

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%