ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charl Gerber <>
Subject Problem setting variables conditionally
Date Fri, 28 Jan 2005 14:15:58 GMT
Hi have this problem:

Set a global variable 'env' in my ant script based on:

the command line value, if not set, then
environment variable value, if not set, then
default value

I have this in my project root, ie, not in a target,
but it does not work:


  <property environment="ENV" />

  <target name="">
      <antcall target="check.environment.env" />
      <property name="env" value="LOC" />
  <target name="check.environment.env"
      <property name="env" value="${ENV.env}"/>

The 'env' properties in these contexts are not visible
outside the targets and only set locally. Ie, I cannot
set a global property this way. I aslo cannot find a
way to do an "if-then-else" in the project root.




To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message