-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
114 lines (91 loc) · 4.13 KB
/
build.xml
File metadata and controls
114 lines (91 loc) · 4.13 KB
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
<project name="JFlex" default="help">
<!-- ==================== properties ============================== -->
<!-- use any of these files to override properties -->
<property file="build.properties" />
<property file="${user.home}/.jflex.properties" />
<!-- location of development tools necessary for the build -->
<property name="tools.dir" value="../tools"/>
<!-- override these if you want to use your own versions -->
<property name="jflex.jar" value="${tools.dir}/JFlex.jar" />
<property name="cup.jar" value="${tools.dir}/java_cup.jar" />
<property name="junit.jar" value="${tools.dir}/junit.jar" />
<!-- where to get tool jars from -->
<property name="jflex.jar.url"
value="http://jflex.sourceforge.net/jar/stable/JFlex.jar" />
<property name="cup.jar.url"
value="http://jflex.sourceforge.net/jar/stable/java_cup.jar" />
<property name="junit.jar.url"
value="http://jflex.sourceforge.net/jar/stable/junit.jar" />
<!-- ==================== targets ================================= -->
<target name="help" description="show help message">
<echo message="Ant build file for JFlex. Useful targets:"/>
<echo message=""/>
<echo message="gettools: download development tools for the build"/>
<echo message="realclean: remove all compiled and generated files"/>
<echo message="jar: make JFlex.jar"/>
<echo message=""/>
<echo message="Use the gettool target or override the *.jar properties"/>
<echo message="before you do the first build."/>
</target>
<target name="declare" description="define tasks for jflex and cup">
<taskdef classname="JFlex.anttask.JFlexTask" name="jflex" classpath="${jflex.jar}"/>
<taskdef classname="java_cup.anttask.CUPTask" name="cup" classpath="${cup.jar}"/>
</target>
<target name="gettools" description="download development tools">
<mkdir dir="${tools.dir}"/>
<get src="${jflex.jar.url}" dest="${jflex.jar}"/>
<get src="${cup.jar.url}" dest="${cup.jar}"/>
<get src="${junit.jar.url}" dest="${junit.jar}"/>
</target>
<target name="dist" description="build distribution">
<antcall target="gettools" />
<antcall target="build" />
<antcall target="libclean" />
</target>
<target name="build" depends="realclean,jar"
description="complete build from scratch"/>
<target name="cbuild" depends="libclean,compile,jar"
description="recompile and pack all classes"/>
<target name="compile" depends="jflex,cup"
description="compile all classes">
<javac srcdir="."
destdir="../lib"
target="1.1"
source="1.2"
classpath=".:${junit.jar}"
debug="on" />
</target>
<target name="jflex" depends="declare" description="generate scanner">
<jflex file="JFlex/LexScan.flex" skeleton="skeleton.nested"/>
</target>
<target name="cup" depends="declare" description="generate parser">
<cup srcfile="JFlex/LexParse.cup" interface="true" parser="LexParse" />
</target>
<target name="copy" description="copy resources to build dir">
<copy file="skeleton.default" todir="../lib/JFlex" />
<copy file="JFlex/Messages.properties" todir="../lib/JFlex/" />
</target>
<target name="jar" depends="compile,copy" description="make JFlex.jar">
<jar basedir="../lib"
includes="JFlex/**,java_cup/**,skeleton"
jarfile="../lib/JFlex.jar"
manifest="manifest"/>
</target>
<target name="libclean" description="remove compiled classes">
<delete dir="../lib/JFlex" />
<delete dir="../lib/java_cup" />
</target>
<target name="jarclean" description="remove JFlex.jar">
<delete file="../lib/JFlex.jar" />
</target>
<target name="genclean" description="remove genrated classes">
<delete file="JFlex/LexScan.java" />
<delete file="JFlex/LexParse.java" />
<delete file="JFlex/sym.java" />
</target>
<target name="clean" description="remove backup files">
<delete> <fileset dir="." includes="**/*~"/> </delete>
</target>
<target name="realclean" depends="clean,genclean,libclean,jarclean"
description="clean up extra tidily"/>
</project>