-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
73 lines (64 loc) · 1.69 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
<project name="cortado" default="jar" basedir=".">
<property name="src" location="src"/>
<property name="build" location="bin"/>
<property name="gen" location="gen"/>
<!-- define the cup and jflex tasks -->
<taskdef name="cup"
classname="java_cup.anttask.CUPTask"
classpath="lib/java-cup-11a.jar"
/>
<taskdef name="jflex"
classname="JFlex.anttask.JFlexTask"
classpath="lib/JFlex.jar"
/>
<!-- initialization target -->
<target name="init">
<tstamp />
</target>
<!-- run the lexer -->
<target name="lexer" depends="init">
<jflex
file="src/lexer/minijava.jflex"
destdir="gen/"
/>
</target>
<!-- run the parser -->
<target name="parser" depends="lexer">
<cup
srcfile="src/parser/minijava.cup"
destdir="gen/se/cortado/"
package="se.cortado"
expect="0"
interface="true"
/>
</target>
<!-- compile the code in src and gen to build folder -->
<target name="compile" depends="parser">
<mkdir dir="${gen}" />
<mkdir dir="${build}" />
<javac destdir="${build}" includeantruntime="false">
<src path="${src}" />
<src path="${gen}" />
<classpath path="lib/java-cup-11a.jar" />
<classpath path="lib/JFlex.jar" />
<classpath path="lib/junit-4.10.jar" />
</javac>
</target>
<target name="jar" depends="compile">
<jar destfile="mjc.jar"
basedir="bin/"
includes="**/*.class">
<manifest>
<attribute name="Main-Class" value="se.cortado.Main" />
</manifest>
</jar>
</target>
<target name="clean">
<delete dir="cortadoout" failonerror="false" />
<delete dir="bin" failonerror="false" />
<delete dir="gen" failonerror="false" />
<delete failonerror="false">
<fileset file="mjc.jar" />
</delete>
</target>
</project>