-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathbuild.xml
99 lines (86 loc) · 3.58 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
<?xml version="1.0" ?>
<!--
Welcome into MarteEngine ant buildfile. For more information about ant see http://ant.apache.org/
This build configuration does 2 things:
- Distribute MarteEngine as a jar file and put it in the dist dir
- Create the javadoc in the docs dir
For the build to succeed:
- All source code should be in the src dir
- Slick.jar and lwjgl.jar should be in the lib dir
-->
<project name="MarteEngine" default="jar">
<property name="me.name" value="MarteEngine"/>
<property name="me.version" value="0.3"/>
<property name="me.java.version" value="1.6"/>
<property name="src.dir" value="src/main/java"/>
<property name="lib.dir" value="lib"/>
<property name="dist.dir" value="dist"/>
<property name="build.dir" value="bin"/>
<property name="javadoc.dir" value="docs"/>
<path id="build.path">
<pathelement path="${lib.dir}/slick.jar"/>
<pathelement path="${lib.dir}/lwjgl.jar"/>
</path>
<target name="clean" description="Clean output directories">
<delete includeEmptyDirs="true" failonerror="false" quiet="true">
<fileset dir="${build.dir}"/>
<fileset dir="${dist.dir}"/>
</delete>
<fail message="Unable to delete previous build directories">
<condition>
<or>
<available file="${dist.dir}" type="dir"/>
<available file="${build.dir}" type="dir"/>
</or>
</condition>
</fail>
</target>
<target name="dir" depends="clean" description="Create directories">
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="compile" depends="dir" description="Compile source code">
<javac srcdir="${src.dir}"
destdir="${build.dir}"
classpathref="build.path"
includeantruntime="false"
debug="on"
fork="true"
source="${me.java.version}"
target="${me.java.version}">
</javac>
</target>
<target name="jar" depends="compile" description="Create the distribution jar containing the compiled files">
<buildnumber file="build.num"/>
<tstamp>
<format property="TODAY" pattern="dd-MM-yyyy HH:mm:ss"/>
</tstamp>
<jar destfile="${dist.dir}/${me.name}-${me.version}.jar">
<manifest>
<attribute name="MarteEngine-Version" value="${me.version}"/>
<attribute name="MarteEngine-Build-Number" value="b${build.number}"/>
<attribute name="Built-Date" value="${TODAY}"/>
</manifest>
<fileset dir="${build.dir}"/>
</jar>
<delete includeEmptyDirs="true" failonerror="false" quiet="true">
<fileset dir="${build.dir}"/>
</delete>
</target>
<target name="jar sources" description="Create a jar containing the source files">
<delete file="dist/${me.name}-${me.version}-sources.jar"/>
<jar destfile="dist/${me.name}-${me.version}-sources.jar"
basedir="src"/>
</target>
<target name="javadoc" description="Generate Javadoc">
<mkdir dir="${javadoc.dir}"/>
<javadoc sourcepath="${src.dir}"
destdir="${javadoc.dir}"
classpathref="build.path"
access="public"
windowtitle="${me.name} - Javadoc"
author="false"
version="true">
</javadoc>
</target>
</project>