ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charl Gerber <charlger...@yahoo.com>
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:

<project...

  <property environment="ENV" />

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

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.

Suggestions?

Thanks

Charl


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


Mime
View raw message