-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
114 lines (98 loc) · 3.91 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
<project name="JBurg3" default="cleanBuildAndTest" basedir=".">
<target name="init">
<!-- Load the properties from
$HOME/ant.properties.
Please do not change any properties here.
-->
<property file="${user.home}/ant.properties" />
<property file="build.properties" />
<property name="distro.version" value="Set in build.properties"/>
<!-- Intra-project directory configuration -->
<property name="src.dir" value="./src" />
<property name="gensrc.dir" value="./gensrc" />
<property name="classes.dir" value="./classes" />
<property name="lib.dir" value="./lib" />
<property name="jburg.version.dir" value="${gensrc.dir}/jburg/version" />
<property name="jburg.dir" value="${src.dir}/java" />
<property name="junit.log.dir" value="./log" />
<!-- Target settings -->
<property name="jar.file" value="jburg.jar" />
<property name="debug.symbols" value="yes"/>
<!-- Third-party tools. -->
<property name="cpp.compiler" value="g++"/>
</target>
<target name="cleanBuildAndTest" depends="clean,jar,test"/>
<target name="clean" depends="init">
<!-- Remove VIM backup files. -->
<delete>
<fileset dir="${basedir}" includes="**/*.*~" defaultexcludes="no"/>
</delete>
<delete dir="${classes.dir}" />
<delete dir="${jburg.version.dir}" />
<delete dir="extras/ErrorAnalyzer/classes" />
</target>
<target name="help">
<echo>
cleanBuildAndTest - clean, build, and test
test - run all tests
</echo>
</target>
<target name="jar" depends="compile">
<mkdir dir="${lib.dir}" />
<jar jarfile="${lib.dir}/${jar.file}">
<fileset dir="${classes.dir}"/>
<fileset dir="src">
<include name="**/*.stg"/>
<include name="**/*.xsd"/>
<include name="resources/*.png"/>
</fileset>
<manifest>
<attribute name="Main-Class" value="jburg.burg.Main"/>
<attribute name="Implementation-Version" value="${distro.version}"/>
</manifest>
</jar>
</target>
<!-- Compile JBurg -->
<target name="compile" depends="init"
description="Build and compile source files">
<mkdir dir="${jburg.version.dir}" />
<mkdir dir="${classes.dir}" />
<echo message="Setting JBurg version ${distro.version}."/>
<echo file="${jburg.version.dir}/JBurgVersion.java">
package jburg.version;
public interface JBurgVersion {
public static final String version="${distro.version}";
}
</echo>
<javac
debug="${debug.symbols}"
destdir="${classes.dir}"
includes="**/*.java"
>
<compilerarg value="-Xlint:unchecked"/>
<src path="${jburg.dir}"/>
<src path="${gensrc.dir}"/>
<classpath>
<pathelement path="${stringtemplate.jar}"/>
</classpath>
</javac>
</target>
<target name="debugger" depends="jar">
<java classname="jburg.debugger.Debugger" fork="true">
<arg value="-grammar"/>
<arg value="test/java/grammars/PoorlyOverloaded.xml"/>
<classpath>
<pathelement path="${lib.dir}/${jar.file}"/>
<pathelement path="${stringtemplate.jar}"/>
</classpath>
</java>
</target>
<target name="test" depends="init">
<echo message="Running grammar-drivent tests"/>
<ant dir="test/grammar_driven" target="cleanBuildAndTest" inheritAll="false" useNativeBasedir="true"/>
<echo message="Running TL/3 tests"/>
<ant dir="test/tl3" target="cleanBuildAndTest" inheritAll="false"/>
<echo message="Running TQL tests"/>
<ant dir="test/tql" target="cleanBuildAndTest" inheritAll="false"/>
</target>
</project>