-
Notifications
You must be signed in to change notification settings - Fork 31
/
build.xml
145 lines (114 loc) · 3.92 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?xml version="1.0"?>
<project name="Berkeley LM" default="all" basedir=".">
<!-- ~~~~~ Properties, Paths, etc ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<property environment="env" />
<property name="src" value="./src" />
<property name="test" value="./test" />
<property name="test-reports" value="./test-reports" />
<property name="lib" value="./lib" />
<property name="doc" value="./doc" />
<property name="jar" value="jar" />
<property name="version" value="1.1.6" />
<property name="root" value="berkeleylm-${version}" />
<property name="junit-jar" value="${lib}/junit-4.6.jar" />
<!-- ~~~~~ Init build task ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Create the build directory for compiled class files -->
<target name="init" depends="clean">
<tstamp />
<mkdir dir="${jar}" />
<mkdir dir="${doc}" />
<mkdir dir="${test-reports}" />
</target>
<!-- ~~~~~ Java build tasks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Compile the Java code. -->
<target name="compile" depends="init">
<javac compiler="javac1.6" srcdir="${src}" debug="on" encoding="utf8" sourcepath="">
<include name="**/*.java" />
</javac>
</target>
<!-- Create a JAR file -->
<target name="jar" depends="compile">
<jar destfile="${jar}/berkeleylm.jar">
<fileset dir="${src}">
<include name="**/*.class" />
<include name="**/*.java" />
</fileset>
</jar>
</target>
<!-- ~~~~~ Cleaning tasks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Delete the compiled files -->
<target name="clean">
<delete verbose="true" quiet="true">
<fileset dir="${doc}">
<include name="**/*" />
</fileset>
</delete>
<delete verbose="true" quiet="true">
<fileset dir="${src}">
<include name="**/*.class" />
</fileset>
</delete>
<delete verbose="true" quiet="true">
<fileset dir="${test}">
<include name="**/*.class" />
</fileset>
</delete>
<delete verbose="true" quiet="true">
<fileset dir="${test-reports}">
<include name="**/*" />
</fileset>
</delete>
<delete verbose="true" quiet="true">
<fileset dir="${jar}">
<include name="**/*.jar" />
</fileset>
</delete>
</target>
<!-- ~~~~~ Javadoc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<target name="javadoc">
<mkdir dir="${doc}" />
<javadoc packagenames="edu.berkeley.nlp.lm.*" overview="${src}/overview.html" classpath="${cli}" sourcepath="${src}" destdir="${doc}" author="true" version="true" charset="utf-8">
<link href="http://download.oracle.com/javase/6/docs/api/" />
</javadoc>
</target>
<!-- ~~~~~ Junit ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<target name="compile-test" depends="compile">
<javac compiler="javac1.6" srcdir="${test}" debug="on" encoding="utf8" sourcepath="" classpath="${src}:${junit-jar}">
<include name="**/*.java" />
</javac>
</target>
<target name="test" depends="compile-test">
<junit printsummary="yes" haltonfailure="no" showoutput="true">
<classpath>
<pathelement location="${test}" />
<pathelement location="${src}" />
<pathelement location="${junit-jar}" />
<pathelement path="${java.class.path}" />
</classpath>
<jvmarg value="-mx500m" />
<jvmarg value="-ea" />
<formatter type="plain" />
<batchtest fork="yes" todir="${test-reports}">
<fileset dir="${test}">
<include name="**/*Test.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="all" depends="test,jar,javadoc" />
<!-- Build the tarball for distribution -->
<target name="export" depends="jar,javadoc">
<delete file="${root}.tar.gz"/>
<copy todir="${root}">
<fileset dir=".">
<include name="**/*" />
<exclude name="**/*.tar.gz"/>
<exclude name="**/berkeleylm_binaries.html"/>
<exclude name="${root}"/>
</fileset>
</copy>
<tar destfile="${root}.tar.gz" basedir="." compression="gzip" includes="${root}/**" excludes="**/test-reports,**/*.class,**/*.tar.gz">
</tar>
<delete dir="${root}"/>
</target>
</project>