-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.xml
117 lines (97 loc) · 3.48 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
<!-- ant build.xml file for building jars. -->
<!-- author: Jun Yang (junyang@cs.duke.edu) -->
<!-- last modified: Sun Aug 21 23:46:31 EDT 2011 -->
<!-- Usage: -->
<!-- ant: Compile and package the .jar file. -->
<!-- ant sample.db: Rebuild SQLite database file sample.db and test RA. -->
<!-- ant clean: Clean up build files but leave the .jar and sample.db. -->
<!-- ant deepclean: Clean up the .jar and sample.db as well. -->
<project name="RA" default="jar" basedir=".">
<!-- ********************************************************************** -->
<!-- app.name is the name of the application used to name the .jar
files. You will find these files in the current directory
after running "ant package".
-->
<property name="app.name" value="ra"/>
<!-- ver.num is the version number.
-->
<property name="ver.num" value="2.2b"/>
<!-- lib.dir contains .jar files that will be copied into bld.dir and
eventually packaged into the jar file.
-->
<property name="lib.dir" value="lib"/>
<!-- src.dir contains Java sources files. If your source code is
organized into packages (recommended for large projects), the
package hierarchy should be reflected as a directory structure
underneath this directory.
-->
<property name="src.dir" value="src"/>
<!-- res.dir contains resources. These files will be copied into
bld.dir and eventually packaged into the jar file.
-->
<property name="res.dir" value="res"/>
<!-- bld.dir is the build directory for compiled .class files.
-->
<property name="bld.dir" value="build"/>
<!-- main.class specifies the application's entry point; it will go
into the manifest.
-->
<property name="main.class" value="ra.RA"/>
<!-- ********************************************************************** -->
<property name="env" environment="env" value="env"/>
<path id="compile.classpath">
<pathelement location="."/>
<pathelement path="${env.CLASSPATH}"/>
</path>
<!-- Initialize (nothing to do at this point). -->
<target name="init">
</target>
<!-- Clean up. -->
<target name="clean" depends="init">
<delete dir="${bld.dir}"/>
<delete>
<fileset dir="${src.dir}/ra" includes="RALexer*"/>
<fileset dir="${src.dir}/ra" includes="RAParser*"/>
<fileset dir="${src.dir}/ra" includes="RAXConstructor*"/>
</delete>
</target>
<!-- Clean up further. -->
<target name="deepclean" depends="clean">
<delete file="${app.name}.jar"/>
<delete file="sample.db"/>
</target>
<!-- Compile. -->
<target name="compile" depends="init">
<mkdir dir="${bld.dir}"/>
<unjar dest="${bld.dir}">
<fileset dir="${lib.dir}"/>
</unjar>
<copy todir="${bld.dir}">
<fileset dir="${res.dir}"/>
</copy>
<antlr target="${src.dir}/ra/ra.g"
outputdirectory="${src.dir}/ra">
<classpath path="${lib.dir}/antlr.jar"/>
</antlr>
<javac source="1.6" target="1.6" srcdir="${src.dir}" destdir="${bld.dir}" debug="on" debuglevel="lines,vars,source" includeAntRuntime="false">
<classpath refid="compile.classpath"/>
</javac>
</target>
<!-- Create .jar file. -->
<target name="jar" depends="compile">
<jar destfile="${app.name}.jar">
<fileset dir="${bld.dir}"/>
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
<attribute name="Implementation-Version" value="${ver.num}"/>
</manifest>
</jar>
</target>
<!-- Rebuild sample.db and test. -->
<target name="sample.db" depends="jar">
<delete file="sample.db"/>
<java jar="${app.name}.jar" fork="true">
<arg line="-v -i sample.ra"/>
</java>
</target>
</project>