I have done this:

Defined my Macro outside of a <target>.    This is because it is called
from many targets.
Within the macro's <sequential>, I have a <fail> (with message!).
Works a treat.


-----Original Message-----
From: Mayuresh Kshirsagar [mailto:[EMAIL PROTECTED] 
Sent: 21 July 2006 11:04
To: Ant Users List
Subject: RE: problem with <fail/>

Basically this is a customized test suite that I am trying out. I tried
to define a macro in a different target and then use it in another
target.

Regards,
Mayuresh.

-----Original Message-----
From: Mayuresh Kshirsagar
Sent: Friday, July 21, 2006 3:31 PM
To: 'Ant Users List'
Subject: RE: problem with <fail/>

I see that only if fail is called from the scope of the <target> atg, it
fails the build. I have some more customized tasks, even if fail is
called from them, it doesn't fail.

Is this understanding correct?

-----Original Message-----
From: Anderson, Rob (Global Trade) [mailto:[EMAIL PROTECTED]
Sent: Friday, July 21, 2006 2:01 AM
To: Ant Users List
Subject: RE: problem with <fail/>

> -----Original Message-----
> From: Matt Benson [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 20, 2006 1:00 PM
> To: Ant Users List
> Subject: RE: problem with <fail/>
> 
> --- "Anderson, Rob (Global Trade)"
> <[EMAIL PROTECTED]> wrote:
> 
> > A macrodef would probably belong outside of a target.
> 
> Usually, but for completeness' sake I'd like to point out that a 
> common exception would be conditional macro definition.

Indeed, good point. -Rob A

> > Also, I don't see
> > where you are actually executing the task you define with the 
> > macrodef.
> 
> Right.
> 
> -Matt
> 
> 
> > What is the output of your build?
> > 
> > -Rob Anderson
> > 
> > > -----Original Message-----
> > > From: Mayuresh Kshirsagar
> > [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, July 20, 2006 6:11 AM
> > > To: Ant Users List
> > > Subject: problem with <fail/>
> > > 
> > > Hi I am trying the following block:
> > > 
> > > <target name="init">
> > >   <tstamp/>
> > >   
> > >   <macrodef name="ReadConfig">
> > >           <attribute name="buildType" default="all"/>
> > >           <element name="SomeMoreTasks" optional="true"/>
> > >           <sequential>
> > >                   <echo message="The build type is
> > @{buildType}"/>
> > >                   <echo message="Reading property file
> @{buildType}.cfg"/>
> > >                   
> > >                   <!--Check if the config file is available-->
> > >                   <assert>
> > >                           <available file="@{buildType}.cfg"/>
> > >                   </assert>
> > >                   
> > >                   <property file="@{buildType}.cfg"/>
> > >                   <SomeMoreTasks/>
> > >                   <fail/>
> > >           </sequential>
> > >   </macrodef>
> > > </target>
> > > 
> > > But the fail as I have placed doesn't fail the
> > build. Only if
> > > I place fail outside macrodef, then alone does the
> > build
> > > file. How can I make the build file by placing
> > <fail/> where it is?
> > > 
> > > 
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to