-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
142 lines (122 loc) · 4.12 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
<!--
build.xml for apache ant; just change the location of antlr.jar before using
the ant tools (see property name="antlr").
-->
<project name="cetus" default="jar" basedir=".">
<!-- Environment prefix -->
<property environment="env"/>
<!-- Cetus root directory -->
<property name="cetusdir" value="${basedir}"/>
<!-- Source directory -->
<property name="srcdir" value="${cetusdir}/src"/>
<!-- Parser directory -->
<property name="parserdir" value="${cetusdir}/src/cetus/base/grammars"/>
<!-- Class directory -->
<property name="classdir" value="${cetusdir}/class"/>
<!-- Jar directory -->
<property name="jardir" value="${cetusdir}/lib"/>
<!-- Wrapper directory -->
<property name="bindir" value="${cetusdir}/bin"/>
<!-- Javadoc directory -->
<property name="apidir" value="${cetusdir}/api"/>
<!-- Antlr directory - MODIFY THIS VARIABLE FOR YOUR ENVIRONMENT!!! -->
<property name="antlr" value="${cetusdir}/lib/antlr.jar"/>
<!-- Classpath -->
<property name="classpath" value="${classdir}:${antlr}:${jardir}/rsyntaxtextarea.jar" />
<!-- Conditional property that checks if the parser is available -->
<condition property="parser.exists">
<available file="${parserdir}/NewCParser.java"/>
</condition>
<!-- Compiles the source codes -->
<target name="compile" depends="parser">
<mkdir dir="${classdir}"/>
<javac
srcdir = "${srcdir}"
destdir = "${classdir}"
classpath = "${classpath}"
debug = "true"
includeAntRuntime = "false"
source = "1.5"
target = "1.5"
>
<!-- Warning is turned off by default
<compilerarg value="-Xlint"/>
<compilerarg value="-Xlint:-unchecked"/>
<compilerarg value="-Xlint:-serial"/>
<compilerarg line="-Xmaxwarns 10000"/>
-->
</javac>
</target>
<!-- Generates the parser from the grammar file -->
<target name="parser" unless="parser.exists">
<java
classpath = "${classpath}"
classname = "antlr.Tool"
args = "Pre.g"
dir = "${parserdir}"
fork = "true"
/>
<java
classpath = "${classpath}"
classname = "antlr.Tool"
args = "NewCParser.g"
dir = "${parserdir}"
fork = "true"
/>
</target>
<!-- Archives the compiled class files -->
<target name="jar" depends="compile">
<mkdir dir = "${jardir}"/>
<jar
destfile = "${jardir}/cetus.jar"
basedir = "${classdir}"
includes = "**/*.class"
compress = "true"
>
<manifest>
<attribute name="Main-Class" value="cetus.exec.Driver"/>
</manifest>
</jar>
</target>
<!-- Archives the gui class files -->
<target name="gui" depends="compile">
<jar destfile="${jardir}/cetusgui.jar"
basedir="${classdir}"
>
<fileset dir="${classdir}" includes="**/*.class" />
<fileset dir="${basedir}/resources"/>
<zipgroupfileset dir="${jardir}" includes="rsyntaxtextarea.jar" />
<zipgroupfileset dir="${jardir}" includes="antlr.jar" />
<manifest>
<attribute name="Main-Class" value="cetus.exec.Driver"/>
</manifest>
</jar>
</target>
<!-- Creates javadoc -->
<target name="javadoc">
<mkdir dir = "${apidir}"/>
<javadoc
destdir = "${apidir}"
classpath = "${classpath}">
<fileset dir="${srcdir}" includes="**/*.java"/>
</javadoc>
</target>
<!-- Creates a wrapper script -->
<target name="bin" depends="jar">
<mkdir dir = "${bindir}"/>
<echo file = "${bindir}/cetus">#!/bin/sh
# This file was generated automatically by ant.
java -cp ${antlr}:${jardir}/cetus.jar:${jardir}/rsyntaxtextarea.jar -Xmx1g cetus.exec.Driver $*
</echo>
<chmod file="${bindir}/cetus" perm="755"/>
</target>
<!-- Cleans up class files and parser code -->
<target name="clean">
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${parserdir}" excludes="**.g CT** Li** Pra** Prepro** Cetus**"/>
<fileset dir="${classdir}"/>
<fileset dir="${bindir}"/>
<fileset dir="${jardir}" excludes="antlr.jar checkstyle.jar rsyntaxtextarea.jar"/>
</delete>
</target>
</project>