[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

AW: [Subclipse-users] scope of revisionProperty from status in svn-ant task

From: Oliver Niekrenz <oliver_at_niekrenz.de>
Date: 2006-10-19 18:35:56 CEST

> A property is usually only visible within the "target" it was created a-la
> a local variable.

Sorry, this is wrong.

Ant properties are globally visible, there are no local properties.
If you define 'repos.version' in 'update' it can be visible in 'build', it's just a matter of invocation.

'antcall' is the reason for this behaviour. All changes of an antcall invocation will not reflect to it's callee.
So the only reason for using antcall is using side effects. A side effect is something that has impact on the script's environment like creating or checking out a file or something else that can be detected by the callee target or changes the script's behaviour. But anyway it will come from outside the script.

However if you typed

<target name="build" depends="update">

you would've seen the value of repos.version

It's like the difference between a procedure and a function. A pure function (without sideeffects) returns a value. It solely relies on it's argument and does not change anything else. A procedure on the other side would be pretty much useless without sideeffects if you think over it.
So antcall is like a procedure and depends="target,othertarget..." is like a crippled function construction. There are no real functions in ant (Tigris' antelope tasks has a AntCallBack task though which behaves like one), again changes beside side effects can only be done by setting properties.

> <echo>${repos.version}</echo> <!-- will display blank! -->

Well, not quite blank. If a property is not set 'echo' will output '${repos.version}' verbatim.

Hope this helped,
Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subclipse.tigris.org
For additional commands, e-mail: users-help@subclipse.tigris.org
Received on Thu Oct 19 18:36:06 2006

This is an archived mail posted to the Subclipse Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.