By trial and error I got ANT example below working.
Looks like <first>
is something executed before any target invoked.
E.g. ${foundSrcFiles} can be used in (any) target with found files
being displayed.
It's just I didn't find this documented anywhere. Anyone a link to description???
<project basedir="./example4" default="fourthTarget">
<property name="dir.src">src</property>
<first id="foundAnyJavaFile">
<!-- but things you can do here are limited. -->
<!-- property name="dir.classes"> doesn't e.g. work... -->
<fileset dir="${dir.src}" includes="**/*.java"/>
</first>
<property name="foundSrcFiles" refid="foundAnyJavaFile"/>
...
</project>