source: CIVL/build.xml@ afc300c

1.23 2.0 main test-branch
Last change on this file since afc300c was eb8c59a, checked in by Stephen Siegel <siegel@…>, 6 years ago

Trying again to fix the jacoco ant task includes/excludes

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

  • Property mode set to 100644
File size: 9.6 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}" />
[845d723]94 <javac release="${javaversion}" 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">
[845d723]150 <javac release="${javaversion}" 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
[84b6f51]155 <!-- What t nclde n nstrmentatn
156 All CVL classes nt generated Lstener Lexer Parser
157
158 -->
159
[12af7b8]160 <target name="test-run" depends="test-compile">
[84b6f51]161 <jacoco:coverage
[eb8c59a]162 excludes="*Listener*:*Lexer*:*Parser*"
163 includes="edu/udel/cis/vsl/civl/*">
[84b6f51]164 <junit fork="true" forkmode="perTest" threads="${nthreads}" timeout="900000">
165 <jvmarg value="-ea" />
166 <classpath refid="test.execute.classpath" />
167 <formatter type="brief" usefile="false" />
168 <formatter type="xml" />
169 <batchtest todir="${junit.data.dir}">
170 <fileset dir="${test.bin.dir}" includes="**/*Test.class" />
171 </batchtest>
172 </junit>
173 </jacoco:coverage>
[173ff32]174 <junitreport todir="${junit.data.dir}">
175 <fileset dir="${junit.data.dir}">
176 <include name="TEST-*.xml" />
177 </fileset>
178 <report format="frames" todir="${junit.reports.dir}">
[92ccda3]179 <param name="TITLE" expression="JUnit Report for CIVL ${revision} Regression Suite" />
[173ff32]180 </report>
181 </junitreport>
182 </target>
183
[12af7b8]184 <target name="test" depends="test-run">
185 <jacoco:report>
186 <executiondata>
187 <file file="jacoco.exec" />
188 </executiondata>
[92ccda3]189 <structure name="Test Coverage Report for CIVL ${revision} Regression Suite">
[12af7b8]190 <classfiles>
191 <fileset dir="${bin.dir}" />
192 </classfiles>
193 <sourcefiles encoding="UTF-8">
194 <fileset dir="${src.dir}" />
195 </sourcefiles>
196 </structure>
197 <html destdir="coverage" />
198 </jacoco:report>
[173ff32]199 </target>
200
[6f2b49d]201 <!-- Benchmark Tasks -->
202
203 <target name="bench-compile" depends="jar" description="Compile benchmark java source files.">
204 <mkdir dir="${bin.dir}" />
[845d723]205 <javac release="${javaversion}" 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]206 </javac>
207 </target>
[173ff32]208
[ea8d8ce]209 <target name="bench-scale-compile" depends="jar" description="Compile scale benchmark java source files.">
210 <mkdir dir="${bin.dir}" />
[845d723]211 <javac release="${javaversion}" 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">
[ea8d8ce]212 </javac>
213 </target>
214
[173ff32]215 <!-- Javadoc Tasks -->
216
217 <target name="javadoc">
218 <delete dir="${javadoc.dir}" quiet="true" />
219 <mkdir dir="${javadoc.dir}" />
[45abec4]220 <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">
221 <packageset dir="${src.dir}" defaultexcludes="yes">
222 <include name="**/IF" />
223 <include name="**/IF/**" />
224 <include name="edu/udel/cis/vsl/civl" />
225 </packageset>
[173ff32]226 </javadoc>
227 </target>
228
229 <!-- Clean -->
230
231 <target name="clean" description="Delete all generated files.">
232 <delete dir="${bin.dir}" />
[92ccda3]233 <delete dir="${test.bin.root.dir}" />
[173ff32]234 <delete dir="${junit.dir}" />
235 <delete dir="${javadoc.dir}" />
[12af7b8]236 <delete dir="${coverage.dir}" />
[173ff32]237 <delete file="${jar-path}" />
[12af7b8]238 <delete file="${basedir}/jacoco.exec" />
[173ff32]239 <delete file="${manifest-file}" />
[5af87592]240 <delete file="${grammar.dir}/Command.tokens" />
241 <delete file="${grammar.dir}/CommandLexer.tokens" />
242 <delete file="${real.src.dir}/run/common/CommandLexer.java" />
243 <delete file="${real.src.dir}/run/common/CommandParser.java" />
244 <delete file="${real.src.dir}/run/common/CommandListener.java" />
245 <delete file="${real.src.dir}/run/common/CommandBaseListener.java" />
[173ff32]246 </target>
247
248 <!-- Do everything -->
249
[ea8d8ce]250 <target name="all" depends="jar,test,javadoc,bench-compile, bench-scale-compile" />
[173ff32]251
252</project>
Note: See TracBrowser for help on using the repository browser.