I once tried a setup where I had a few common targets in an include file. To use them I just needed to include the include file and then specify the target on the command line or as part of another target’s dependency list. Perhaps, the problem you’re facing is different than this… I’ve found that as long as the common parts are 100% identical (or can be made 100% identical) the include mechanism works beautifully. I usually run into problems when I have common sections but the “child” scripts need to do extra things before or after. I can’t think of any good suggestions…

 

I’m having a hard time understanding why the child scripts want to know about the parent script… I’m just trying to understand the problem before I make a fool of myself… (or am I too late for that…?)

 

--Edwin

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Aaron Elder
Sent: Monday, November 22, 2004 12:21 PM
To: [EMAIL PROTECTED]
Subject: [Nant-users] Best Pattern for a Project

 

Hey everyone,

 

I am running into a bit of a road block and I would like to ask everyone’s advise on the best pattern for a project.  Here are the basics of the project:

 

-       I have 1 “Business Logic DLL” which must be built first

-       I have 1 WinForm EXE which depends on the Business Logic DLL

-       I have 1 VS Setup Project which depends on the top two items

 

I have the first two components building independently, but now that I want to come up with a clean total project build solution I am having trouble.  I have started down several roads and none seem very clean.  Here is what I want:

 

-       A common project.include file that sets up all my standard Project Properties

-       A common project.include file that has a common set of Targets (“Clean” and “Build”) that always run when either the DLL or EXE Clean / Build targets are called.

-       A way to include a common AssemblyInfo.CS file in both the DLL & EXE

-       Perhaps a way for the child .build files to be aware of the parent.

 

 

I started off with 3 build files and 1 .included file.  The problems I have are:

 

-       I can get the top most build file to call the other build files, and the dependencies work… but there is no way for the child projects to be aware of each other.  Only the parent knows what is best.

-       My .include file has a Clean & Build Target, as do my 2 child .build files – this leads to a “Duplicate” target error.  I would like to have a default set of tasks defined for all Builds and all Clean calls anywhere in the tree.

The main issue is that most of these problems appear to be solvable with lots of copying and pasting.  But I would like to avoid that.  I want as much common stuff in common files and I want the including of those common files to be as easy as possible.  (For example, it would be nice if the .include file knew to add the AssemblyInfo.cs file as part of all builds)  Without me having to add it manually to all targets.

 

I am working now on a very small project, but this is just a test… a typical project for us will have lots of dependencies and projects.  So want to find a good pattern now.

 

Thanks for your thoughts!

Aaron Elder
Director, Software Development

invokesystems
solid technology. sound thinking.
http://www.invokesystems.com

v: 425.818.5262
c: 425.761.7940
f: 425.818.5220
e: [EMAIL PROTECTED]

 

Reply via email to