We have a number of Nant scripts which compile .NET code. These builds are taking 5 – 10 minutes to run, and I would like to find a way to speed them up.
Our Nant script looks something like
<target name="compile.XYZ" description="Compiles the source code">
<msbuild project="${src.dir}\XYZ.sln" verbosity="${build.verbosity}">
<property name="Configuration" value="${build.config}" />
<property name="OutputPath" value="${build.fullpath}/${prefix.xyz}" />
<property name="ReferencePath" value="${assembly.dir}" />
</msbuild>
</target>
They are all quite similar to this. I did investigate for nant but it looked a little out of date so I’m a bit hesitant to use it, although this could be quite handy as we do have multiple targets in our build.
Any help you could provide in improving the performance of these builds would be greatly appreciated!
Thanks 🙂
The more projects you have in your solution the longer the build will take.
Same with number of solutions.
Nothing really you can do about that.
By the way, it isn’t Nant thats slow here, its msbuild.
You could try some of the suggestions from Scott Hanselsman:
http://www.hanselman.com/blog/FasterBuildsWithMSBuildUsingParallelBuildsAndMulticoreCPUs.aspx
In effect this requires you to pass along “BuildInParallel=”true”” to the task, although there are certain caveats.
This will allow projects within the same solution to be built in parallel, but I don’t see a way to build multiple solutions in parallel.
For that, you could make a meta-solution (maintained only by hand, or autogenerated in nant before the build is done) where you add all the different projects to it.