source: CIVL/build.xml@ 2f2cccf

1.23 2.0 main test-branch
Last change on this file since 2f2cccf was 9ac0d73, checked in by Stephen Siegel <siegel@…>, 13 years ago

Ignoring test failure so coverage, etc., will occur even if tests fail.

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

  • Property mode set to 100644
File size: 5.7 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 <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 <property name="main-class" value="edu.udel.cis.vsl.civl.CIVL" />
25
26 <!-- Junit and JaCoCo Coverage -->
27
28 <property name="test.src.dir" location="${basedir}/test" />
29 <property name="test.bin.dir" location="${basedir}/bin-test" />
30 <property name="junit.dir" location="${basedir}/junit" />
31 <property name="junit.data.dir" location="${junit.dir}/data" />
32 <property name="junit.reports.dir" location="${junit.dir}/reports" />
33 <property name="coverage.dir" location="${basedir}/coverage" />
34 <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
35 <classpath path="${jacoco.jar}" />
36 </taskdef>
37
38
39 <!-- Source compilation and JAR construction -->
40
41 <path id="src.compile.classpath">
42 <pathelement location="${src.dir}" />
43 <pathelement location="${sarl.jar}" />
44 <pathelement location="${gmc.jar}" />
45 <pathelement location="${abc.jar}" />
46 </path>
47
48 <target name="compile" description="Compile all java source files.">
49 <mkdir dir="${bin.dir}" />
50 <javac debug="true" srcdir="${src.dir}" destdir="${bin.dir}" includes="edu/udel/cis/vsl/civl/**" classpathref="src.compile.classpath" encoding="UTF-8" includeantruntime="false">
51 </javac>
52 </target>
53
54 <target name="jar" depends="compile" description="Jar up all class files.">
55 <jar destfile="${jar-path}">
56 <fileset dir="${bin.dir}" />
57 <zipfileset includes="**/*.class" src="${abc.jar}" />
58 <zipfileset includes="**/*.h" src="${abc.jar}" />
59 <zipfileset includes="**/*.class" src="${gmc.jar}" />
60 <zipfileset includes="**/*.class" src="${sarl.jar}" />
61 <fileset dir="${basedir}/lib" />
62 <manifest>
63 <attribute name="Built-By" value="${user.name}" />
64 <attribute name="Main-Class" value="${main-class}" />
65 </manifest>
66 </jar>
67 </target>
68
69 <!-- Plain JUnit tests -->
70
71 <path id="test.compile.classpath">
72 <pathelement location="${test.src.dir}" />
73 <pathelement location="${bin.dir}" />
74 <pathelement location="${junit.jar}" />
75 <pathelement location="${sarl.jar}" />
76 <pathelement location="${gmc.jar}" />
77 <pathelement location="${abc.jar}" />
78 </path>
79
80 <path id="test.execute.classpath">
81 <pathelement location="${test.bin.dir}" />
82 <pathelement location="${bin.dir}" />
83 <pathelement location="${junit.jar}" />
84 <pathelement location="${sarl.jar}" />
85 <pathelement location="${gmc.jar}" />
86 <pathelement location="${abc.jar}" />
87 </path>
88
89 <target name="test-init">
90 <delete dir="${junit.dir}" quiet="true" />
91 <delete dir="${test.bin.dir}" quiet="true" />
92 <mkdir dir="${junit.dir}" />
93 <mkdir dir="${junit.data.dir}" />
94 <mkdir dir="${junit.reports.dir}" />
95 <mkdir dir="${test.bin.dir}" />
96 </target>
97
98 <target name="test-compile" depends="compile,test-init">
99 <javac destdir="${test.bin.dir}" debug="true" failonerror="false" classpathref="test.compile.classpath" encoding="UTF-8" includeantruntime="true">
100 <src path="${test.src.dir}" />
101 </javac>
102 </target>
103
104 <target name="test-run" depends="test-compile">
105 <jacoco:coverage>
106 <junit fork="true" forkmode="once" timeout="300000">
107 <jvmarg value="-ea" />
108 <classpath refid="test.execute.classpath" />
109 <formatter type="brief" usefile="false" />
110 <formatter type="xml" />
111 <batchtest todir="${junit.data.dir}">
112 <fileset dir="${test.bin.dir}" includes="**/*Test.class" />
113 </batchtest>
114 </junit>
115 </jacoco:coverage>
116 <junitreport todir="${junit.data.dir}">
117 <fileset dir="${junit.data.dir}">
118 <include name="TEST-*.xml" />
119 </fileset>
120 <report format="frames" todir="${junit.reports.dir}">
121 <param name="TITLE" expression="JUnit Report for CIVL ${revision}" />
122 </report>
123 </junitreport>
124 </target>
125
126 <target name="test" depends="test-run">
127 <jacoco:report>
128 <executiondata>
129 <file file="jacoco.exec" />
130 </executiondata>
131 <structure name="Test Coverage Report for CIVL ${revision}">
132 <classfiles>
133 <fileset dir="${bin.dir}" />
134 </classfiles>
135 <sourcefiles encoding="UTF-8">
136 <fileset dir="${src.dir}" />
137 </sourcefiles>
138 </structure>
139 <html destdir="coverage" />
140 </jacoco:report>
141 </target>
142
143
144 <!-- Javadoc Tasks -->
145
146 <target name="javadoc">
147 <delete dir="${javadoc.dir}" quiet="true" />
148 <mkdir dir="${javadoc.dir}" />
149 <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" sourcepath="${src.dir}" failonerror="false">
150 </javadoc>
151 </target>
152
153 <!-- Clean -->
154
155 <target name="clean" description="Delete all generated files.">
156 <delete dir="${bin.dir}" />
157 <delete dir="${test.bin.dir}" />
158 <delete dir="${junit.dir}" />
159 <delete dir="${javadoc.dir}" />
160 <delete dir="${coverage.dir}" />
161 <delete file="${jar-path}" />
162 <delete file="${basedir}/jacoco.exec" />
163 <delete file="${manifest-file}" />
164 </target>
165
166 <!-- Do everything -->
167
168 <target name="all" depends="jar,test,javadoc" />
169
170</project>
Note: See TracBrowser for help on using the repository browser.