hoffi/gulp-msbuild

Gulp stream does not return if there are no errors and emitPublishedFiles: false

Closed this issue · 2 comments

The addition of the "emitPublishedFiles" option has broken our gulp pipeline.

gulp-msbuild is called as follows:

gulp.task('msbuild:build', function() {
	console.log(gutil.colors.cyan('Starting MSBuild'));
	
	return gulp
        .src('*.sln')
        .pipe(msbuild({
            targets: ['Clean', 'Build'],
            configuration: settings.build.PROFILE,
            toolsVersion: process.platform === 'win32' ? 14.0 : 15.0,
            logCommand: true,
            errorOnFail: true,
            stdout: settings.build.DEBUG,
            consoleLoggerParameters: 'ErrorsOnly'
        }));
});

The gulp output shows:

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:01.61
[14:39:27] MSBuild complete!
[14:39:27] The following tasks did not complete: docker:default, build, msbuild:build
[14:39:27] Did you forget to signal async completion?

This is due to change #57 - since emitPublishedFiles is false by default, the execution never reaches return callback().

We can work around this by forcing return callback() to always be called or by setting emitPublishedFiles to true.

hoffi commented

Thanks, I have added the missing callback when emitPublishedFiles is false in version 0.5.1

Great, thanks