ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knuplesch, Juergen" <Juergen.Knuple...@icongmbh.de>
Subject AW: Calling a cmd batch file from Ant
Date Wed, 28 May 2008 08:05:27 GMT
If you use <ant> Task or <antcall>  you can run the target with different content
of a property. 
E.g.

<antcall target="your.target" inheritall="false">
 	          <param name="your.property" value="value1" />
 	        </antcall>

<antcall target="your.target" inheritall="false">
 	          <param name="your.property" value="value2" />
 	        </antcall>

I even use this in <for> loops made with antcontrb.



-- 
Jürgen Knuplesch                    www.icongmbh.de
icon Systemhaus GmbH                Tel. +49 711 806098-275
Sophienstraße 40                    
D-70178 Stuttgart                   Fax. +49 711 806098-299

Geschäftsführer: Uwe Seltmann
HRB Stuttgart 17655
USt-IdNr.: DE 811944121 
-----Ursprüngliche Nachricht-----
Von: Chris Green [mailto:chris.green100@googlemail.com] 
Gesendet: Mittwoch, 28. Mai 2008 09:51
An: Ant Users List
Cc: Jan.Materne@rzf.fin-nrw.de
Betreff: Re: Calling a cmd batch file from Ant

The reason I'm not using ant is that :-

1. My main build.xml script calls the component.xml script numerous times.
2. Each time the component.xml script is called, the variable 'component'
needs to be set to something different.
3. Component.xml is generic therefore don't want to hard code anything variables in 4. Once
variable set, can't be changed.

Honestly, there is some underlying logic behind all of this.

Chris

On Wed, May 28, 2008 at 9:41 AM, <Jan.Materne@rzf.fin-nrw.de> wrote:

> > I am calling a dos batch file from an Ant script using the following 
> > code :-
> >
> > <property name="dos" location="c:/windows/system32/cmd.exe"/>
> >
> >
> > <exec executable="${dos}" dir="c:/build/">
> >           <arg value="CommonCommponent.bat"/> </exec>
> >
> > On the assumption that I get the Microsoft Windows Copyright info 
> > appear, I assume the above commands are running ok. The only trouble 
> > is, the contents / commands in the batch file don't seen to get 
> > executed.
>
>
> http://ant.apache.org/faq.html#batch-shell-execute
>
>
> > Batch file contents are :-
> >
> > set component=common
> > ant -f %build.dir%/component.xml
>
> Why not use <ant> ?
>
>
> Jan
>
> ---------------------------------------------------------------------
> 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