Title: Message
thank you both.  The "force" attribute looks especially promising, but I'll make sure I'm not missing something with <include>.
 
Bruce
-----Original Message-----
From: Morris, Jason [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 12:26 PM
To: [EMAIL PROTECTED]
Subject: RE: [Nant-users] how to make a build file more concise

I was thinking the same thing as Anthony was, however you might want to watch out for a couple of things.
 
First, if you need to call the same target multiple times, make sure you add force="true" to your call task.  nAnt keeps track of which targets it has already executed.
 
Also, do these targets depend on one another?  Can you set up the targets to depend on one another to simplify the calling structure?  For example,
 
    <target name="document" depends="compile" />
 
Finally, if you do <include> these four different build files, you will need to have all the targets have unique names.  In my build files, I have the following target types:   prep, fetch, build, deploy, promote, and release.  Then I have separate build files for each component of my system, so for component1 the targets are named:  prep-component1, fetch-compoent2, etc.
 
I hope this helps.
 
Jason
 
-----Original Message-----
From: Anthony Francisco [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 1:08 PM
To: 'Hearn, Bruce'; [EMAIL PROTECTED]
Subject: RE: [Nant-users] how to make a build file more concise

On first glance it almost seems like a perfect use of <include> until reading the fine print about <include> is to be used only on the top level.
 
<call> may do what you need. I would try creating a target named "doit" which has all the <nant> tasks, and simply do a <call name="doit"> for each of your targets.
 
I'll give this a try tonight.
 
- Ants
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hearn, Bruce
Sent: Wednesday, 26 March, 2003 11:35
To: [EMAIL PROTECTED]
Subject: [Nant-users] how to make a build file more concise

Hi,

 

I use a main build file to execute a number of tasks in sub-build files.  I want to be able to support the ability to run nant like this:

 

nant clean compile document

 

So my main file is currently of this form:

 

            <target name="compile" description="build the code">

                        <property name="the.target" value="compile"/>

                        <nant buildfile="Common\Common.build" target="${the.target}"/>

                        <nant buildfile="DataAccess\DataAccess.build" target="${the.target}"/>

                        <nant buildfile="Business\ Business.build" target="${the.target}"/>

                        <nant buildfile="Presentation\ Presentation.build" target="${the.target}"/>

            </target>

 

            <target name="document" description="document the code">

                        <property name="the.target" value="document"/>

                        <nant buildfile="Common\Common.build" target="${the.target}"/>

                        <nant buildfile="DataAccess\DataAccess.build" target="${the.target}"/>

                        <nant buildfile="Business\ Business.build" target="${the.target}"/>

                        <nant buildfile="Presentation\ Presentation.build" target="${the.target}"/>

            </target>

           

            <target name="clean" description="clean up old build output" >

                        <property name="the.target" value="clean"/>

                        <nant buildfile="Common\Common.build" target="${the.target}"/>

                        <nant buildfile="DataAccess\DataAccess.build" target="${the.target}"/>

                        <nant buildfile="Business\ Business.build" target="${the.target}"/>

                        <nant buildfile="Presentation\ Presentation.build" target="${the.target}"/>

            </target>

 

My question: is there a way to do this more concisely, so I don't have to repeat that same block of nant tasks 3 times in the build file?  I do want to keep the overall clean, compile, and document processes totally distinct, so that all the clean tasks run before all the compile tasks.

 

Thanks,

 

Bruce

 

-----Original Message-----
From: Anthony Francisco [mailto:[EMAIL PROTECTED]
Sent:
Wednesday, March 26, 2003 3:01 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [nant-dev] How to use nunit2 task

 

I getting a crash in NAnt when trying to use the nunit2 task.

 

I tried using the nunit2 task using the following in my build script:

 

 <target name="test" depends="build" description="Runs NUnit tests">
  <nunit2>
   <test assemblyname="Reveal.exe" />
  </nunit2>
 </target>

The result I get is:
INTERNAL ERROR
System.IO.FileLoadException: Unable to load file 'nunit.framework'.
File name: "nunit.framework"

 

Server stack trace:
   at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, B
oolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound, Ass
embly locationHint, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Boolean
stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence as
semblySecurity, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(String assemblyName, String typeName, Bool
ean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureI
nfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMar
k& stackMark)
   at System.Activator.CreateInstance(String assemblyName, String typeName, Bool
ean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureI
nfo culture, Object[] activationAttributes, Evidence securityInfo)
   at System.AppDomain.CreateInstance(String assemblyName, String typeName, Bool
ean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureI
nfo culture, Object[] activationAttributes, Evidence securityAttributes)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(M
ethodBase mb, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInC
ontext, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMes
sage msg, Int32 methodPtr, Boolean fExecuteInContext)

 

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req
Msg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa
ta, Int32 type)
   at System.AppDomain.CreateInstance(String assemblyName, String typeName, Bool
ean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureI
nfo culture, Object[] activationAttributes, Evidence securityAttributes)
   at SourceForge.NAnt.Tasks.NUnit2.NUnit2TestDomain.CreateTestRunner(AppDomain
domain)
   at SourceForge.NAnt.Tasks.NUnit2.NUnit2TestDomain.Run(String assemblyFile, St
ring configFilePath, EventListener listener)
   at SourceForge.NAnt.Tasks.NUnit2.NUnit2Task.RunRemoteTest(NUnit2Test test, Ev
entListener listener)
   at SourceForge.NAnt.Tasks.NUnit2.NUnit2Task.ExecuteTask()
   at SourceForge.NAnt.Task.Execute()
   at SourceForge.NAnt.Target.Execute()
   at SourceForge.NAnt.Project.Execute(String targetName)
   at SourceForge.NAnt.Project.Execute()
   at SourceForge.NAnt.Project.Run()

 

Fusion log follows:

 

Please send bug report to [EMAIL PROTECTED]
Try 'nant -help' for more information

I can run nunit-console just fine from the command-line, but NAnt seems unable to be crashing.

 

Is there anything special I need to do to my NT CMD shell ?

 

- Ants

Reply via email to