0
votes

I'm trying to move .NET CI from Nant to MSBuild to bypass the Nant Solution task limitations but I'm not able to reproduce the Nant assembly reference behavior. Nant solution task looks inside VS projects for binary references and converts them in project references if the project is included inside the solution. In my organization developers works with binary references to base libraries but during nightly builds I would like to build everything from source. I can create a solution file with all the projects changing output dir by it seems I must specify build order manually, a big work. There's a way of doing such a thing or I'm doing something wrong? I would like to use this script with TeamCity or CruiseControl.Net

<solution configuration="release" outputdir="C:\output\bin">
  <projects>
    <include name="ProjectA.csproj" />
    <include name="ProjectB.csproj" />
    <include name="ProjectC.csproj" />
  </projects>
</solution>

If ProjectA reference projectB.dll and ProjectB reference projectC.dll Nant performs the build in the following order: ProjectC-ProjectB-ProjectA, using as reference the output of the compiled projects.

1
Please show us the codeOur Man in Bananas
Added sample script.Stevie B. Gibson

1 Answers

0
votes

I would stick with Nant, and in nant call msbuild to compile your solution. just use the exec task to call msbuild and you have full control over all arguments. Changing from nant to msbuild requires a mind shift :-)

Normally every project has a 'lib' folder, and that folder is known. Get the source from all projects, compile C and copy it to lib of B and so on. This is indeed a manual task, but dependencies do not change that much.

For a more automated way, maybe the following link can help you http://blog.dantup.com/2012/05/free-dependency-graph-generation-using-powershell-and-yuml/

There are other free libraries you could use if you google around a bit, I do not know which one would suits you best.