-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
38 lines (38 loc) · 1.7 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
<?xml version="1.0" ?>
<project name="MyProject" basedir="." default="jarfile">
<target name="init" description="Initializes properties">
<property name="project.name" value="SUPERNOID" />
<property name="src.dir" value="src" />
<property name="main.class" value="SUPERNOID.Main" />
<property name="build.dir" value="build" />
<property name="classes.dir" value="${build.dir}/classes" />
<property name="lib.dir" value="lib" />
<property name="resources.dir" value="resources"/>
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar" />
</path>
</target>
<target name="prepare" description="Creates the build and classes directories" depends="init">
<mkdir dir="${classes.dir}" />
</target>
<target name="compile" description="Compiles the source code" depends="prepare">
<javac srcdir="${src.dir}" destdir="${classes.dir}">
<classpath refid="classpath"/>
</javac>
</target>
<target name="jarfile" description="Archives the code" depends="compile">
<jar destfile="${build.dir}/${project.name}.jar" basedir="${classes.dir}">
<manifest>
<attribute name="Main-Class" value="${main.class}" />
<attribute name="Class-Path" value="${lib.dir} ${resources.dir}" />
</manifest>
<zipgroupfileset dir="${lib.dir}" includes="*.jar"/>
<fileset dir=".">
<include name="**/${resources.dir}/**"/>
</fileset>
</jar>
</target>
<target name="clean" description="Clean up project" depends="init">
<delete dir="${build.dir}" />
</target>
</project>