ant-task with callback

I just felt over a stupid thing within basic ant: the return of values.

In the following script I show two ways of using antcall:

<project name="example" basedir="." default="main">
	
	<taskdef resource="net/sf/antcontrib/antcontrib.properties">
		<classpath>
			<pathelement location="${basedir}/ant-contrib-1.0b3.jar"/>
		</classpath>
	</taskdef>

	<target name="main.old">
		<antcall target="get.mails"/>
		<echo message="${mailing.list}" />
	</target>
	
	<target name="main.new">
		<antcallback target="get.mails" return="mailing.list"/>
		<echo message="${mailing.list}" />
	</target>

	<target name="get.mails">
		<loadproperties srcFile="${basedir}/mailinglist.properties" />
		<property name="mailing.list" value="${mailinglist}" />	
	</target>

</project>

the corresponding properties:

mailinglist=webmaster@christoph-burmeister.eu, webmaster@shotokanryu.de

While calling „ant main.old“ this is the result:

main.old:

get.mails:
     [echo] ${mailing.list}

BUILD SUCCESSFUL
Total time: 0 seconds

When calling „ant main.new“ this is the result in connection with the desired return-value:

main.new:

get.mails:
     [echo] webmaster@christoph-burmeister.eu, webmaster@shotokanryu.de

BUILD SUCCESSFUL
Total time: 0 seconds