Added a build-system task that builds a jar file.
[treibjagd.git] / build.xml
blob5a17334d001af31e2027267f5c132a6df7774b1d
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
3 <project name="Treibjagd" default="compile" basedir=".">
5         <path id="cp">
6                 <pathelement location="bin/classes/"/>
7                 <fileset dir="lib">
8                         <include name="*.jar"/>
9                 </fileset>
10         </path>
11         
12         
13         
14         <!--
15                 Initializes the bin directory.
16         -->
17                 
18         <target name="init">
19                 <mkdir dir="bin"/>
20                 <mkdir dir="bin/classes"/>
21         </target>
22         
23         
24         
25         <!--
26                 Deletes the bin directory and everything inside the lib directory.
27         -->
28         
29         <target name="clean">
30                 <delete dir="bin"/>
31         </target>
32         
33         
34         
35         <!--
36                 Compiles the source code.
37         -->
38         
39         <target name="compile" depends="init">
40                 <javac destdir="bin/classes" deprecation="yes">
41                         <src path="src"/>
42                         <classpath refid="cp"/>
43                 </javac>
44         </target>
45         
46         
47         
48         <!--
49                 Creates a jar file.
50         -->
51         
52         <target name="jar" depends="compile">
53                 <jar destfile="Treibjagd.jar" basedir="bin/classes">
54                         <manifest>
55                                 <attribute name="Main-Class" value="de.elrador.treibjagd.client.TreibjagdClient" />
56                                 <attribute name="Class-Path" value="lib/ioframework.jar lib/mina-core.jar lib/slf4j-api.jar lib/slf4j-simple.jar" />
57                         </manifest>
58                 </jar>
59         </target>
60         
61         
62         
63         <!--
64                 Runs the Treibjagd server.
65         -->
66         
67         <target name="run-server" depends="compile">
68                 <java classname="de.elrador.treibjagd.server.TreibjagdStarter" classpathref="cp" fork="true"/>
69         </target>
70         
71         
72         
73         <!--
74                 Runs the Treibjagd client.
75         -->
76         
77         <target name="run-client" depends="compile">
78                 <java classname="de.elrador.treibjagd.client.TreibjagdClient" classpathref="cp" fork="true"/>
79         </target>
80 </project>