forked from NearInfinityBrowser/NearInfinity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
128 lines (115 loc) · 4.77 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?xml version="1.0" encoding="UTF-8"?>
<project name="NearInfinity" default="compile" basedir=".">
<property name="jar.file" value="NearInfinity.jar"/>
<property name="build.path" location="build/src"/>
<property name="build.test.path" location="build/test"/>
<property name="src.path" location="src"/>
<property name="test.path" location="test"/>
<property name="lib.path.rel" value="lib"/>
<property name="lib.path.abs" location="${lib.path.rel}"/>
<property name="jorbis.file" value="${lib.path.rel}/jorbis/jorbis.jar"/>
<property name="rsyntaxtextarea.file" value="${lib.path.rel}/rsyntaxtextarea/rsyntaxtextarea.jar"/>
<property name="jhexview.file" value="${lib.path.rel}/jhexview/jhexview.jar"/>
<property name="montemedia.file" value="${lib.path.rel}/montemedia/montemedia.jar"/>
<property name="junit.file" value="${lib.path.rel}/junit/junit-4.12.jar"/>
<property name="hamcrest.file" value="${lib.path.rel}/junit/hamcrest-core-1.3.jar"/>
<property name="antjunit.file" value="${lib.path.rel}/junit/ant-junit-1.9.7.jar"/>
<property name="antjunit4.file" value="${lib.path.rel}/junit/ant-junit4-1.9.7.jar"/>
<property name="javacc.home" value="lib/javacc"/>
<property name="parser.path" value="org/infinity/resource/bcs/parser"/>
<property name="src.parser.path" value="${src.path}/org/infinity/resource/bcs/parser"/>
<property name="parser.file" value="BafParser"/>
<path id="junit.class.path">
<pathelement location="${junit.file}"/>
<pathelement location="${hamcrest.file}"/>
<pathelement location="${build.path}"/>
</path>
<target name="compile" depends="clean">
<mkdir dir="${build.path}"/>
<javac srcdir="${src.path}"
destdir="${build.path}"
encoding="UTF-8"
source="1.8"
target="1.8"
includeantruntime="false"
deprecation="false"
debug="false"
debuglevel="lines,vars,source"
classpath="${classpath}:${jorbis.file}:${rsyntaxtextarea.file}:${jhexview.file}:${montemedia.file}">
<!-- Various debugging options: -->
<!-- <compilerarg value="-Xlint:cast"/> -->
<!-- <compilerarg value="-Xlint:deprecation"/> -->
<!-- <compilerarg value="-Xlint:empty"/> -->
<!-- <compilerarg value="-Xlint:finally"/> -->
<!-- <compilerarg value="-Xlint:overrides"/> -->
<!-- <compilerarg value="-Xlint:path"/> -->
<compilerarg value="-Xlint:unchecked"/>
</javac>
<copy todir="${build.path}">
<fileset dir="${src.path}" excludes="**/*.java"/>
</copy>
<jar destfile="${jar.file}"
basedir="${build.path}"
includes="**/*"
level="9">
<zipgroupfileset dir="." includes="${jorbis.file}"/>
<zipgroupfileset dir="." includes="${rsyntaxtextarea.file}"/>
<zipgroupfileset dir="." includes="${jhexview.file}"/>
<zipgroupfileset dir="." includes="${montemedia.file}"/>
<manifest>
<attribute name="Main-Class" value="org.infinity.NearInfinity"/>
</manifest>
</jar>
</target>
<target name="parser-generate" depends="parser-clean">
<jjtree target="${src.parser.path}/${parser.file}.jjt" outputdirectory="${src.parser.path}" javacchome="${javacc.home}"/>
<javacc target="${src.parser.path}/${parser.file}.jj" outputdirectory="${src.parser.path}" javacchome="${javacc.home}"/>
</target>
<target name="test-compile" depends="test-clean">
<mkdir dir="${build.test.path}"/>
<javac srcdir="${test.path}"
destdir="${build.test.path}"
includeantruntime="false">
<classpath refid="junit.class.path" />
</javac>
</target>
<taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
<classpath>
<pathelement location="${antjunit.file}"/>
<pathelement location="${antjunit4.file}"/>
</classpath>
</taskdef>
<target name="test" depends="test-compile">
<junit>
<classpath>
<path refid="junit.class.path"/>
<pathelement location="${build.test.path}"/>
</classpath>
<batchtest>
<fileset dir="${build.test.path}">
<include name="**/*Test.class"/>
</fileset>
</batchtest>
<formatter type="brief" usefile="false"/>
</junit>
</target>
<target name="clean">
<delete dir="${build.path}"/>
<delete file="${jar.file}"/>
<delete>
<fileset dir="${src.path}" includes="**/*.class"/>
</delete>
</target>
<target name="parser-clean">
<delete failonerror="false" quiet="false">
<fileset dir="${src.parser.path}">
<include name="*.java"/>
<exclude name="BafNode*.java"/>
</fileset>
<fileset file="${src.parser.path}/${parser.file}.jj"/>
</delete>
</target>
<target name="test-clean">
<delete dir="${build.test.path}"/>
</target>
</project>