source: CIVL/build.xml@ 57970ad

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

added text/include in build.xml.

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

  • Property mode set to 100644
File size: 6.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" 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}/text/include" />
68 <fileset dir="${basedir}/lib" />
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}" />
82 <pathelement location="${hamcrest.jar}" />
83 <pathelement location="${sarl.jar}" />
84 <pathelement location="${gmc.jar}" />
85 <pathelement location="${abc.jar}" />
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}" />
92 <pathelement location="${hamcrest.jar}" />
93 <pathelement location="${sarl.jar}" />
94 <pathelement location="${gmc.jar}" />
95 <pathelement location="${abc.jar}" />
96 <pathelement location="${basedir}/text/include" />
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">
109 <javac destdir="${test.bin.dir}" debug="true" failonerror="false" classpathref="test.compile.classpath" encoding="UTF-8" includeantruntime="true">
110 <src path="${test.src.dir}" />
111 </javac>
112 </target>
113
114 <target name="test-run" depends="test-compile">
115 <jacoco:coverage>
116 <junit fork="true" forkmode="once" timeout="300000">
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>
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}">
131 <param name="TITLE" expression="JUnit Report for CIVL ${revision}" />
132 </report>
133 </junitreport>
134 </target>
135
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>
151 </target>
152
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>
160
161 <!-- Javadoc Tasks -->
162
163 <target name="javadoc">
164 <delete dir="${javadoc.dir}" quiet="true" />
165 <mkdir dir="${javadoc.dir}" />
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" sourcepath="${src.dir}" failonerror="false">
167 </javadoc>
168 </target>
169
170 <!-- Clean -->
171
172 <target name="clean" description="Delete all generated files.">
173 <delete dir="${bin.dir}" />
174 <delete dir="${test.bin.dir}" />
175 <delete dir="${junit.dir}" />
176 <delete dir="${javadoc.dir}" />
177 <delete dir="${coverage.dir}" />
178 <delete file="${jar-path}" />
179 <delete file="${basedir}/jacoco.exec" />
180 <delete file="${manifest-file}" />
181 </target>
182
183 <!-- Do everything -->
184
185 <target name="all" depends="jar,test,javadoc,bench-compile" />
186
187</project>
Note: See TracBrowser for help on using the repository browser.