ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dave young <dyo...@bsis.com.au>
Subject keeping/returning property settings from within a task [newbie]
Date Thu, 05 Jul 2001 07:52:11 GMT
Thanks to dianne and stefan who have already helped me out with a couple
of dilemnas recently. I now have another, I hope somebody out there will
be able to assist me with it.

If i run a build.xml like the following and the file
archive-format-alpha.tar.gz exists in my current directory;

<task name="grind">
    <available file="archive-format-alpha.tar.gz"
property="alpha.present"/>
    <available file="archive-format-beta..tar.gz"
property="beta.present"/>
    <antcall target="setup_alpha_if_present"/>
    <antcall target="setup_beta_if_present"/>
    <echo message="version is ${version}"/>
</task>

<task name="setup_alpha_if_present" if="alpha.present">
    <property name="version" value="alpha"/>
    <echo "in setup_alpha version=${version}"/>
</task>

<task name="setup_beta_if_present" if="beta.present">
    <property name="version value="beta"/>
    <echo "in setup_beta version=${version}"/>
</task>

ant i enter the command; ant grind
i would expect to see;
in setup_alpha version=alpha
version=alpha

but instead i see;
in setup_alpha_version=alpha
version=${version}

is this correct?

is it right that property assignments do not propogate from within
tasks? am i just being incredibly dumb (again)? is there a way to ensure
that property changes from within sub-tasks propogate back to calling
tasks?

any help appreciated.

regards,

dave young.

Mime
View raw message