source: CIVL/build.xml@ d6665ab

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

Update .classpath: 1. to use VSL for specifying classpaths of required libraries; 2. to use ABC, GMC projects instead of their .jar's. Update build.xml to use build_default.properties which makes use of /opt/vsl. Update INSTALL instructions accordingly.

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

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