forked from jingwei/krati
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
136 lines (114 loc) · 4.61 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="krati" default="main" basedir=".">
<property name="project.name" value="krati"/>
<property name="version" value="0.3.2"/>
<property name="krati.root" location="."/>
<property name="lib.dir" value="lib"/>
<property name="test.dir" value="test"/>
<property name="build.dir" value="build"/>
<property name="config.dir" value="config"/>
<property name="dist.dir" value="dist"/>
<property name="logs.dir" value="logs"/>
<property name="ivy.jar.dir" value="${basedir}/ivy"/>
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>
<property name="ivy.install.version" value="2.0.0-beta1"/>
<property name="src" value="src"/>
<property name="cds.src" value="cds/src"/>
<property name="test.src" value="${test.dir}/src"/>
<property name="test.build.dir" value="${test.dir}/classes"/>
<path id="compile.class.path">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<path id="java.class.path">
<dirset dir="${build.dir}">
<include name="**"/>
</dirset>
</path>
<path id="test.class.path">
<dirset dir="${test.build.dir}">
<include name="**"/>
</dirset>
</path>
<target name="download-ivy" 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="install-ivy" depends="download-ivy" description="--> install ivy">
<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"/>
</target>
<target name="resolve" description="--> retrieve dependencies with ivy" depends="install-ivy">
<ivy:retrieve />
</target>
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
<delete dir="${logs.dir}"/>
<delete dir="${test.build.dir}"/>
</target>
<target name="init" depends="resolve">
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="compile.krati" depends="init">
<javac debug="true" destdir="${build.dir}">
<src path="${src}"/>
<classpath refid="compile.class.path"/>
</javac>
</target>
<target name="compile.cds" depends="compile.krati">
<javac debug="true" destdir="${build.dir}">
<src path="${cds.src}/api"/>
<src path="${cds.src}/impl"/>
<classpath refid="java.class.path"/>
<classpath refid="compile.class.path"/>
</javac>
</target>
<target name="compile" depends="init">
<javac debug="true" destdir="${build.dir}">
<src path="${src}"/>
<src path="${cds.src}/api"/>
<src path="${cds.src}/impl"/>
<classpath refid="compile.class.path"/>
</javac>
<copy todir="${build.dir}">
<fileset dir="${config.dir}"/>
</copy>
</target>
<target name="dist" depends="compile">
<jar destfile="${dist.dir}/${project.name}-${version}.jar" basedir="${build.dir}" />
</target>
<target name="test.init" depends="compile">
<mkdir dir="${test.build.dir}"/>
</target>
<target name="test.compile" depends="test.init">
<javac debug="true" destdir="${test.build.dir}">
<src path="${test.src}"/>
<classpath refid="java.class.path"/>
<classpath refid="compile.class.path"/>
</javac>
<copy todir="${test.build.dir}">
<fileset dir="${config.dir}"/>
</copy>
</target>
<target name="test" depends="test.compile">
<junit printsummary="yes">
<jvmarg value="-Dtest.output.dir=${test.dir}/output"/>
<formatter type="brief" usefile="false"/>
<classpath>
<path refid="test.class.path"/>
<path refid="java.class.path"/>
<path refid="compile.class.path"/>
</classpath>
<batchtest fork="yes">
<fileset dir="${test.build.dir}" includes="**/Test*.class"/>
</batchtest>
</junit>
</target>
<target name="main" depends="dist">
</target>
</project>