ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Melih Onvural <melih.onvu...@gmail.com>
Subject <foreach> behavior on properties... is it a bug? or by design?
Date Sat, 26 Sep 2009 02:24:52 GMT
I noticed that when I run targets in a <foreach> loop, that they don't
know of properties that were set in previous targets or in targets
which
are dependencies of the given target. As an example:

<foreach target="getcssfiles" param="localedir">
     <path>
          <dirset dir="${project.dir}/santiago/locale" includes="*/**"
excludes="*Apple*"></dirset>
     </path>
</foreach>

in target with name of getcssfiles, I don't know what my build number
is. However, if I add a param to the <foreach> loop, then I can pass
through
whatever properties I want, and they are available to the target in
the <foreach> loop.

e.g. this works:

<foreach target="getcssfiles" param="localedir">
     <param name="build.num" value="${build.num}" />
     <path>
          <dirset dir="${project.dir}/santiago/locale" includes="*/**"
excludes="*Apple*"></dirset>
     </path>
</foreach>

Is not inheriting properties in a <foreach> loop by design? It feels
like a bug to me, but I didn't want to log it as a bug until I was
sure that it really
was one.

Thanks,
-- 
Melih Onvural
http://www.onvural.net/melih

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


Mime
View raw message