-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
114 lines (95 loc) · 3.47 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
<?xml version="1.0" encoding="UTF-8"?>
<project default="run" name="SMPL - Simple Math Programming Language">
<property name="version" value="1.0.1" />
<property name="message" value="This is SMPL! The Simple Math Programming Language" />
<property name="smpl-lang-dir" location="src/smpl/lang" />
<property name="smpl-parser-name" value="SMPLParser" />
<property name="smpl-cup-file" location="src/smpl/lang/SMPLParser.cup" />
<path id="cup.classpath">
<pathelement location="lib/java-cup-11b.jar" />
</path>
<path id="jflex.classpath">
<pathelement location="lib/jflex-full-1.8.2.jar" />
</path>
<path id="test.classpath">
<pathelement location="lib/junit-platform-console-standalone-1.8.0.jar" />
<pathelement location="bin" />
</path>
<path id="compile.classpath">
<pathelement location="lib/java-cup-11b.jar" />
<pathelement location="lib/junit-platform-console-standalone-1.8.0.jar" />
</path>
<target name="ping">
<echo>${message}</echo>
</target>
<target name="clean">
<delete dir="bin"/>
<delete dir="docs"/>
</target>
<target name="init">
<mkdir dir="bin"/>
<mkdir dir="docs"/>
</target>
<taskdef name="jflex"
classname="jflex.anttask.JFlexTask"
classpathref="jflex.classpath" />
<target name="build-lexer">
<jflex file="${smpl-lang-dir}/SMPLLexer.flex" />
</target>
<taskdef name="cup"
classname="java_cup.anttask.CUPTask"
classpathref="cup.classpath" />
<target name="build-parser" depends="build-lexer">
<cup srcfile="${smpl-cup-file}"
destdir="src"
parser="SMPLParser"
interface="true"
locations="false">
</cup>
</target>
<target name="compile" depends="init, build-parser">
<javac srcdir="src"
destdir="bin"
deprecation="true"
includeantruntime="false"
classpathref="compile.classpath" />
</target>
<target name="build-lib" depends="compile">
<jar destfile="lib/smpl-coore-outar-${version}.jar" excludes="bin/tests">
<fileset dir="bin" />
<zipfileset src="lib/java-cup-11b.jar"/>
</jar>
</target>
<target name="build-docs" depends="build-lib">
<javadoc packagenames="smpl.*"
destdir="docs"
sourcepath="src"
author="true"
version="true"
classpath="lib/smpl-coore-outar-${version}.jar" />
</target>
<target name="test" depends="compile">
<java fork="true"
classpathref="test.classpath"
classname="org.junit.platform.console.ConsoleLauncher"
failonerror="true">
<arg value="--include-engine=junit-jupiter" />
<arg value="--scan-classpath" />
<arg line="--reports-dir docs/test-report"/>
</java>
<junitreport todir="docs/test-report">
<fileset dir="docs/test-report">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="docs/test-report/html" />
</junitreport>
</target>
<target name="run" depends="test">
<java classname="App">
<arg value="examples/" />
<classpath>
<pathelement location="lib/smpl-coore-outar-${version}.jar" />
</classpath>
</java>
</target>
</project>