hoffi / gulp-msbuild

gulp-msbuild has moved to https://github.com/fluffynuts/gulp-msbuild.
MIT License
53 stars 44 forks source link

Run using child_process `spawn` rather than `exec` #34

Closed mhh closed 8 years ago

mhh commented 8 years ago

This PR modifies gulp-msbuild so that it will execute MSBuild using child_process.spawn instead of child_process.exec.

There are a few benefits to doing so:

mhh commented 8 years ago

@redwards1966 I just read about the problem you reported in issue #24 -- I'd be curious to know if xbuild still works for you when using this branch?

hoffi commented 8 years ago

Really like your solution. Thanks!

I have tried the example from #24 using this solution with xbuild and it worked for me.

But if the build fails and i have turned errorOnFail on i get this at the end:

[19:06:24] Build failed with code 1!
[19:06:24] 'default' errored after 268 ms
Error: [object Object]
    at formatError (/usr/local/lib/node_modules/gulp/bin/gulp.js:169:10)
    at Gulp.<anonymous> (/usr/local/lib/node_modules/gulp/bin/gulp.js:195:15)
    at emitOne (events.js:77:13)
    at Gulp.emit (events.js:169:7)

I think this is because of line 41 in msbuild-runner.js because gulp expects an error object as callback argument.

mhh commented 8 years ago

Thank you for the feedback, @hoffi. Commit 31ab100 should address that problem.

hoffi commented 8 years ago

Looks good to me. Thank you very much :+1: