| 1 | <project default="invalid"> |
| 2 | <target name="invalid"> |
| 3 | <fail>Don't call this file directly.</fail> |
| 4 | </target> |
| 5 | |
| 6 | <target name="setup"> |
| 7 | <taskdef resource="net/sf/antcontrib/antcontrib.properties"> |
| 8 | <classpath location="${antcontrib.jar}"/> |
| 9 | </taskdef> |
| 10 | </target> |
| 11 | |
| 12 | <target name="fullTest" depends="setup"> |
| 13 | <trycatch property="foo" reference="bar"> |
| 14 | <try> |
| 15 | <fail>Tada!</fail> |
| 16 | </try> |
| 17 | |
| 18 | <catch> |
| 19 | <echo>In <catch>.</echo> |
| 20 | </catch> |
| 21 | |
| 22 | <finally> |
| 23 | <echo>In <finally>.</echo> |
| 24 | </finally> |
| 25 | </trycatch> |
| 26 | </target> |
| 27 | |
| 28 | <target name="twoCatches" depends="setup"> |
| 29 | <trycatch> |
| 30 | <try> |
| 31 | <fail>Tada!</fail> |
| 32 | </try> |
| 33 | |
| 34 | <catch> |
| 35 | <echo>In <catch>.</echo> |
| 36 | </catch> |
| 37 | |
| 38 | <catch> |
| 39 | <echo>In <catch2>.</echo> |
| 40 | </catch> |
| 41 | </trycatch> |
| 42 | </target> |
| 43 | |
| 44 | <target name="twoFinallys" depends="setup"> |
| 45 | <trycatch> |
| 46 | <try> |
| 47 | <fail>Tada!</fail> |
| 48 | </try> |
| 49 | |
| 50 | <finally> |
| 51 | <echo>In <finally>.</echo> |
| 52 | </finally> |
| 53 | |
| 54 | <finally> |
| 55 | <echo>In <finally2>.</echo> |
| 56 | </finally> |
| 57 | </trycatch> |
| 58 | </target> |
| 59 | |
| 60 | <target name="twoTrys" depends="setup"> |
| 61 | <trycatch> |
| 62 | <try> |
| 63 | <fail>Tada!</fail> |
| 64 | </try> |
| 65 | |
| 66 | <try> |
| 67 | <fail>Tada!</fail> |
| 68 | </try> |
| 69 | |
| 70 | <catch> |
| 71 | <echo>In <catch>.</echo> |
| 72 | </catch> |
| 73 | |
| 74 | <finally> |
| 75 | <echo>In <finally>.</echo> |
| 76 | </finally> |
| 77 | </trycatch> |
| 78 | </target> |
| 79 | |
| 80 | <target name="noTry" depends="setup"> |
| 81 | <trycatch> |
| 82 | <catch> |
| 83 | <echo>In <catch>.</echo> |
| 84 | </catch> |
| 85 | |
| 86 | <finally> |
| 87 | <echo>In <finally>.</echo> |
| 88 | </finally> |
| 89 | </trycatch> |
| 90 | </target> |
| 91 | |
| 92 | <target name="noException" depends="setup"> |
| 93 | <trycatch property="foo" reference="bar"> |
| 94 | <try> |
| 95 | <echo>Tada!</echo> |
| 96 | </try> |
| 97 | |
| 98 | <catch> |
| 99 | <echo>In <catch>.</echo> |
| 100 | </catch> |
| 101 | |
| 102 | <finally> |
| 103 | <echo>In <finally>.</echo> |
| 104 | </finally> |
| 105 | </trycatch> |
| 106 | </target> |
| 107 | |
| 108 | </project> |