source: CIVL/build.xml@ 97cfc53

1.23 2.0 main test-branch
Last change on this file since 97cfc53 was bf5d35f, checked in by Stephen Siegel <siegel@…>, 13 years ago

Adding new examples. Removed unused definition in build.xml.

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

  • Property mode set to 100644
File size: 5.6 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 <property file="build.properties" />
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}" />
23 <property name="main-class" value="edu.udel.cis.vsl.civl.CIVL" />
24
25 <!-- Junit and JaCoCo Coverage -->
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" />
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>
36
37
38 <!-- Source compilation and JAR construction -->
39
40 <path id="src.compile.classpath">
41 <pathelement location="${src.dir}" />
42 <pathelement location="${sarl.jar}" />
43 <pathelement location="${gmc.jar}" />
44 <pathelement location="${abc.jar}" />
45 </path>
46
47 <target name="compile" description="Compile all java source files.">
48 <mkdir dir="${bin.dir}" />
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">
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}" />
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}" />
60 <fileset dir="${basedir}/lib" />
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}" />
74 <pathelement location="${sarl.jar}" />
75 <pathelement location="${gmc.jar}" />
76 <pathelement location="${abc.jar}" />
77 </path>
78
79 <path id="test.execute.classpath">
80 <pathelement location="${test.bin.dir}" />
81 <pathelement location="${bin.dir}" />
82 <pathelement location="${junit.jar}" />
83 <pathelement location="${sarl.jar}" />
84 <pathelement location="${gmc.jar}" />
85 <pathelement location="${abc.jar}" />
86 </path>
87
88 <target name="test-init">
89 <delete dir="${junit.dir}" quiet="true" />
90 <delete dir="${test.bin.dir}" quiet="true" />
91 <mkdir dir="${junit.dir}" />
92 <mkdir dir="${junit.data.dir}" />
93 <mkdir dir="${junit.reports.dir}" />
94 <mkdir dir="${test.bin.dir}" />
95 </target>
96
97 <target name="test-compile" depends="compile,test-init">
98 <javac destdir="${test.bin.dir}" debug="true" failonerror="false" classpathref="test.compile.classpath" encoding="UTF-8" includeantruntime="true">
99 <src path="${test.src.dir}" />
100 </javac>
101 </target>
102
103 <target name="test-run" depends="test-compile">
104 <jacoco:coverage>
105 <junit fork="true" forkmode="once" timeout="300000">
106 <jvmarg value="-ea" />
107 <classpath refid="test.execute.classpath" />
108 <formatter type="brief" usefile="false" />
109 <formatter type="xml" />
110 <batchtest todir="${junit.data.dir}">
111 <fileset dir="${test.bin.dir}" includes="**/*Test.class" />
112 </batchtest>
113 </junit>
114 </jacoco:coverage>
115 <junitreport todir="${junit.data.dir}">
116 <fileset dir="${junit.data.dir}">
117 <include name="TEST-*.xml" />
118 </fileset>
119 <report format="frames" todir="${junit.reports.dir}">
120 <param name="TITLE" expression="JUnit Report for CIVL ${revision}" />
121 </report>
122 </junitreport>
123 </target>
124
125 <target name="test" depends="test-run">
126 <jacoco:report>
127 <executiondata>
128 <file file="jacoco.exec" />
129 </executiondata>
130 <structure name="Test Coverage Report for CIVL ${revision}">
131 <classfiles>
132 <fileset dir="${bin.dir}" />
133 </classfiles>
134 <sourcefiles encoding="UTF-8">
135 <fileset dir="${src.dir}" />
136 </sourcefiles>
137 </structure>
138 <html destdir="coverage" />
139 </jacoco:report>
140 </target>
141
142
143 <!-- Javadoc Tasks -->
144
145 <target name="javadoc">
146 <delete dir="${javadoc.dir}" quiet="true" />
147 <mkdir dir="${javadoc.dir}" />
148 <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">
149 </javadoc>
150 </target>
151
152 <!-- Clean -->
153
154 <target name="clean" description="Delete all generated files.">
155 <delete dir="${bin.dir}" />
156 <delete dir="${test.bin.dir}" />
157 <delete dir="${junit.dir}" />
158 <delete dir="${javadoc.dir}" />
159 <delete dir="${coverage.dir}" />
160 <delete file="${jar-path}" />
161 <delete file="${basedir}/jacoco.exec" />
162 <delete file="${manifest-file}" />
163 </target>
164
165 <!-- Do everything -->
166
167 <target name="all" depends="jar,test,javadoc" />
168
169</project>
Note: See TracBrowser for help on using the repository browser.