summaryrefslogtreecommitdiffstats
path: root/test/resources/logic/timestampselector.xml
blob: dd92eb3ede7a0b3e75848ffdb66b3fbda4c5fd63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<project default="init">
    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
        <classpath location="${antcontrib.jar}"/>
    </taskdef>

    <property name="test.dir" value="timestampselector"/>
    <property name="test.file1" location="${test.dir}/file1.txt" />
    <property name="test.file2" location="${test.dir}/file2.txt" />
    <property name="test.dir1" location="${test.dir}/dir1" />
    <property name="test.dir2" location="${test.dir}/dir2" />

    <fileset id="test.files" dir="${test.dir}">
        <include name="*.txt" />
    </fileset>

    <path id="test.files.path">
        <fileset refid="test.files" />
    </path>

    <dirset id="test.dirs" dir="${test.dir}">
        <include name="dir*" />
    </dirset>

    <path id="test.dirs.path">
        <dirset refid="test.dirs" />
    </path>

    <target name="init">
        <delete quiet ="yes" dir="${test.dir}"/>
        <mkdir  dir="${test.dir}"/>
        <touch  file="${test.dir}/file1.txt" />
        <touch  file="${test.dir}/file2.txt" />
        <mkdir  dir="${test.dir}/dir1"/>
        <mkdir  dir="${test.dir}/dir2"/>
    </target>

    <target name="teardown">
        <delete quiet="yes" dir="${test.dir}" />
    </target>

    <target name="filestamp.fl" depends="init">
        <timestampselector property="latest.fl.tstamp">
            <path>
                <fileset refid="test.files" />
            </path>
        </timestampselector>

        <echo message="${latest.fl.tstamp}" />
    </target>

    <target name="filestamp.pr" depends="init">
        <timestampselector property="latest.pr.tstamp"
            pathref="test.files.path" />

        <echo message="${latest.pr.tstamp}" />
    </target>

    <target name="dirstamp.dl" depends="init">
        <timestampselector property="latest.dl.tstamp">
            <path>
                <dirset refid="test.dirs" />
            </path>
        </timestampselector>

        <echo message="${latest.dl.tstamp}" />

    </target>

    <target name="dirstamp.pr" depends="init">
        <timestampselector property="latest.pr.tstamp"
                         pathref="test.dirs.path" />

        <echo message="${latest.pr.tstamp}" />
    </target>

</project>