Title: csc Task Strategies
There are ways to simplify your problem, depending on your circumstances.  I am assuming that your assemblies are strong named, so you need to reference the specific version?  Does the whole system always reference a single version of a particular assembly or could different parts reference different versions concurrently (dangerous!)
 
Assuming that you only ever use one verison of a component at a time, the way I solved this is to have a separate references.build file that defines a set of properties that define the references.  Each property can contain one or more references to an assembly so you can group logical blocks together (for example you might have 6 Customer assemblies but always reference all six if you reference "Customers", so you would have a customer.ref property that included all six) 
 
Then create a build script for each assembly, and a controlling script that builds them in the correct order. Include your references.properties file and inherit it to the sub-scripts.  Then when you reference assemblies in the <csc> task, you reference them by property rather than by assembly (I actually create a property in my init target and set that to all the references, then use that property in the <csc> task thus enableing the <csc> task to be completely generic).  If a new version comes out, you just update the references.build file with the new version/name.  This should at least make it easier to manage change.
 
HTH,
 
Bill
 
 
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Ken Witmyer
Sent: 11 July 2005 16:09
To: nant-users@lists.sourceforge.net
Subject: [Nant-users] csc Task Strategies

I recently moved to a new company and I'm trying to implement NAnt in a relatively complex build environment.  My hope is that I can bring some order to a relatively chaotic environment.  We have a ton of different assemblies that make up our business logic.  Any one assembly might reference quite a few other assemblies.  To make matters worse, the version numbers on those assemblies change frequently.  That scenario makes the csc task in NAnt a challenge because the developers must update the build script every time they change a reference.

The developers are understandably not too keen on the idea of manually maintaining these references in the build scripts.  They have proposed hooking into VS.NET's build process to mine the .csproj files and rebuild the csc tasks in the build scripts.  I'm a bit hesitant because I'd rather not abstract and automate the build scripts too much (for various reasons) plus I'm not a huge fan of integrating with VS.NET so that the user is forced to rebuild their build scripts every time they compile.

My question then, is what other people are doing to address this issue.  Basically, how do you keep your csc task references in line with reality in an environment that makes heavy use of frequently changing references?  I'd rather not use the solution task because I feel that the csc task ultimately provides for a more controlled and granular build environment.  However, using the solution task is increasingly looking like the best way to go.  Csc seems to be better suited to more stable projects (such as NAnt itself, which only makes use of a few relatively stable references).

Any thoughts on the matter would be much appreciated.

Reply via email to