ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nico Seessle" <Nico.Sees...@epost.de>
Subject Re: variables and exec task
Date Fri, 26 Jan 2001 22:36:57 GMT
----- Original Message -----
From: "Patrick Moylan" <pat@loudeye.com>
To: <ant-user@jakarta.apache.org>
Sent: Friday, January 26, 2001 10:48 PM
Subject: variables and exec task


> I am currently passing some variables into my buildscript using the -D
> switch. After having built I run an exec task which basicaly creates a
label
> based on a predefined client spec, and then checks it in. I use the
> ${BUILDNUM} as the label name.
>
> My problem is I cant get ant to do anything except to run my bat file, the
> bat file doesnt reckognize any ant variables. Is there away with the exec
> task to pass something more than just the basic exec? Imagine if i wanted
to
> pass "p4 info" rather than just "p4" or passing "label.bat ${BUILDNUM}"
> instead of just "label.bat"
>

Sorry that I ask you, but you have looked at the documentation? (should be
docs/index.html)

If you want to pass argument to a command use

<exec executable="yourCommand">
  <arg value="yourFirstArgument"/>
  <arg value="yourSecondArgument"/>
</exec>

You can then use the values inside your batch-file as %1 and %2.

If you want to use the properties as environment-variables (%BUILDNUM% in
your batch-file) you could use

<exec executable="yourCommand">
  <env key="BUILDNUM" value="{BUILDNUM}"/>
</exec>

Does this help you? Do you think the documentation can be improved in this
part? If yes, do you have a suggestion what should be added as an example?

Nico



Mime
View raw message