forked from mt/oadate-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·77 lines (62 loc) · 2.82 KB
/
build.xml
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
77
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="oadate" default="test-run" basedir=".">
<description>
Ole Automation Date
</description>
<property name="ivy.install.version" value="2.0.0-beta1" />
<property name="ivy.jar.dir" value="${basedir}/ivy" />
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
<property name="build.dir" location="build"/>
<property name="src" location="src"/>
<property name="test" location="test"/>
<target name="-check-ivy-download">
<available property="skip.download" file="${ivy.jar.file}"/>
</target>
<target name="-download-ivy" depends="-check-ivy-download" unless="skip.download">
<mkdir dir="${ivy.jar.dir}"/>
<echo message="installing ivy..."/>
<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
<target name="init" depends="-download-ivy">
<tstamp/>
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
<mkdir dir="${build.dir}"/>
</target>
<target name="compile" depends="init" description="compile the source">
<javac srcdir="${src}" destdir="${build.dir}" target="1.5"/>
</target>
<target name="run" depends="compile" description="run main">
<java classpath="${build.dir}" classname="OleAutomationDate"/>
</target>
<target name="test-resolve-deps">
<ivy:retrieve />
</target>
<target name="test-compile" depends="compile,test-resolve-deps" description="compile the tests">
<ivy:cachepath pathid="ivy.classpath" conf="default" />
<javac srcdir="${test}" destdir="${build.dir}" target="1.5">
<classpath refid="ivy.classpath"/>
<classpath path="${build.dir}"/>
</javac>
</target>
<target name="test-run" depends="test-compile" description="run test tests">
<ivy:cachepath pathid="ivy.classpath" conf="default" />
<junit printsummary="true" haltonfailure="yes">
<classpath refid="ivy.classpath"/>
<classpath path="${build.dir}"/>
<formatter type="plain" usefile="false" />
<batchtest>
<fileset dir="${test}" includes="**/*Test.java"/>
</batchtest>
</junit>
</target>
<target name="clean" description="clean up" >
<delete dir="${build.dir}"/>
</target>
<target name="clean-all" depends="clean">
<delete dir="${ivy.jar.dir}"/>
<delete dir="lib"/>
</target>
</project>