views:

310

answers:

1

I am writing a small application at the moment and am trying to organise my build output to be a little closer to the finished product. The application is made up of a number of different projects. There is a core library that contains most of the functionality, a GUI app and a command line app that both reference the Core Dll, and a number of Plugin Dlls that are loaded at runtime and implement different data sources, these all reference core.dll, these also may include some other third party dlls. There are also a number of peripheral files such as a readme. And finally the core.dll and the datasource plugins are unit tested.

I would like to configure my build so that everything is output into directories as I would expect it to be when installed. I want debug and release builds to be built into different directories but otherwise have the same directory structure. I only want tests to be built for debug builds, and want them to be runnable, but seperated (I guess all test dlls would get output into a seperate directory). Here is how I imagine the structure will be.

Code/
 solutions etc here
Debug/

 Project.Core.dll
 Project.Gui.exe
 Project.Cli.exe
 readme.txt
 lib/
  ThirdParty1.dll
  ThirdParty2.dll
 DataSource/
  DataSource1.dll
  DataSource2.dll
 Tests/
  Project.Core.Tests.dll
  DataSource1.Tests.dll
Release/
 same as Debug but without tests.

Is there any way of getting a solution to build like this? I'm beginning to think it will be difficult to build the plugins and the app all from one solution, and probably not even wise, but as they will all be distributed together it would be nice. I am open to using Nant or another build tool if that will make it simpler.

+1  A: 

It is possible. Just modify OutputPath tag manually in each .csproj in both Debug and Release file to something like this

<OutputPath>..\$(Configuration)\any_subdirs</OutputPath>

You can disable tests building for Release using Configuration manager.

Juozas Kontvainis