-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.xml
122 lines (107 loc) · 3.77 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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="java-mateview" default="test" basedir=".">
<property name="build.dir" location="bin" />
<property name="src.dir" location="src" />
<property name="test.dir" location="test" />
<property name="lib.dir" location="lib" />
<property name="resources.dir" location="resources" />
<property name="build.prod.dir" location="${build.dir}" />
<property name="build.test.dir" location="${build.dir}/test" />
<property name="test.report.dir" location="${build.dir}/test-reports" />
<property name="build.compiler" value="javac1.6"/>
<condition property="platform" value="osx">
<and>
<os family="mac" />
<os family="unix" />
<os arch="i386" />
</and>
</condition>
<condition property="platform" value="osx64">
<and>
<os family="mac" />
<os family="unix" />
<os arch="x86_64" />
</and>
</condition>
<condition property="platform" value="linux">
<and>
<os family="unix" />
<os arch="i386" />
</and>
</condition>
<condition property="platform" value="linux64">
<and>
<os family="unix" />
<os arch="amd64" />
</and>
</condition>
<condition property="platform" value="windows">
<os family="windows" />
</condition>
<path id="project.classpath">
<pathelement location="${build.prod.dir}" />
<pathelement location="${build.test.dir}" />
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
<fileset dir="${lib.dir}/${platform}">
<include name="*.jar" />
</fileset>
</path>
<target name="clean">
<delete dir="${build.dir}" />
</target>
<target name="debug" description="--> description">
<echo message="using platform: [${platform}]" />
<!-- get the source compile classpath in a printable form -->
<pathconvert pathsep="${line.separator}| |-- " property="echo.path" refid="project.classpath" />
<echo message="|-- compile classpath"/>
<echo message="| |"/>
<echo message="| |-- ${echo.path}"/>
</target>
<target name="prepare" depends="clean,debug">
<mkdir dir="${build.prod.dir}" />
<mkdir dir="${build.test.dir}" />
<copy todir="${build.prod.dir}">
<fileset dir="${resources.dir}">
<include name="*" />
</fileset>
</copy>
</target>
<target name="jar" depends="compile">
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpathref="project.classpath" />
<delete dir="release"/>
<mkdir dir="release"/>
<jarjar destfile="release/java-mateview.jar" basedir="${build.prod.dir}">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Class-Path" value=". lib vendor" />
</manifest>
<!-- also pack up all the system independent runtime deps -->
<!--<zipgroupfileset dir="${lib.dir}" includes="*.jar"/>-->
</jarjar>
</target>
<target name="compile" depends="prepare">
<javac target="1.5" srcdir="${src.dir}" destdir="${build.prod.dir}" debug="true">
<classpath refid="project.classpath" />
</javac>
</target>
<target name="compile-tests" depends="compile">
<javac srcdir="${test.dir}" destdir="${build.test.dir}" debug="true">
<classpath refid="project.classpath" />
</javac>
</target>
<target name="test" depends="compile-tests">
<delete dir="${test.report.dir}" />
<mkdir dir="${test.report.dir}" />
<junit errorproperty="test.failed" failureproperty="test.failed">
<classpath refid="project.classpath" />
<formatter type="brief" usefile="false" />
<formatter type="xml" usefile="true" />
<batchtest todir="${test.report.dir}">
<fileset dir="${build.test.dir}" includes="**/*Test.class" />
</batchtest>
</junit>
<fail message="one or more tests failed!" if="test.failed" />
</target>
</project>