forked from achimala/leaguelib
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
92 lines (78 loc) · 3.25 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
<!--
This file is part of LeagueLib.
LeagueLib is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
LeagueLib is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with LeagueLib. If not, see <http://www.gnu.org/licenses/>.
-->
<project name="leaguelib" basedir="." default="run-test">
<property name="src.dir" value="src/main/java" />
<property name="build.dir" value="target" />
<property name="lib.dir" value="src/lib" />
<property name="classes.dir" value="${build.dir}/classes" />
<property name="jar.dir" value="${build.dir}" />
<property name="package-prefix" value="com.achimala.leaguelib" />
<!-- <path id="external.jars">
<fileset dir="${lib.dir}" includes="**/*.jar" />
</path> -->
<path id="project.classpath">
<!-- <pathelement location="${src.dir}" /> -->
<!-- <path refid="external.jars" /> -->
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</path>
<pathconvert property="mf.classpath" pathsep=" ">
<path refid="project.classpath" />
<mapper>
<chainedmapper>
<flattenmapper />
<globmapper from="*.jar" to="lib/*.jar" />
</chainedmapper>
</mapper>
</pathconvert>
<path id="jars">
<fileset dir="${lib.dir}" includes="**/*.jar" />
</path>
<target name="clean">
<delete dir="${build.dir}" />
</target>
<target name="compile">
<mkdir dir="${classes.dir}" />
<javac srcdir="${src.dir}" destdir="${classes.dir}" includeantruntime="false" classpathref="jars" debug="on" debuglevel="lines,vars,source">
<compilerarg value="-Xlint:unchecked" />
</javac>
</target>
<target name="jar" depends="compile">
<mkdir dir="${jar.dir}" />
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
<!-- <manifest>
<attribute name="Main-Class" value="${package-prefix}.tests.MainTest" />
</manifest> -->
<zipgroupfileset dir="${lib.dir}" includes="**/*.jar" />
</jar>
</target>
<target name="run-test" depends="jar">
<java classname="${package-prefix}.MainTest">
<classpath>
<pathelement location="${jar.dir}/${ant.project.name}.jar" />
</classpath>
<arg value="${test.password}" />
</java>
</target>
<target name="run-test-console" depends="jar">
<java classname="${package-prefix}.TestConsole">
<classpath>
<pathelement location="${jar.dir}/${ant.project.name}.jar" />
</classpath>
</java>
</target>
<target name="clean-build" depends="clean, jar" />
<target name="test" depends="clean, run-test" />
</project>