source: CIVL/build.xml@ 50f834b

1.23 2.0 main test-branch
Last change on this file since 50f834b was 45abec4, checked in by Manchun Zheng <zmanchun@…>, 12 years ago

improved javadocs.

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

  • Property mode set to 100644
File size: 6.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" />
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}" />
[f8cc302]67 <fileset dir="${basedir}/text/include" />
[af8a6cb]68 <fileset dir="${basedir}/lib" />
[173ff32]69 <manifest>
70 <attribute name="Built-By" value="${user.name}" />
71 <attribute name="Main-Class" value="${main-class}" />
72 </manifest>
73 </jar>
74 </target>
75
76 <!-- Plain JUnit tests -->
77
78 <path id="test.compile.classpath">
79 <pathelement location="${test.src.dir}" />
80 <pathelement location="${bin.dir}" />
81 <pathelement location="${junit.jar}" />
[d75e0d7]82 <pathelement location="${hamcrest.jar}" />
[290908a]83 <pathelement location="${sarl.jar}" />
84 <pathelement location="${gmc.jar}" />
85 <pathelement location="${abc.jar}" />
[173ff32]86 </path>
87
88 <path id="test.execute.classpath">
89 <pathelement location="${test.bin.dir}" />
90 <pathelement location="${bin.dir}" />
91 <pathelement location="${junit.jar}" />
[d75e0d7]92 <pathelement location="${hamcrest.jar}" />
[290908a]93 <pathelement location="${sarl.jar}" />
94 <pathelement location="${gmc.jar}" />
95 <pathelement location="${abc.jar}" />
[f8cc302]96 <pathelement location="${basedir}/text/include" />
[173ff32]97 </path>
98
99 <target name="test-init">
100 <delete dir="${junit.dir}" quiet="true" />
101 <delete dir="${test.bin.dir}" quiet="true" />
102 <mkdir dir="${junit.dir}" />
103 <mkdir dir="${junit.data.dir}" />
104 <mkdir dir="${junit.reports.dir}" />
105 <mkdir dir="${test.bin.dir}" />
106 </target>
107
108 <target name="test-compile" depends="compile,test-init">
[e31fe2c]109 <javac destdir="${test.bin.dir}" debug="true" failonerror="false" classpathref="test.compile.classpath" encoding="UTF-8" includeantruntime="true">
[173ff32]110 <src path="${test.src.dir}" />
111 </javac>
112 </target>
113
[12af7b8]114 <target name="test-run" depends="test-compile">
115 <jacoco:coverage>
[9ac0d73]116 <junit fork="true" forkmode="once" timeout="300000">
[12af7b8]117 <jvmarg value="-ea" />
118 <classpath refid="test.execute.classpath" />
119 <formatter type="brief" usefile="false" />
120 <formatter type="xml" />
121 <batchtest todir="${junit.data.dir}">
122 <fileset dir="${test.bin.dir}" includes="**/*Test.class" />
123 </batchtest>
124 </junit>
125 </jacoco:coverage>
[173ff32]126 <junitreport todir="${junit.data.dir}">
127 <fileset dir="${junit.data.dir}">
128 <include name="TEST-*.xml" />
129 </fileset>
130 <report format="frames" todir="${junit.reports.dir}">
[12af7b8]131 <param name="TITLE" expression="JUnit Report for CIVL ${revision}" />
[173ff32]132 </report>
133 </junitreport>
134 </target>
135
[12af7b8]136 <target name="test" depends="test-run">
137 <jacoco:report>
138 <executiondata>
139 <file file="jacoco.exec" />
140 </executiondata>
141 <structure name="Test Coverage Report for CIVL ${revision}">
142 <classfiles>
143 <fileset dir="${bin.dir}" />
144 </classfiles>
145 <sourcefiles encoding="UTF-8">
146 <fileset dir="${src.dir}" />
147 </sourcefiles>
148 </structure>
149 <html destdir="coverage" />
150 </jacoco:report>
[173ff32]151 </target>
152
[6f2b49d]153 <!-- Benchmark Tasks -->
154
155 <target name="bench-compile" depends="jar" description="Compile benchmark java source files.">
156 <mkdir dir="${bin.dir}" />
157 <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">
158 </javac>
159 </target>
[173ff32]160
161 <!-- Javadoc Tasks -->
162
163 <target name="javadoc">
164 <delete dir="${javadoc.dir}" quiet="true" />
165 <mkdir dir="${javadoc.dir}" />
[45abec4]166 <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">
167 <packageset dir="${src.dir}" defaultexcludes="yes">
168 <include name="**/IF" />
169 <include name="**/IF/**" />
170 <include name="edu/udel/cis/vsl/civl" />
171 </packageset>
[173ff32]172 </javadoc>
173 </target>
174
175 <!-- Clean -->
176
177 <target name="clean" description="Delete all generated files.">
178 <delete dir="${bin.dir}" />
179 <delete dir="${test.bin.dir}" />
180 <delete dir="${junit.dir}" />
181 <delete dir="${javadoc.dir}" />
[12af7b8]182 <delete dir="${coverage.dir}" />
[173ff32]183 <delete file="${jar-path}" />
[12af7b8]184 <delete file="${basedir}/jacoco.exec" />
[173ff32]185 <delete file="${manifest-file}" />
186 </target>
187
188 <!-- Do everything -->
189
[6f2b49d]190 <target name="all" depends="jar,test,javadoc,bench-compile" />
[173ff32]191
192</project>
Note: See TracBrowser for help on using the repository browser.