[14627] | 1 | <?xml version="1.0"?>
|
---|
| 2 | <project name ="calltarget-test" default="testinheritreffileset" basedir=".">
|
---|
| 3 | <property name="tmp.dir" value="tmp.dir" />
|
---|
| 4 | <target name="setup">
|
---|
| 5 | <mkdir dir="${tmp.dir}"/>
|
---|
| 6 | </target>
|
---|
| 7 | <target name="cleanup">
|
---|
| 8 | <delete dir="${tmp.dir}" quiet="true"/>
|
---|
| 9 | </target>
|
---|
| 10 | <target name="mytarget">
|
---|
| 11 | <pathconvert property="myproperty" targetos="unix" refid="myfileset"/>
|
---|
| 12 | <echo message="myproperty=${myproperty}"/>
|
---|
| 13 | </target>
|
---|
| 14 | <target name="testinheritreffileset">
|
---|
| 15 | <!-- this testcase should show that the fileset defined here
|
---|
| 16 | can be read in the called target -->
|
---|
| 17 | <fileset dir="." id="myfileset">
|
---|
| 18 | <include name="calltarget.xml"/>
|
---|
| 19 | </fileset>
|
---|
| 20 | <antcall target="mytarget" inheritrefs="true"/>
|
---|
| 21 | </target>
|
---|
| 22 | <target name="copytest2">
|
---|
| 23 | <copy file="${tmp.dir}/copytest.in" toFile="${tmp.dir}/copytest1.out" overwrite="true">
|
---|
| 24 | <filterset refid="foo"/>
|
---|
| 25 | </copy>
|
---|
| 26 | </target>
|
---|
| 27 | <target name="testinheritreffilterset" depends="setup">
|
---|
| 28 | <echo file="${tmp.dir}/copytest.in">@@foo@@</echo>
|
---|
| 29 | <filterset id="foo" begintoken="@@" endtoken="@@">
|
---|
| 30 | <filter token="foo" value="bar"/>
|
---|
| 31 | </filterset>
|
---|
| 32 | <antcall target="copytest2" inheritrefs="true"/>
|
---|
| 33 | <copy file="${tmp.dir}/copytest.in" toFile="${tmp.dir}/copytest2.out" overwrite="true">
|
---|
| 34 | <filterset refid="foo"/>
|
---|
| 35 | </copy>
|
---|
| 36 | <loadfile srcFile="${tmp.dir}/copytest2.out" property="copytest2"/>
|
---|
| 37 | <loadfile srcFile="${tmp.dir}/copytest1.out" property="copytest1"/>
|
---|
| 38 | <condition property="success">
|
---|
| 39 | <equals arg1="${copytest1}" arg2="${copytest2}"/>
|
---|
| 40 | </condition>
|
---|
| 41 | <fail message="filterset not properly passed across by antcall" unless="success"/>
|
---|
| 42 | </target>
|
---|
| 43 |
|
---|
| 44 | <property name="multi" value="DEFAULT"/>
|
---|
| 45 | <target name="multi">
|
---|
| 46 | <echo>multi is ${multi}</echo>
|
---|
| 47 | </target>
|
---|
| 48 | <target name="call-multi">
|
---|
| 49 | <antcall target="multi">
|
---|
| 50 | <param name="multi" value="SET"/>
|
---|
| 51 | </antcall>
|
---|
| 52 | </target>
|
---|
| 53 |
|
---|
| 54 | <target name="blank-target">
|
---|
| 55 | <antcall>
|
---|
| 56 | <target name="" />
|
---|
| 57 | </antcall>
|
---|
| 58 | </target>
|
---|
| 59 |
|
---|
| 60 | <target name="multiple-targets">
|
---|
| 61 | <antcall>
|
---|
| 62 | <target name="ta" />
|
---|
| 63 | <target name="tb" />
|
---|
| 64 | <target name="tc" />
|
---|
| 65 | </antcall>
|
---|
| 66 | </target>
|
---|
| 67 |
|
---|
| 68 | <target name="multiple-targets-2">
|
---|
| 69 | <ant antfile="ant.xml">
|
---|
| 70 | <target name="tb" />
|
---|
| 71 | <target name="da" />
|
---|
| 72 | </ant>
|
---|
| 73 | </target>
|
---|
| 74 |
|
---|
| 75 | <target name="ta"><echo>ta</echo></target>
|
---|
| 76 | <target name="tb" depends="da,dc"><echo>tb</echo></target>
|
---|
| 77 | <target name="tc" depends="db,dc"><echo>tc</echo></target>
|
---|
| 78 |
|
---|
| 79 | <target name="da"><echo>da</echo></target>
|
---|
| 80 | <target name="db"><echo>db</echo></target>
|
---|
| 81 | <target name="dc"><echo>dc</echo></target>
|
---|
| 82 |
|
---|
| 83 | </project>
|
---|