source: CIVL/build.xml@ be4355b

1.23 2.0 main test-branch
Last change on this file since be4355b was 6f2b49d, checked in by Manchun Zheng <zmanchun@…>, 12 years ago

updated README.

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

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