source: CIVL/build.xml@ cabeaa10

1.23 2.0 main test-branch
Last change on this file since cabeaa10 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
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 <condition property="properties.file" value="build.properties" else="build_default.properties">
18 <available file="build.properties" />
19 </condition>
20 <property file="${properties.file}" />
21 <property file="build.properties" />
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}" />
27 <property name="main-class" value="edu.udel.cis.vsl.civl.CIVL" />
28
29 <!-- Junit and JaCoCo Coverage -->
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 <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>
40
41 <!-- Benchmark -->
42
43 <property name="bench.src.dir" location="${basedir}/bench" />
44
45 <!-- Source compilation and JAR construction -->
46
47 <path id="src.compile.classpath">
48 <pathelement location="${src.dir}" />
49 <pathelement location="${sarl.jar}" />
50 <pathelement location="${gmc.jar}" />
51 <pathelement location="${abc.jar}" />
52 </path>
53
54 <target name="compile" description="Compile all java source files.">
55 <mkdir dir="${bin.dir}" />
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">
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}" />
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}" />
67 <fileset dir="${basedir}/lib" />
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}" />
81 <pathelement location="${hamcrest.jar}" />
82 <pathelement location="${sarl.jar}" />
83 <pathelement location="${gmc.jar}" />
84 <pathelement location="${abc.jar}" />
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}" />
91 <pathelement location="${hamcrest.jar}" />
92 <pathelement location="${sarl.jar}" />
93 <pathelement location="${gmc.jar}" />
94 <pathelement location="${abc.jar}" />
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">
107 <javac destdir="${test.bin.dir}" debug="true" failonerror="false" classpathref="test.compile.classpath" encoding="UTF-8" includeantruntime="true">
108 <src path="${test.src.dir}" />
109 </javac>
110 </target>
111
112 <target name="test-run" depends="test-compile">
113 <jacoco:coverage>
114 <junit fork="true" forkmode="once" timeout="300000">
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>
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}">
129 <param name="TITLE" expression="JUnit Report for CIVL ${revision}" />
130 </report>
131 </junitreport>
132 </target>
133
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>
149 </target>
150
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>
158
159 <!-- Javadoc Tasks -->
160
161 <target name="javadoc">
162 <delete dir="${javadoc.dir}" quiet="true" />
163 <mkdir dir="${javadoc.dir}" />
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">
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}" />
175 <delete dir="${coverage.dir}" />
176 <delete file="${jar-path}" />
177 <delete file="${basedir}/jacoco.exec" />
178 <delete file="${manifest-file}" />
179 </target>
180
181 <!-- Do everything -->
182
183 <target name="all" depends="jar,test,javadoc,bench-compile" />
184
185</project>
Note: See TracBrowser for help on using the repository browser.