1 | <?xml version="1.0"?>
|
---|
2 | <project default="cleanup" basedir=".">
|
---|
3 |
|
---|
4 | <property name="mappermillis" value="1072224000000" />
|
---|
5 |
|
---|
6 | <selector id="map.selector">
|
---|
7 | <date millis="${mappermillis}" />
|
---|
8 | </selector>
|
---|
9 |
|
---|
10 | <target name="cleanup">
|
---|
11 | <delete>
|
---|
12 | <fileset dir="." includes="touchtest*" />
|
---|
13 | </delete>
|
---|
14 | </target>
|
---|
15 |
|
---|
16 | <target name="noSeconds">
|
---|
17 | <touch file="touchtest" datetime="06/24/2003 2:20 pm"/>
|
---|
18 | </target>
|
---|
19 |
|
---|
20 | <target name="seconds">
|
---|
21 | <touch file="touchtest" datetime="06/24/2003 2:20:12 pm"/>
|
---|
22 | </target>
|
---|
23 |
|
---|
24 | <target name="testNow">
|
---|
25 | <touch file="touchtest" />
|
---|
26 | </target>
|
---|
27 |
|
---|
28 | <target name="testMillis">
|
---|
29 | <!-- this one is about 21 years after the epoch -->
|
---|
30 | <!-- less than 20 years after the epoch, test does not pass on my Win2K/FAT -->
|
---|
31 | <!-- Antoine February 8, 2004 -->
|
---|
32 | <!-- see http://developer.java.sun.com/developer/bugParade/bugs/4177432.html -->
|
---|
33 | <!-- and http://developer.java.sun.com/developer/bugParade/bugs/4697792.html -->
|
---|
34 | <!-- not sure why -->
|
---|
35 | <touch file="touchtest" millis="662256000000" />
|
---|
36 | </target>
|
---|
37 |
|
---|
38 | <target name="test2000">
|
---|
39 | <!-- this number of milliseconds is 30 * 365 * 24 * 3600 * 1000 -->
|
---|
40 | <!-- so the corresponding time is at the end of 1999 -->
|
---|
41 | <touch file="touchtest" millis="946080000000" />
|
---|
42 | </target>
|
---|
43 |
|
---|
44 | <target name="testFilelist">
|
---|
45 | <touch millis="662256000000" >
|
---|
46 | <filelist dir="." files="touchtest"/>
|
---|
47 | </touch>
|
---|
48 | </target>
|
---|
49 |
|
---|
50 | <target name="testFileset" depends="testNow">
|
---|
51 | <touch millis="946080000000" >
|
---|
52 | <fileset dir="." includes="touchtest"/>
|
---|
53 | </touch>
|
---|
54 | </target>
|
---|
55 |
|
---|
56 | <target name="testMappedFileset">
|
---|
57 | <touch file="touchtest" millis="${mappermillis}" />
|
---|
58 | <touch>
|
---|
59 | <fileset file="touchtest" />
|
---|
60 | <compositemapper>
|
---|
61 | <globmapper from="*" to="*foo" />
|
---|
62 | <globmapper from="*" to="*bar" />
|
---|
63 | </compositemapper>
|
---|
64 | </touch>
|
---|
65 |
|
---|
66 | <fileset id="touchtest" file="touchtest">
|
---|
67 | <selector refid="map.selector" />
|
---|
68 | </fileset>
|
---|
69 |
|
---|
70 | <fileset id="touchtestfoo" file="touchtestfoo">
|
---|
71 | <selector refid="map.selector" />
|
---|
72 | </fileset>
|
---|
73 |
|
---|
74 | <fileset id="touchtestbar" file="touchtestbar">
|
---|
75 | <selector refid="map.selector" />
|
---|
76 | </fileset>
|
---|
77 |
|
---|
78 | <pathconvert property="touchtest" pathsep=" "
|
---|
79 | refid="touchtest" setonempty="false" />
|
---|
80 |
|
---|
81 | <pathconvert property="touchtestfoo" pathsep=" "
|
---|
82 | refid="touchtestfoo" setonempty="false" />
|
---|
83 |
|
---|
84 | <pathconvert property="touchtestbar" pathsep=" "
|
---|
85 | refid="touchtestbar" setonempty="false" />
|
---|
86 |
|
---|
87 | <fail>
|
---|
88 | <condition>
|
---|
89 | <not>
|
---|
90 | <and>
|
---|
91 | <isset property="touchtest" />
|
---|
92 | <isset property="touchtestfoo" />
|
---|
93 | <isset property="touchtestbar" />
|
---|
94 | </and>
|
---|
95 | </not>
|
---|
96 | </condition>
|
---|
97 | </fail>
|
---|
98 |
|
---|
99 | </target>
|
---|
100 |
|
---|
101 | <target name="testExplicitMappedFileset">
|
---|
102 | <touch file="touchtest" millis="${mappermillis}" />
|
---|
103 | <touch>
|
---|
104 | <fileset file="touchtest" />
|
---|
105 | <mapper>
|
---|
106 | <compositemapper>
|
---|
107 | <globmapper from="*" to="*foo" />
|
---|
108 | <globmapper from="*" to="*bar" />
|
---|
109 | </compositemapper>
|
---|
110 | </mapper>
|
---|
111 | </touch>
|
---|
112 |
|
---|
113 | <fileset id="touchtest" file="touchtest">
|
---|
114 | <selector refid="map.selector" />
|
---|
115 | </fileset>
|
---|
116 |
|
---|
117 | <fileset id="touchtestfoo" file="touchtestfoo">
|
---|
118 | <selector refid="map.selector" />
|
---|
119 | </fileset>
|
---|
120 |
|
---|
121 | <fileset id="touchtestbar" file="touchtestbar">
|
---|
122 | <selector refid="map.selector" />
|
---|
123 | </fileset>
|
---|
124 |
|
---|
125 | <pathconvert property="touchtest" pathsep=" "
|
---|
126 | refid="touchtest" setonempty="false" />
|
---|
127 |
|
---|
128 | <pathconvert property="touchtestfoo" pathsep=" "
|
---|
129 | refid="touchtestfoo" setonempty="false" />
|
---|
130 |
|
---|
131 | <pathconvert property="touchtestbar" pathsep=" "
|
---|
132 | refid="touchtestbar" setonempty="false" />
|
---|
133 |
|
---|
134 | <fail>
|
---|
135 | <condition>
|
---|
136 | <not>
|
---|
137 | <and>
|
---|
138 | <isset property="touchtest" />
|
---|
139 | <isset property="touchtestfoo" />
|
---|
140 | <isset property="touchtestbar" />
|
---|
141 | </and>
|
---|
142 | </not>
|
---|
143 | </condition>
|
---|
144 | </fail>
|
---|
145 |
|
---|
146 | </target>
|
---|
147 |
|
---|
148 | <target name="testMappedFilelist">
|
---|
149 | <touch millis="${mappermillis}">
|
---|
150 | <filelist dir="." files="idonotexist" />
|
---|
151 | <mergemapper to="touchtest" />
|
---|
152 | </touch>
|
---|
153 |
|
---|
154 | <fileset id="touchtest" file="touchtest">
|
---|
155 | <selector refid="map.selector" />
|
---|
156 | </fileset>
|
---|
157 |
|
---|
158 | <pathconvert property="touchtest" pathsep=" "
|
---|
159 | refid="touchtest" setonempty="false" />
|
---|
160 |
|
---|
161 | <fail>
|
---|
162 | <condition>
|
---|
163 | <not>
|
---|
164 | <isset property="touchtest" />
|
---|
165 | </not>
|
---|
166 | </condition>
|
---|
167 | </fail>
|
---|
168 |
|
---|
169 | </target>
|
---|
170 |
|
---|
171 | <target name="testGoodPattern">
|
---|
172 | <touch file="touchtest" datetime="06242003142012GMTfoo" pattern="MMddyyyyHHmmssz'foo'" />
|
---|
173 |
|
---|
174 | <fileset id="touchtest" file="touchtest">
|
---|
175 | <date millis="1056464412000" />
|
---|
176 | </fileset>
|
---|
177 |
|
---|
178 | <pathconvert property="touchtest" pathsep=" "
|
---|
179 | refid="touchtest" setonempty="false" />
|
---|
180 |
|
---|
181 | <fail>
|
---|
182 | <condition>
|
---|
183 | <not>
|
---|
184 | <isset property="touchtest" />
|
---|
185 | </not>
|
---|
186 | </condition>
|
---|
187 | </fail>
|
---|
188 | </target>
|
---|
189 |
|
---|
190 | <target name="testBadPattern">
|
---|
191 | <touch file="touchtest" datetime="06242003142012GMTfoo" pattern="MMddyyyyHHmmssz'bar'" />
|
---|
192 | </target>
|
---|
193 |
|
---|
194 | </project>
|
---|