aboutsummaryrefslogtreecommitdiffstats
path: root/build.xml
blob: 30ff8e77467f45d2bd1383341c735cbbcf79cf1f (plain)
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
<!-- Buildfile -->
<project name="jake2" default="jar" basedir=".">

	<!-- properties -->
	<property name="src" location="src"/>
	<property name="test" location="test"/>
	<property name="build" location="build"/>
	<property name="dist" location="dist"/>

	<!-- different classpaths -->
	<path id="build.class.path">
		<pathelement location="lib/jogl/jogl.jar"/>
	</path>
	
	<path id="test.class.path">
		<pathelement path="${build}"/>
	</path>
	
	<path id="source.path">
		<pathelement location="src"/>
	</path>
	
	<!-- initialize directories -->
	<target name="init">
		<mkdir dir="${build}"/>
		<mkdir dir="${dist}"/>
	</target>

	<!-- compile -->
	<target name="compile" depends="init">
		<javac destdir="${build}" optimize="on" debug="on" source="1.4">
			<src path="${src}"/>
			<src path="${test}"/>
			<include name="jake2/**"/>
			<classpath refid="build.class.path"/>
		</javac>
	</target>
		
	<!-- copy libs -->
	<target name="copylibs">
		<copy todir="${dist}">
			<fileset dir="lib">
				<include name="/jogl/jogl.jar"/>
			</fileset>
		</copy>
	</target>
	
	<!-- copy resources -->
	<target name="copyres">
		<copy todir="${build}">
			<fileset dir="src">
				<include name="jake2/*.properties"/>
			</fileset>
		</copy>
	</target>
		
	<!-- jar -->
	<target name="jar" depends="compile,copyres">
		<jar destfile="${dist}/jake2.jar" basedir="${build}">
			<include name="jake2/**"/>
		</jar>
	</target>
			
	<!-- everything -->
	<target name="all" depends="bindist,srcdist">
	</target>

	<!-- dist -->
	<target name="dist" depends="jar,copylibs">
	</target>
		
	<!-- binary distribution -->
	<target name="bindist" depends="dist">
		<tar destfile="jake2.tar.gz" compression="gzip">
			<tarfileset dir=".">
				<include name="dist/**"/>
			</tarfileset>
		</tar>
	</target>
	
	<!-- source distribution -->
	<target name="srcdist" >
		<tar destfile="jake2-src.tar.gz" compression="gzip">
			<tarfileset dir="." prefix="jake2">
				<include name="src/**"/>
				<include name="lib/**"/>
				<include name="build.xml"/>
			</tarfileset>
		</tar>
	</target>
	
	<!-- clean -->
	<target name="clean">
		<delete dir="${build}"/>
		<delete dir="${gensrc}"/>
	</target>
	
	<!-- distclean -->
	<target name="distclean" depends="clean">
		<delete dir="${dist}"/>
		<delete file="jake2.tar.gz"/>
		<delete file="jake2-src.tar.gz"/>
	</target>
</project>