-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
143 lines (120 loc) · 5.03 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
143
<?xml version="1.0" encoding="UTF-8"?>
<project name="Hog" default="main" basedir=".">
<!-- message variabes -->
<property name="usage" value="Usage: hog [input_file | input_dir] [output_file_name]" />
<property name="hog.version" value="0.1" />
<property name="welcome.message" value="Hog v${hog.version} --- A scripting MapReduce language." />
<!-- organization variabes -->
<property name="src.dir" value="src" />
<property name="build.dir" value="bin" />
<property name="classes.dir" value="${build.dir}" />
<property name="jar.dir" value="${build.dir}/jar" />
<property name="lib.dir" value="lib" />
<property name="front_end.dir" value="${src.dir}/front_end" />
<property name="test.dir" value="${classes.dir}" />
<path id="lib">
<pathelement location="lib/" />
<pathelement location="lib/java-cup-11a.jar" />
<pathelement location="lib/JFlex.jar" />
<pathelement location="lib/junit.jar" />
</path>
<path id="test.classpath">
<pathelement location="${classes.dir}" />
<pathelement location="lib/junit.jar" />
<pathelement location="lib/org.hamcrest.core_1.1.0.v20090501071000.jar" />
<pathelement location="lib/java-cup-11a.jar" />
<pathelement location="lib/JFlex.jar" />
<fileset dir="${jar.dir}">
<include name="**/*.jar" />
</fileset>
</path>
<!-- build variables -->
<property name="java.source.version" value="1.6" />
<property name="java.target.version" value="1.6" />
<property name="lexer.specification" value="${front_end.dir}/Lexer.jflex" />
<property name="dev.main-class" value="front_end.Hog" />
<property name="jflex.main-class" value="JFlex.Main" />
<property name="cup.main-class" value="java_cup.Main" />
<property name="parser.specification" value="${front_end.dir}/Parser.cup" />
<property name="logging.properties" value="logging.properties" />
<!-- build tasks (ignore Eclipse warnings) -->
<taskdef name="jflex" classname="JFlex.anttask.JFlexTask">
<classpath refid="lib" />
</taskdef>
<taskdef name="cup" classname="java_cup.anttask.CUPTask">
<classpath refid="lib" />
</taskdef>
<!-- build routines -->
<target name="help" description="show help message">
<echo message="Ant build file for Hog." />
<echo message="" />
<echo message="Useful targets:" />
<echo message="clean -------- remove all compiled files on this machine." />
<echo message="hog ---------- !TODO! clean, build and run on hadoop." />
<echo message="main --------- clean, build and run the project." />
<echo message="jar ---------- build java archive of project." />
<echo message="" />
<echo message="Dev builds:" />
<echo message="dev-build ---- !TODO! build project and run automated tests." />
<echo message="dev-lexer ---- runs ConsoleLexer for testing." />
<echo message="dev-frontend - runs JFlex and CUP to regenerate Lexer.java, sym.java and Parser.java" />
<echo message="dev-test ----- run all automated tests." />
</target>
<target name="clean">
<delete dir="${build.dir}" />
</target>
<target name="compile" depends="clean, dev-frontend">
<echo>${welcome.message}</echo>
<echo>Authors:</echo>
<echo>Jason Halpern (Testing/Validation)</echo>
<echo>Samuel Messing (Project Manager)</echo>
<echo>Benjamin Rapaport (System Architect)</echo>
<echo>Kurry Tran (System Integrator)</echo>
<echo>Paul Tylkin (Language Guru)</echo>
<mkdir dir="${classes.dir}" />
<mkdir dir="${jar.dir}" />
<javac srcdir="${src.dir}" destdir="${classes.dir}" source="${java.source.version}" debug="true"
target="${java.target.version}" includeantruntime="false">
<classpath refid="lib" />
</javac>
</target>
<target name="jar" depends="compile">
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
<zipfileset includes="**/*.class" src="lib/java-cup-11a.jar" />
<manifest>
<attribute name="Main-Class" value="${dev.main-class}" />
</manifest>
</jar>
</target>
<target name="run" depends="jar">
<java jar="${jar.dir}/${ant.project.name}.jar" fork="true" >
<sysproperty key="java.util.logging.config.file" value="../../${logging.properties}"/>
</java>
</target>
<target name="clean-build" depends="" />
<target name="main" depends="jar" />
<!-- developer builds -->
<target name="dev-frontend" depends="">
<cup srcfile="${parser.specification}" destdir="${src.dir}"
interface="true" parser="Parser" symbols="sym" force="true" />
<jflex file="${lexer.specification}" destdir="${src.dir}" />
<delete file="${src.dir}/front_end/Lexer.java~" />
</target>
<target name="dev-lexer" depends="">
<java classpath="${classes.dir}" classname="front_end.ConsoleLexer" fork="true">
<classpath>
<path id="jflex" location="${lib.dir}/JFlex.jar" />
<path id="java_cup" location="${lib.dir}/java-cup-11a.jar" />
</classpath>
</java>
</target>
<target name="dev-test" depends="">
<junit fork="yes" haltonfailure="yes">
<formatter type="plain" usefile="false" />
<classpath refid="test.classpath" />
<batchtest>
<fileset dir="${test.dir}" includes="**/*Tester.class" />
</batchtest>
</junit>
</target>
</project>