source: CIVL/build.xml@ 85b7e48

1.23 2.0 main test-branch
Last change on this file since 85b7e48 was 2e00014, checked in by Stephen Siegel <siegel@…>, 12 years ago

Upping timeout 1o 15 mins. Don't know what else to do now.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@1709 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 9.0 KB
Line 
1<!--
2 build.xml : Ant build file for CIVL
3 Author: Stephen F. Siegel, University of Delaware
4 Last modified:
5
6 The following can be defined on command line with -Dprop=val:
7 revision. This is for the use of our SVN commit hook, which
8 runs the test suite and performs other tasks every time a commit
9 is made. The SVN revision number is just used here to insert
10 into reports.
11-->
12
13<project name="CIVL" basedir="." default="jar" xmlns:jacoco="antlib:org.jacoco.ant">
14
15 <!-- Directories -->
16
17 <condition property="properties.file" value="build.properties" else="build_default.properties">
18 <available file="build.properties" />
19 </condition>
20 <property file="${properties.file}" />
21 <property file="build.properties" />
22 <property name="src.dir" value="${basedir}/src" />
23 <property name="real.src.dir" value="${src.dir}/edu/udel/cis/vsl/civl" />
24 <property name="bin.dir" value="${basedir}/bin" />
25 <property name="javadoc.dir" value="${basedir}/doc/javadoc" />
26 <property name="jar-name" value="civl.jar" />
27 <property name="jar-path" value="${basedir}/${jar-name}" />
28 <property name="main-class" value="edu.udel.cis.vsl.civl.CIVL" />
29 <property name="grammar.dir" value="${basedir}/grammar" />
30
31
32 <!-- Junit and JaCoCo Coverage -->
33
34 <property name="test.src.dir" location="${basedir}/test/regress" />
35 <property name="test.bin.root.dir" location="${basedir}/bin-test" />
36 <property name="test.bin.dir" location="${test.bin.root.dir}/regress" />
37 <property name="junit.dir" location="${basedir}/junit" />
38 <property name="junit.data.dir" location="${junit.dir}/data" />
39 <property name="junit.reports.dir" location="${junit.dir}/reports" />
40 <property name="coverage.dir" location="${basedir}/coverage" />
41 <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
42 <classpath path="${jacoco.jar}" />
43 </taskdef>
44
45 <!-- Benchmark -->
46
47 <property name="bench.src.dir" location="${basedir}/bench" />
48
49 <!-- Running ANTLR -->
50 <path id="antlr.class.path">
51 <pathelement location="${antlr.jar}" />
52 </path>
53
54 <target name="checkCommandParserChanges">
55 <uptodate property="noCommandParserChanges">
56 <srcfiles file="${grammar.dir}/Command.g4" />
57 <srcfiles file="${grammar.dir}/Command.tokens" />
58 <srcfiles file="${grammar.dir}/CommandLexer.tokens" />
59 <compositemapper>
60 <mapper type="merge" to="${real.src.dir}/run/common/CommandLexer.java" />
61 <mapper type="merge" to="${real.src.dir}/run/common/CommandParser.java" />
62 <mapper type="merge" to="${real.src.dir}/run/common/CommandListener.java" />
63 <mapper type="merge" to="${real.src.dir}/run/common/CommandBaseListener.java" />
64 </compositemapper>
65 </uptodate>
66 </target>
67
68 <target name="CommandParser" depends="checkCommandParserChanges" unless="noCommandParserChanges">
69 <java classname="org.antlr.v4.Tool" classpathref="antlr.class.path" fork="true" failonerror="true" dir="${grammar.dir}">
70 <arg value="-package" />
71 <arg value="edu.udel.cis.vsl.civl.run.common" />
72 <!-- <arg value="-o" />
73 <arg value="${real.src.dir}/run/common" />-->
74 <arg value="Command.g4" />
75 </java>
76 <move file="${grammar.dir}/CommandLexer.java" todir="${real.src.dir}/run/common" />
77 <move file="${grammar.dir}/CommandParser.java" todir="${real.src.dir}/run/common" />
78 <move file="${grammar.dir}/CommandListener.java" todir="${real.src.dir}/run/common" />
79 <move file="${grammar.dir}/CommandBaseListener.java" todir="${real.src.dir}/run/common" />
80 </target>
81
82 <!-- Source compilation and JAR construction -->
83
84 <path id="src.compile.classpath">
85 <pathelement location="${src.dir}" />
86 <pathelement location="${sarl.jar}" />
87 <pathelement location="${gmc.jar}" />
88 <pathelement location="${abc.jar}" />
89 <pathelement location="${antlr.jar}" />
90 </path>
91
92 <target name="compile" depends="CommandParser" description="Compile all java source files.">
93 <mkdir dir="${bin.dir}" />
94 <javac debug="true" srcdir="${src.dir}" destdir="${bin.dir}" includes="edu/udel/cis/vsl/civl/**" classpathref="src.compile.classpath" encoding="UTF-8" includeantruntime="false">
95 </javac>
96 </target>
97
98 <target name="jar" depends="compile" description="Jar up all class files.">
99 <jar destfile="${jar-path}">
100 <fileset dir="${bin.dir}" />
101 <zipfileset includes="**/*.class" src="${abc.jar}" />
102 <zipfileset includes="**/*.h" src="${abc.jar}" />
103 <zipfileset includes="**/*.cvh" src="${abc.jar}" />
104 <zipfileset includes="**/*.class" src="${antlr.runtime.jar}" />
105 <zipfileset includes="**/*.class" src="${gmc.jar}" />
106 <zipfileset includes="**/*.class" src="${sarl.jar}" />
107 <fileset dir="${basedir}/Images" />
108 <fileset dir="${basedir}/text/include" />
109 <manifest>
110 <attribute name="Built-By" value="${user.name}" />
111 <attribute name="Main-Class" value="${main-class}" />
112 </manifest>
113 </jar>
114 </target>
115
116 <!-- Plain JUnit tests -->
117
118 <path id="test.compile.classpath">
119 <pathelement location="${test.src.dir}" />
120 <pathelement location="${bin.dir}" />
121 <pathelement location="${junit.jar}" />
122 <pathelement location="${hamcrest.jar}" />
123 <pathelement location="${sarl.jar}" />
124 <pathelement location="${gmc.jar}" />
125 <pathelement location="${abc.jar}" />
126 <pathelement location="${antlr.jar}" />
127 </path>
128
129 <path id="test.execute.classpath">
130 <pathelement location="${test.bin.dir}" />
131 <pathelement location="${bin.dir}" />
132 <pathelement location="${junit.jar}" />
133 <pathelement location="${hamcrest.jar}" />
134 <pathelement location="${sarl.jar}" />
135 <pathelement location="${gmc.jar}" />
136 <pathelement location="${abc.jar}" />
137 <pathelement location="${basedir}/text/include" />
138 <pathelement location="${antlr.jar}" />
139 </path>
140
141 <target name="test-init">
142 <delete dir="${junit.dir}" quiet="true" />
143 <delete dir="${test.bin.dir}" quiet="true" />
144 <mkdir dir="${junit.dir}" />
145 <mkdir dir="${junit.data.dir}" />
146 <mkdir dir="${junit.reports.dir}" />
147 <mkdir dir="${test.bin.dir}" />
148 </target>
149
150 <target name="test-compile" depends="compile,test-init">
151 <javac destdir="${test.bin.dir}" debug="true" failonerror="false" classpathref="test.compile.classpath" encoding="UTF-8" includeantruntime="true">
152 <src path="${test.src.dir}" />
153 </javac>
154 </target>
155
156 <target name="test-run" depends="test-compile">
157 <jacoco:coverage>
158 <junit fork="true" forkmode="once" timeout="900000">
159 <jvmarg value="-ea" />
160 <classpath refid="test.execute.classpath" />
161 <formatter type="brief" usefile="false" />
162 <formatter type="xml" />
163 <batchtest todir="${junit.data.dir}">
164 <fileset dir="${test.bin.dir}" includes="**/*Test.class" />
165 </batchtest>
166 </junit>
167 </jacoco:coverage>
168 <junitreport todir="${junit.data.dir}">
169 <fileset dir="${junit.data.dir}">
170 <include name="TEST-*.xml" />
171 </fileset>
172 <report format="frames" todir="${junit.reports.dir}">
173 <param name="TITLE" expression="JUnit Report for CIVL ${revision} Regression Suite" />
174 </report>
175 </junitreport>
176 </target>
177
178 <target name="test" depends="test-run">
179 <jacoco:report>
180 <executiondata>
181 <file file="jacoco.exec" />
182 </executiondata>
183 <structure name="Test Coverage Report for CIVL ${revision} Regression Suite">
184 <classfiles>
185 <fileset dir="${bin.dir}" />
186 </classfiles>
187 <sourcefiles encoding="UTF-8">
188 <fileset dir="${src.dir}" />
189 </sourcefiles>
190 </structure>
191 <html destdir="coverage" />
192 </jacoco:report>
193 </target>
194
195 <!-- Benchmark Tasks -->
196
197 <target name="bench-compile" depends="jar" description="Compile benchmark java source files.">
198 <mkdir dir="${bin.dir}" />
199 <javac debug="true" srcdir="${bench.src.dir}" destdir="${bin.dir}" includes="edu/udel/cis/vsl/civl/**/*Benchmark.java" classpathref="src.compile.classpath" encoding="UTF-8" includeantruntime="false">
200 </javac>
201 </target>
202
203 <!-- Javadoc Tasks -->
204
205 <target name="javadoc">
206 <delete dir="${javadoc.dir}" quiet="true" />
207 <mkdir dir="${javadoc.dir}" />
208 <javadoc destdir="${javadoc.dir}" Overview="src/overview.html" author="false" version="true" use="true" windowtitle="API for CIVL ${revision}" access="public" classpathref="test.execute.classpath" failonerror="false">
209 <packageset dir="${src.dir}" defaultexcludes="yes">
210 <include name="**/IF" />
211 <include name="**/IF/**" />
212 <include name="edu/udel/cis/vsl/civl" />
213 </packageset>
214 </javadoc>
215 </target>
216
217 <!-- Clean -->
218
219 <target name="clean" description="Delete all generated files.">
220 <delete dir="${bin.dir}" />
221 <delete dir="${test.bin.root.dir}" />
222 <delete dir="${junit.dir}" />
223 <delete dir="${javadoc.dir}" />
224 <delete dir="${coverage.dir}" />
225 <delete file="${jar-path}" />
226 <delete file="${basedir}/jacoco.exec" />
227 <delete file="${manifest-file}" />
228 <delete file="${grammar.dir}/Command.tokens" />
229 <delete file="${grammar.dir}/CommandLexer.tokens" />
230 <delete file="${real.src.dir}/run/common/CommandLexer.java" />
231 <delete file="${real.src.dir}/run/common/CommandParser.java" />
232 <delete file="${real.src.dir}/run/common/CommandListener.java" />
233 <delete file="${real.src.dir}/run/common/CommandBaseListener.java" />
234 </target>
235
236 <!-- Do everything -->
237
238 <target name="all" depends="jar,test,javadoc,bench-compile" />
239
240</project>
Note: See TracBrowser for help on using the repository browser.