source: CIVL/build.xml@ f7b95e5

1.23 2.0 main test-branch
Last change on this file since f7b95e5 was 460515e, checked in by Stephen Siegel <siegel@…>, 12 years ago

Deleting line in ant build script which includes contents of the "lib"
directory into the jar, because the lib directory is no longer there
and never contained anything anyway.

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

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