source: CIVL/build.xml@ f338099

1.23 2.0 acw/focus-triggers main test-branch
Last change on this file since f338099 was 3c84707, checked in by Tim Zirkel <zirkeltk@…>, 13 years ago

Fixed build file.

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

  • Property mode set to 100644
File size: 8.4 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">
14
15 <!-- Directories -->
16
17 <property file="build.properties" />
18 <property name="src.dir" value="${basedir}/src" />
19 <property name="real.src.dir" value="${src.dir}/edu/udel/cis/vsl/civl/civlc" />
20 <property name="bin.dir" value="${basedir}/bin" />
21 <property name="javadoc.dir" value="${basedir}/doc/javadoc" />
22 <property name="jar-name" value="civl.jar" />
23 <property name="jar-path" value="${basedir}/${jar-name}" />
24<!--
25 <property name="main-class" value="edu.udel.cis.vsl.civl.CIVL" />
26 -->
27 <property name="main-class" value="edu.udel.cis.vsl.civl.CIVL" />
28
29 <!-- Junit: automated unit tester Properties -->
30
31 <property name="test.src.dir" location="${basedir}/test" />
32 <property name="test.bin.dir" location="${basedir}/bin-test" />
33 <property name="junit.dir" location="${basedir}/junit" />
34 <property name="junit.data.dir" location="${junit.dir}/data" />
35 <property name="junit.reports.dir" location="${junit.dir}/reports" />
36
37 <!-- Cobertura: test coverage analyzer Properties -->
38
39 <property name="cob.log.file" value="${basedir}/cobertura.log" />
40 <property name="cob.ser.file" value="${basedir}/cobertura.ser" />
41 <property name="cobertura.dir" value="${basedir}/cobertura" />
42 <property name="cob.instrumented.dir" value="${cobertura.dir}/instrumented" />
43 <property name="cob.reports.dir" value="${cobertura.dir}/reports" />
44 <property name="cob.reports.xml.dir" value="${cob.reports.dir}/junit-xml" />
45 <property name="cob.reports.html.dir" value="${cob.reports.dir}/junit-html" />
46 <property name="cob.coverage.xml.dir" value="${cob.reports.dir}/cobertura-xml" />
47 <property name="cob.coverage.html.dir" value="${cob.reports.dir}/cobertura-html" />
48
49 <!-- Tell Ant about Cobertura tasks -->
50
51 <path id="cobertura.classpath">
52 <fileset dir="${cobertura.lib.dir}">
53 <include name="cobertura.jar" />
54 <include name="lib/**/*.jar" />
55 </fileset>
56 </path>
57
58 <taskdef classpathref="cobertura.classpath" resource="tasks.properties" />
59
60
61 <!-- Running ANTLR -->
62
63 <path id="antlr.class.path">
64 <pathelement location="${antlr.jar}" />
65 </path>
66
67
68 <!-- Source compilation and JAR construction -->
69
70 <path id="src.compile.classpath">
71 <pathelement location="${src.dir}" />
72 <pathelement location="${antlr.jar}" />
73 <pathelement location="${sarl.jar}"/>
74 <pathelement location="${gmc.jar}"/>
75 </path>
76
77 <target name="compile" description="Compile all java source files.">
78 <mkdir dir="${bin.dir}" />
79 <javac debug="true" srcdir="${src.dir}" destdir="${bin.dir}" includes="edu/udel/cis/vsl/civl/**" classpathref="src.compile.classpath" includeantruntime="false">
80 </javac>
81 </target>
82
83 <target name="jar" depends="compile" description="Jar up all class files.">
84 <jar destfile="${jar-path}">
85 <fileset dir="${bin.dir}" />
86 <fileset dir="${antlr.runtime.bin}" />
87 <fileset dir="${basedir}/lib" />
88 <manifest>
89 <attribute name="Built-By" value="${user.name}" />
90 <attribute name="Main-Class" value="${main-class}" />
91 </manifest>
92 </jar>
93 </target>
94
95 <!-- Plain JUnit tests -->
96
97 <path id="test.compile.classpath">
98 <pathelement location="${test.src.dir}" />
99 <pathelement location="${bin.dir}" />
100 <pathelement location="${antlr.jar}" />
101 <pathelement location="${junit.jar}" />
102 <pathelement location="${sarl.jar}"/>
103 <pathelement location="${gmc.jar}"/>
104 </path>
105
106 <path id="test.execute.classpath">
107 <pathelement location="${test.bin.dir}" />
108 <pathelement location="${bin.dir}" />
109 <pathelement location="${antlr.jar}" />
110 <pathelement location="${junit.jar}" />
111 <pathelement location="${sarl.jar}"/>
112 <pathelement location="${gmc.jar}"/>
113 </path>
114
115 <target name="test-init">
116 <delete dir="${junit.dir}" quiet="true" />
117 <delete dir="${test.bin.dir}" quiet="true" />
118 <mkdir dir="${junit.dir}" />
119 <mkdir dir="${junit.data.dir}" />
120 <mkdir dir="${junit.reports.dir}" />
121 <mkdir dir="${test.bin.dir}" />
122 </target>
123
124 <target name="test-compile" depends="compile,test-init">
125 <javac destdir="${test.bin.dir}" debug="true" failonerror="false" classpathref="test.compile.classpath" includeantruntime="true">
126 <src path="${test.src.dir}" />
127 </javac>
128 </target>
129
130 <target name="test" depends="test-compile">
131 <junit printsummary="false" errorProperty="test.failed" failureProperty="test.failed" fork="true" timeout="300000">
132 <jvmarg value="-ea" />
133 <classpath refid="test.execute.classpath" />
134 <formatter type="brief" usefile="false" />
135 <formatter type="xml" />
136 <batchtest todir="${junit.data.dir}">
137 <fileset dir="${test.bin.dir}" includes="**/*Test.class" />
138 </batchtest>
139 </junit>
140 <junitreport todir="${junit.data.dir}">
141 <fileset dir="${junit.data.dir}">
142 <include name="TEST-*.xml" />
143 </fileset>
144 <report format="frames" todir="${junit.reports.dir}">
145 <param name="TITLE" expression="JUnit Report for CIVL Project, Revision ${revision}" />
146 </report>
147 </junitreport>
148 <fail message="Tests failed. Check log and/or reports." if="test.failed" />
149 </target>
150
151 <!-- Cobertura Tasks -->
152
153 <target name="cobertura-init" depends="test-compile">
154 <delete dir="${cobertura.dir}" quiet="true" />
155 <delete file="${cob.ser.file}" quiet="true" />
156 <delete file="${cob.log.file}" quiet="true" />
157 <mkdir dir="${cobertura.dir}" />
158 <mkdir dir="${cob.instrumented.dir}" />
159 <mkdir dir="${cob.reports.xml.dir}" />
160 <mkdir dir="${cob.reports.html.dir}" />
161 <mkdir dir="${cob.coverage.xml.dir}" />
162 <mkdir dir="${cob.coverage.html.dir}" />
163 </target>
164
165 <target name="cobertura-instrument" depends="cobertura-init">
166 <cobertura-instrument todir="${cob.instrumented.dir}">
167 <ignore regex="org.apache.log4j.*" />
168 <fileset dir="${bin.dir}">
169 <include name="**/*.class" />
170 </fileset>
171 </cobertura-instrument>
172 </target>
173
174 <path id="instrumented.classpath">
175 <pathelement location="${cob.instrumented.dir}" />
176 <pathelement location="${test.bin.dir}" />
177 <pathelement location="${antlr.jar}" />
178 <pathelement location="${junit.jar}" />
179 <pathelement location="${bin.dir}" />
180 </path>
181
182 <target name="cobertura-test" depends="cobertura-instrument">
183 <junit fork="yes" dir="${basedir}" failureProperty="test.failed">
184 <jvmarg value="-ea" />
185 <classpath refid="instrumented.classpath" />
186 <classpath refid="cobertura.classpath" />
187 <formatter type="xml" />
188 <batchtest todir="${cob.reports.xml.dir}">
189 <fileset dir="${test.bin.dir}" includes="**/*Test.class" />
190 </batchtest>
191 </junit>
192 <junitreport todir="${cob.reports.xml.dir}">
193 <fileset dir="${cob.reports.xml.dir}">
194 <include name="TEST-*.xml" />
195 </fileset>
196 <report format="frames" todir="${cob.reports.html.dir}">
197 <param name="TITLE" expression="JUnit Report for CIVL Project, Revision ${revision}" />
198 </report>
199 </junitreport>
200 </target>
201
202 <target name="cobertura-html-coverage-report" depends="cobertura-test">
203 <cobertura-report destdir="${cob.coverage.html.dir}">
204 <fileset dir="${src.dir}">
205 <include name="**/*.java" />
206 </fileset>
207 </cobertura-report>
208 </target>
209
210 <target name="cobertura" depends="cobertura-html-coverage-report" />
211
212 <!-- Javadoc Tasks -->
213
214 <path id="javadoc.classpath">
215 <pathelement location="${src.dir}" />
216 <pathelement location="${junit.jar}" />
217 <pathelement location="${antlr.jar}" />
218 </path>
219
220 <target name="javadoc">
221 <delete dir="${javadoc.dir}" quiet="true" />
222 <mkdir dir="${javadoc.dir}" />
223 <javadoc destdir="${javadoc.dir}" author="true" version="true" use="true" windowtitle="CIVL Project API, Revision ${revision}" access="public" classpathref="javadoc.classpath" failonerror="false">
224 <fileset dir="${src.dir}" defaultexcludes="yes">
225 <include name="**/*.java" />
226 </fileset>
227 </javadoc>
228 </target>
229
230 <!-- Clean -->
231
232 <target name="clean" description="Delete all generated files.">
233 <delete dir="${bin.dir}" />
234 <delete dir="${test.bin.dir}" />
235 <delete dir="${junit.dir}" />
236 <delete dir="${javadoc.dir}" />
237 <delete file="${jar-path}" />
238 <delete dir="${cobertura.dir}" />
239 <delete file="${cob.ser.file}" />
240 <delete file="${cob.log.file}" />
241 <delete file="${manifest-file}" />
242 </target>
243
244 <!-- Do everything -->
245
246 <target name="all" depends="jar,test,cobertura,javadoc" />
247
248</project>
Note: See TracBrowser for help on using the repository browser.