-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
73 lines (62 loc) · 2.32 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
<project name="blokus_2021_client" basedir="." default="main">
<property name="game_name" value="blokus_2021"/>
<property name="build.dir" value="build"/>
<property name="lib.dir" value="lib"/>
<!-- Local properties -->
<property name="src.dir" value="src"/>
<property name="classes.dir" value="${build.dir}/bin"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<property name="main-class" value="sc.player2021.Starter"/>
<path id="classpath.libs">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<path id="classpath.base">
<path refid="classpath.libs"/>
<pathelement location="${classes.dir}"/>
</path>
<pathconvert property="jar.classpath" pathsep="">
<mapper>
<chainedmapper>
<!-- remove absolute path -->
<flattenmapper/>
<!-- add lib/ prefix -->
<globmapper from="*" to="lib/* "/>
</chainedmapper>
</mapper>
<path refid="classpath.libs"/>
</pathconvert>
<pathconvert property="base.classpath" pathsep=":">
<path refid="classpath.base"/>
</pathconvert>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="compile">
<mkdir dir="${classes.dir}"/>
<javac source="1.8"
target="1.8"
srcdir="${src.dir}"
encoding="utf8"
destdir="${classes.dir}"
classpathref="classpath.base"
debug="true"
debuglevel="lines,vars,source"
includeantruntime="false"/>
</target>
<target name="build-jar" depends="compile">
<jar destfile="${jar.dir}/${ant.project.name}.jar"
basedir="${classes.dir}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
<attribute name="Class-Path" value="${jar.classpath}"/>
</manifest>
</jar>
<copy todir="${jar.dir}/lib" >
<path refid="classpath.libs" />
</copy>
<copy file="src/logback.xml"
tofile="${jar.dir}/logback.xml"/>
</target>
<target name="build" depends="build-jar" description="Build only"/>
<target name="main" depends="clean, build" description="Clean and build"/>
</project>