ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Madunic <haj...@imag.net>
Subject RE: newbie help: conditional exec
Date Tue, 11 Sep 2007 19:24:14 GMT
Sorry I didn't give enough info.

Since I'm a relative newbie to ant I create a pipeline task not relying on any
other target. So in the example below my workflow looks like the following:

unzip archive of xml files
filter xml files
parse xml files (will create CSV\csvArt.xml if there are any type="articles")
<exec> bcp csv to SQLServer

So what I wanted to insert in my flow was
<available file="CSV\csvArt.xml" property="artAvailable" />
after the parse xml files
then test the value of artAvailable and if true <exec> bcp into SQLServer

Is this possible? or a pointer to an example or tutorial.

Marijan (Mario) Madunic


Quoting "Anderson, Rob (Global Trade)" <Rob.Anderson@nike.com>:

> Use the if attribute of <target>...
> 
> <target name="exec-something" if="artAvailable">
>  <exec ...
> </target>
> 
> Be aware that this does not test the value of the artAvailable property,
> only whether or not it exists. See the manual for more info.
> 
> http://ant.apache.org/manual/using.html#targets
> 
> 
> -Rob Anderson
> 
> > -----Original Message-----
> > From: Mario Madunic [mailto:hajduk@imag.net] 
> > Sent: Tuesday, September 11, 2007 10:40 AM
> > To: user@ant.apache.org
> > Subject: newbie help: conditional exec
> > 
> > I have the following in my ant task to test for the existence 
> > of an xml file after processing
> > 
> > <available file="CSV\csvArt.xml" property="artAvailable" />
> > 
> > What I want to do is run <exec> based on the above property 
> > value of true. I can't seem to find a task to do this. Any 
> > help will be appreciated.
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For 
> > additional commands, e-mail: user-help@ant.apache.org
> > 
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message