-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
97 lines (88 loc) · 3.36 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="LesBatisseurs" default="run" basedir=".">
<description>
le jeu les batisseurs, par maxime daniel
</description>
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="lib" value="lib"/>
<property name="jar" location="${build}/jar"/>
<property name="class" location="${build}/class"/>
<property name="javadoc" location="${build}/javadoc"/>
<property name="mainClass" value="Start"/>
<property name="version" value="1.0"/>
<property name="jarName" value="${mainClass}-${version}"/>
<property name="test" value="${build}/test"/>
<property name="junit" value="${lib}/junit.jar"/>
<property name="hamcrest" value="${lib}/hamcrest.jar"/>
<target name="init">
<mkdir dir="${build}"/>
<mkdir dir="${jar}"/>
<mkdir dir="${class}"/>
<mkdir dir="${test}"/>
<mkdir dir="${lib}"/>
</target>
<target name="compile" depends="init" description="compile the source " >
<javac srcdir="${src}" destdir="${class}" includeantruntime="false" encoding="UTF-8" target="11" source ="11">
<exclude name="test/**"/>
</javac>
</target>
<target name="jar" depends="compile" description="generate the distribution" >
<jar destfile="${jar}/${jarName}.jar" encoding="UTF-8">
<manifest>
<attribute name="Main-Class" value="${mainClass}"/>
</manifest>
<fileset dir="${class}"/>
<fileset dir="data"/>
</jar>
</target>
<target name="run" depends="jar">
<java classname="${mainClass}" fork="true">
<jvmarg value="-Dfile.encoding=UTF-8"/>
<classpath>
<pathelement path="${class}"/>
</classpath>
<permissions>
<grant class="java.security.AllPermission"/>
</permissions>
</java>
</target>
<target name="clean">
<delete dir="build"/>
</target>
<target name="javadoc">
<delete dir="${javadoc}"/>
<javadoc author="true"
private="true"
destdir="${javadoc}">
<fileset dir="${src}">
<exclude name="test/**"/>
<include name="**"/>
</fileset>
</javadoc>
</target>
<target name="test-compile" depends="compile" description="compile the test ">
<javac srcdir="${src}/test" destdir="${test}" includeantruntime="true">
<classpath>
<pathelement path="${junit}"/>
<pathelement path="${hamcrest}"/>
<pathelement path="${class}"/>
</classpath>
</javac>
</target>
<target name="test" depends="test-compile">
<junit printsummary="on" haltonfailure="off" fork="true" includeantruntime="true">
<classpath>
<pathelement path="${junit}"/>
<pathelement path="${hamcrest}"/>
<pathelement path="${test}"/>
<pathelement path="${class}"/>
<pathelement path="${java.class.path}"/>
</classpath>
<formatter type="brief"/>
<batchtest todir="${test}">
<fileset dir="${src}" includes="test/*.java"/>
</batchtest>
</junit>
</target>
</project>