-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
147 lines (119 loc) · 4.91 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
137
138
139
140
141
142
143
144
145
146
147
<?xml version="1.0" encoding="UTF-8"?>
<project name="JERPA" default="makejar" basedir=".">
<!-- domovský adresář jaru -->
<property name="projecthome" value="." />
<!-- verze jaru -->
<property name="version" value="1.1.0-SNAPSHOT" />
<!-- symbolický název jaru -->
<property name="jarname" value="${ant.project.name}" />
<!-- autor -->
<property name="author" value="Vaclav Souhrada" />
<property name="src" location="${projecthome}/src" />
<property name="build" location="${projecthome}/bin" />
<property name="dist" location="${projecthome}/dist" />
<property name="config" location="${projecthome}/config" />
<property name="lib" location="${projecthome}/lib" />
<property name="plugins" location="${projecthome}/plugins" />
<property name="dir.javadoc" location="${projecthome}/docs/javadoc" />
<property name="dir.test-src" location="${projecthome}/test-src" />
<property name="dir.test-bin" location="${projecthome}/test-bin" />
<property name="runloc" location="${dist}" />
<property name="buildfilename" value="${jarname}-${version}.jar" />
<path id="bnd.classpath">
<pathelement location="${dist}/${buildfilename}" />
</path>
<path id="compile.class.path">
<fileset dir=".">
<include name="lib/**/*.jar" />
</fileset>
</path>
<path id="test.class.path">
<pathelement location="${dir.test-bin}" />
<pathelement location="${src}" />
<path refid="compile.class.path" />
</path>
<target name="init">
<mkdir dir="${build}" />
<mkdir dir="${dist}" />
<mkdir dir="${dir.test-bin}" />
<manifestclasspath property="lib.list" jarfile="${dist}/${buildfilename}">
<classpath refid="compile.class.path" />
</manifestclasspath>
</target>
<target name="compile" depends="init">
<javac srcdir="${src}" destdir="${build}" classpathref="compile.class.path" debug="on">
<compilerarg value="-Xlint:none" />
</javac>
</target>
<target name="copy_img" depends="compile">
<copy todir="${build}/ch/ethz/origo/jerpa/data/images/">
<fileset dir="${src}/ch/ethz/origo/jerpa/data/images/" />
</copy>
</target>
<target name="makejar" description="generate the distribution" depends="copy_img">
<mkdir dir="${dist}" />
<jar jarfile="${dist}/${buildfilename}" basedir="${build}">
<manifest>
<attribute name="Main-Class" value="ch.ethz.origo.jerpa.application.Main" />
<attribute name="Class-Path" value="${lib.list}" />
</manifest>
</jar>
<copy todir="${dist}/config">
<fileset dir="${config}/" />
</copy>
<copy todir="${dist}/plugins">
<fileset dir="${plugins}/" />
</copy>
</target>
<!-- automatický úklid po kompilaci a vytvoření bundelu-->
<target name="autoclean">
<delete dir="${build}" />
<delete dir="${dist}" />
<delete dir="${dir.test-bin}" />
</target>
<!-- ručně prováděný úklid -->
<target name="clean">
<antcall target="autoclean" />
<delete dir="${dist}" />
</target>
<target name="run">
<echo message="Starting.." />
<java jar="${runloc}/${buildfilename}" fork="true" dir="${projecthome}">
</java>
<echo message="Shutting down..." />
</target>
<target name="javadoc">
<javadoc excludepackagenames="ch.ethz.origo.jerpa.test" access="public" destdir="${dir.javadoc}" author="true" version="true" use="true" windowtitle="${jarname}-${version}" doctitle="${jarname}-${version} Javadoc">
<fileset dir="${src}" defaultexcludes="yes">
<include name="**/*.java" />
<exclude name="ch/ethz/origo/jerpa/test/**/*.java" />
</fileset>
</javadoc>
</target>
<target name="compile-test" depends="init">
<javac srcdir="${dir.test-src}:${src}" destdir="${dir.test-bin}" classpathref="compile.class.path" debug="on">
<compilerarg value="-Xlint:none" />
</javac>
</target>
<target name="clean-test">
<delete>
<fileset dir="${dir.test-bin}" includes="**/*.class" />
<fileset dir="${src}" includes="**/*.class" />
</delete>
<delete dir="${dir.test-bin}" />
</target>
<target name="test" depends="compile-test">
<junit showoutput="true" fork="true"
failureproperty="tests.failed"
errorproperty="tests.failed"
printsummary="true"
haltonfailure="true"
dir="${dir.test-bin}">
<classpath refid="test.class.path" />
<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="${dir.test-bin}" includes="**/*Test.class" />
</batchtest>
</junit>
</target>
</project>