Build/Test Issues

Disable bower/gulp/etc. in NCrunch builds?

Started by bstenzel on 4,955 views

I'm currently working on project that uses an AngularJS frontend with an WebAPI backend. The frontend uses bower to load the dependencies and gulp to concat/uglify/etc. and builds an index page for development with all the necessary script references. It currently takes NCrunch ~25 seconds to build the assemblies and run the tests. Too long for TDD for my taste.

Is there any way to disable the bower and gulp tasks for NCrunch? I tried excluding js and json files, but to no avail.
Hi,

Thanks for posting.

I admit that I'm not sure how bower and gulp are integrated into your build, but normally build integration is done with custom build targets hooked in with build <Import> tags inside the project XML.

NCrunch has an environment variable that it always sets when building your project. It's possible to use this to create conditional build behaviour. See http://www.ncrunch.net/documentation/troubleshooting_ncrunch-specific-overrides for more information on this.

If you can find the gulp/bower build targets or imports, you should easily be able to use this to suppress them for NCrunch builds by adding an MSBuild condition to the Import or target invocation.

Edited

Thanks for your reply. Dead-on; bower and gulp are integrated with custom build targets. Prefixing all the conditions with "'$(NCrunch)' != '1' And " brought the build time in NCrunch down to under one second. There's still a curious delay of a couple seconds before it actually runs the tests. Would be nice to find the cause of that too, but it's already a lot better than before. Good enough for TDD again. ;)

Thanks again and keep up the great work!
bstenzel wrote:Thanks for your reply. Dead-on; bower and gulp are integrated with custom build targets. Prefixing all the conditions with "'$(NCrunch)' != '1' And " brought the build time in NCrunch down to under one second. There's still a curious delay of a couple seconds before it actually runs the tests. Would be nice to find the cause of that too, but it's already a lot better than before. Good enough for TDD again. ;)


There is a feature coming soon that hopefully can tell us what this delay is :)

bstenzel wrote:
Thanks again and keep up the great work!


Welcome!
Just a heads up: the weird delay had nothing to do with NCrunch. I still had the Fusion logs active from debugging a linker error in a different project, so the delay came from writing hundreds of MB of fusion logs. ;)

Post a reply

Log in to reply.