source: CIVL/build.xml@ c9cfd85

1.23 2.0 main test-branch
Last change on this file since c9cfd85 was ea8d8ce, checked in by Manchun Zheng <zmanchun@…>, 11 years ago

added target for compiling scale benchmarks: bench-scale-compile

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

  • Property mode set to 100644
File size: 9.2 KB
RevLine 
[173ff32]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
[12af7b8]13<project name="CIVL" basedir="." default="jar" xmlns:jacoco="antlib:org.jacoco.ant">
[173ff32]14
15 <!-- Directories -->
16
[d005d94]17 <condition property="properties.file" value="build.properties" else="build_default.properties">
18 <available file="build.properties" />
19 </condition>
20 <property file="${properties.file}" />
[eb6952c]21 <property file="build.properties" />
[173ff32]22 <property name="src.dir" value="${basedir}/src" />
[5af87592]23 <property name="real.src.dir" value="${src.dir}/edu/udel/cis/vsl/civl" />
[173ff32]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}" />
[dad210da]28 <property name="main-class" value="edu.udel.cis.vsl.civl.CIVL" />
[5af87592]29 <property name="grammar.dir" value="${basedir}/grammar" />
30
[173ff32]31
[12af7b8]32 <!-- Junit and JaCoCo Coverage -->
[173ff32]33
[92ccda3]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" />
[173ff32]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" />
[12af7b8]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>
[173ff32]44
[6f2b49d]45 <!-- Benchmark -->
46
47 <property name="bench.src.dir" location="${basedir}/bench" />
[173ff32]48
[5af87592]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
[173ff32]82 <!-- Source compilation and JAR construction -->
83
84 <path id="src.compile.classpath">
85 <pathelement location="${src.dir}" />
[290908a]86 <pathelement location="${sarl.jar}" />
87 <pathelement location="${gmc.jar}" />
88 <pathelement location="${abc.jar}" />
[5af87592]89 <pathelement location="${antlr.jar}" />
[173ff32]90 </path>
91
[5af87592]92 <target name="compile" depends="CommandParser" description="Compile all java source files.">
[173ff32]93 <mkdir dir="${bin.dir}" />
[f0296bc8]94 <javac debug="true" srcdir="${src.dir}" destdir="${bin.dir}" classpathref="src.compile.classpath" encoding="UTF-8" includeantruntime="false">
[173ff32]95 </javac>
[f0296bc8]96 <copy todir="${bin.dir}/include">
97 <fileset dir="${src.dir}/include" />
98 </copy>
[173ff32]99 </target>
100
101 <target name="jar" depends="compile" description="Jar up all class files.">
102 <jar destfile="${jar-path}">
103 <fileset dir="${bin.dir}" />
[290908a]104 <zipfileset includes="**/*.class" src="${abc.jar}" />
[2a87bde]105 <zipfileset includes="include/**" src="${abc.jar}" />
[5af87592]106 <zipfileset includes="**/*.class" src="${antlr.runtime.jar}" />
[290908a]107 <zipfileset includes="**/*.class" src="${gmc.jar}" />
108 <zipfileset includes="**/*.class" src="${sarl.jar}" />
[173ff32]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}" />
[d75e0d7]122 <pathelement location="${hamcrest.jar}" />
[290908a]123 <pathelement location="${sarl.jar}" />
124 <pathelement location="${gmc.jar}" />
125 <pathelement location="${abc.jar}" />
[5af87592]126 <pathelement location="${antlr.jar}" />
[173ff32]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}" />
[d75e0d7]133 <pathelement location="${hamcrest.jar}" />
[290908a]134 <pathelement location="${sarl.jar}" />
135 <pathelement location="${gmc.jar}" />
136 <pathelement location="${abc.jar}" />
[5af87592]137 <pathelement location="${antlr.jar}" />
[173ff32]138 </path>
139
140 <target name="test-init">
141 <delete dir="${junit.dir}" quiet="true" />
142 <delete dir="${test.bin.dir}" quiet="true" />
143 <mkdir dir="${junit.dir}" />
144 <mkdir dir="${junit.data.dir}" />
145 <mkdir dir="${junit.reports.dir}" />
146 <mkdir dir="${test.bin.dir}" />
147 </target>
148
149 <target name="test-compile" depends="compile,test-init">
[e31fe2c]150 <javac destdir="${test.bin.dir}" debug="true" failonerror="false" classpathref="test.compile.classpath" encoding="UTF-8" includeantruntime="true">
[173ff32]151 <src path="${test.src.dir}" />
152 </javac>
153 </target>
154
[12af7b8]155 <target name="test-run" depends="test-compile">
156 <jacoco:coverage>
[2e00014]157 <junit fork="true" forkmode="once" timeout="900000">
[12af7b8]158 <jvmarg value="-ea" />
159 <classpath refid="test.execute.classpath" />
160 <formatter type="brief" usefile="false" />
161 <formatter type="xml" />
162 <batchtest todir="${junit.data.dir}">
163 <fileset dir="${test.bin.dir}" includes="**/*Test.class" />
164 </batchtest>
165 </junit>
166 </jacoco:coverage>
[173ff32]167 <junitreport todir="${junit.data.dir}">
168 <fileset dir="${junit.data.dir}">
169 <include name="TEST-*.xml" />
170 </fileset>
171 <report format="frames" todir="${junit.reports.dir}">
[92ccda3]172 <param name="TITLE" expression="JUnit Report for CIVL ${revision} Regression Suite" />
[173ff32]173 </report>
174 </junitreport>
175 </target>
176
[12af7b8]177 <target name="test" depends="test-run">
178 <jacoco:report>
179 <executiondata>
180 <file file="jacoco.exec" />
181 </executiondata>
[92ccda3]182 <structure name="Test Coverage Report for CIVL ${revision} Regression Suite">
[12af7b8]183 <classfiles>
184 <fileset dir="${bin.dir}" />
185 </classfiles>
186 <sourcefiles encoding="UTF-8">
187 <fileset dir="${src.dir}" />
188 </sourcefiles>
189 </structure>
190 <html destdir="coverage" />
191 </jacoco:report>
[173ff32]192 </target>
193
[6f2b49d]194 <!-- Benchmark Tasks -->
195
196 <target name="bench-compile" depends="jar" description="Compile benchmark java source files.">
197 <mkdir dir="${bin.dir}" />
[3f2c5eb]198 <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">
[6f2b49d]199 </javac>
200 </target>
[173ff32]201
[ea8d8ce]202 <target name="bench-scale-compile" depends="jar" description="Compile scale benchmark java source files.">
203 <mkdir dir="${bin.dir}" />
204 <javac debug="true" srcdir="${bench.src.dir}" destdir="${bin.dir}" includes="edu/udel/cis/vsl/civl/**/**/*BenchmarkScale.java" classpathref="src.compile.classpath" encoding="UTF-8" includeantruntime="false">
205 </javac>
206 </target>
207
[173ff32]208 <!-- Javadoc Tasks -->
209
210 <target name="javadoc">
211 <delete dir="${javadoc.dir}" quiet="true" />
212 <mkdir dir="${javadoc.dir}" />
[45abec4]213 <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">
214 <packageset dir="${src.dir}" defaultexcludes="yes">
215 <include name="**/IF" />
216 <include name="**/IF/**" />
217 <include name="edu/udel/cis/vsl/civl" />
218 </packageset>
[173ff32]219 </javadoc>
220 </target>
221
222 <!-- Clean -->
223
224 <target name="clean" description="Delete all generated files.">
225 <delete dir="${bin.dir}" />
[92ccda3]226 <delete dir="${test.bin.root.dir}" />
[173ff32]227 <delete dir="${junit.dir}" />
228 <delete dir="${javadoc.dir}" />
[12af7b8]229 <delete dir="${coverage.dir}" />
[173ff32]230 <delete file="${jar-path}" />
[12af7b8]231 <delete file="${basedir}/jacoco.exec" />
[173ff32]232 <delete file="${manifest-file}" />
[5af87592]233 <delete file="${grammar.dir}/Command.tokens" />
234 <delete file="${grammar.dir}/CommandLexer.tokens" />
235 <delete file="${real.src.dir}/run/common/CommandLexer.java" />
236 <delete file="${real.src.dir}/run/common/CommandParser.java" />
237 <delete file="${real.src.dir}/run/common/CommandListener.java" />
238 <delete file="${real.src.dir}/run/common/CommandBaseListener.java" />
[173ff32]239 </target>
240
241 <!-- Do everything -->
242
[ea8d8ce]243 <target name="all" depends="jar,test,javadoc,bench-compile, bench-scale-compile" />
[173ff32]244
245</project>
Note: See TracBrowser for help on using the repository browser.