-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.xml
102 lines (88 loc) · 3.41 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
<?xml version="1.0"?>
<!DOCTYPE project>
<project name="JAVATER2" default="dist" basedir=".">
<property name="src" value="src"/>
<property name="build" value="build"/>
<property name="dist" value="dist"/>
<property name="terpexe" value="terp"/>
<property name="terpexe_mc" value="com.bbn.mt.terp.TERplus"/>
<property name="tercomexe" value="tercom"/>
<property name="tercomexe_mc" value="com.bbn.mt.ter.TERtest"/>
<property name="optexe" value="optimize_terp"/>
<property name="optexe_mc" value="com.bbn.mt.terp.OptimizeTER"/>
<property name="cdbexe" value="create_phrasedb"/>
<property name="cdbexe_mc" value="com.bbn.mt.terp.phrasedb.CreatePhraseDB"/>
<target name="init">
<tstamp/>
<echo> CREATING TERp DIRECTORIES. </echo>
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="init">
<echo> COMPILING THE TERp SOURCE PROGRAM. </echo>
<javac srcdir="${src}" destdir="${build}" nowarn="on" debug="on" optimize="on" classpath="${src}"/>
<!-- We need to copy the edu and com/sleepycat packages so that they'll be in the jar file -->
<copy todir="${build}/edu">
<fileset dir="${src}/edu"/>
</copy>
<copy todir="${build}/com/sleepycat">
<fileset dir="${src}/com/sleepycat"/>
</copy>
</target>
<target name="dist" depends="compile">
<echo> Creating all of the jar files </echo>
<mkdir dir="${dist}/lib"/>
<echo> Creating TERp jar file </echo>
<jar jarfile="${dist}/lib/${terpexe}.jar" basedir="${build}" excludes="**/*.java,**/ter/*">
<manifest>
<attribute name="Main-Class" value="${terpexe_mc}"/>
</manifest>
</jar>
<echo> Creating TERcom jar file </echo>
<jar jarfile="${dist}/lib/${tercomexe}.jar" basedir="${build}" excludes="**/*.java"
includes="**/ter/*.class">
<manifest>
<attribute name="Main-Class" value="${tercomexe_mc}"/>
</manifest>
</jar>
<echo> Creating Optimization jar file </echo>
<jar jarfile="${dist}/lib/${optexe}.jar" basedir="${build}" excludes="**/*.java,**/ter/*">
<manifest>
<attribute name="Main-Class" value="${optexe_mc}"/>
</manifest>
</jar>
<echo> Creating Phrase DB Creation jar file </echo>
<jar jarfile="${dist}/lib/${cdbexe}.jar" basedir="${build}" excludes="**/*.java,**/ter/*">
<manifest>
<attribute name="Main-Class" value="${cdbexe_mc}"/>
</manifest>
</jar>
</target>
<target name="tgz" depends="dist">
<echo> PACKING AND COMPRESSING THE PROJECT. </echo>
<tar tarfile="${terpexe}.tar" basedir="." includes="data,${src}/**/*,${build}/**/*.class,${dist}/**/*.jar,build.xml" />
<gzip zipfile="${terpexe}.tar.gz" src="${terpexe}.tar" />
<delete file="${terpexe}.tar" />
</target>
<target name="help">
<echo> USING ANT FOR ${ant.project.name}. </echo>
<echo> ant [ compile | dist | tgz | clean ] </echo>
<echo>
ant [compile]: compiles the src and put the class files in ${build}
</echo>
<echo>
ant [dist]: build the jar files and place them in ${dist}/lib.
</echo>
<echo>
ant tgz: packs and compresses the source programs.
</echo>
<echo>
ant clean: remove the binaries and the compressed pakage.
</echo>
</target>
<target name="clean">
<echo> REMOVING BINARIES AND PACKAGE. </echo>
<delete dir="${build}"/>
<delete dir="${dist}"/>
<delete file="${terpexe}.tar.gz"/>
</target>
</project>