-
Notifications
You must be signed in to change notification settings - Fork 26
/
build.xml
104 lines (88 loc) · 3.03 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="lightstone" default="build" xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="src" location="src" />
<property name="test" location="test" />
<property name="bin" location="bin" />
<property name="lib" location="lib" />
<property name="doc" location="doc" />
<property name="jar" value="lightstone.jar" />
<property name="main-class" value="net.lightstone.Server" />
<fileset id="libraries" dir="${lib}">
<include name="**/*.jar" />
</fileset>
<fileset id="tests" dir="${bin}">
<include name="**/*Test.class" />
</fileset>
<fileset id="production-classes" dir="${bin}">
<include name="**/*.class" />
<exclude name="**/*Test.class" />
<exclude name="**/package-info.class" />
</fileset>
<path id="binary-path">
<pathelement path="${bin}" />
</path>
<path id="library-path">
<fileset refid="libraries" />
</path>
<path id="master-path">
<path refid="binary-path" />
<path refid="library-path" />
</path>
<target name="init">
<mkdir dir="${bin}" />
<mkdir dir="${doc}" />
<mkdir dir="${lib}" />
</target>
<target name="resolve" depends="init">
<ivy:retrieve pattern="${lib}/[artifact]-[revision].[ext]" sync="true" />
</target>
<target name="build" depends="init">
<javac destdir="${bin}" includeantruntime="false">
<src path="${src}" />
<src path="${test}" />
<classpath refid="library-path" />
</javac>
</target>
<target name="clean">
<delete dir="${bin}" />
<delete dir="${doc}" />
<delete file="${jar}" />
</target>
<target name="rebuild" depends="clean, build" />
<target name="test" depends="build">
<junit fork="true" haltonfailure="true">
<classpath refid="master-path" />
<formatter type="brief" usefile="false" />
<batchtest>
<fileset refid="tests" />
</batchtest>
</junit>
</target>
<target name="run" depends="build">
<java classpathref="master-path" fork="true" classname="${main-class}" />
</target>
<target name="doc" depends="build">
<javadoc sourcepath="${src}" classpathref="master-path" destdir="${doc}" access="private" windowtitle="Lightstone Documentation">
<doclet name="org.jboss.apiviz.APIviz" pathref="library-path">
<param name="-sourceclasspath" value="${bin}" />
<param name="-author" />
<param name="-version" />
<param name="-use" />
<param name="-nopackagediagram" />
</doclet>
<doctitle><![CDATA[<h1>Lightstone Documentation</h1>]]></doctitle>
<link href="http://download.oracle.com/javase/6/docs/api/" />
<link href="http://docs.jboss.org/netty/3.2/api/" />
<link href="http://jruby.org/apidocs/" />
</javadoc>
</target>
<target name="jar" depends="build">
<jar destfile="${jar}">
<zipgroupfileset refid="libraries" />
<fileset refid="production-classes" />
<manifest>
<attribute name="Main-Class" value="${main-class}" />
</manifest>
</jar>
</target>
</project>