source: CIVL/mods/dev.civl.sarl/build.xml@ cb4d4f4

main test-branch
Last change on this file since cb4d4f4 was d5cb19a, checked in by Stephen Siegel <siegel@…>, 3 years ago

Fixing some things in the build files, adding overall build file.

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

  • Property mode set to 100644
File size: 5.5 KB
Line 
1<!--
2 build.xml : Ant build file for SARL module
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="SARL" basedir="." default="compile"
14 xmlns:jacoco="antlib:org.jacoco.ant">
15 <import file="../dev.civl.com/common.xml" />
16
17 <!-- Properties -->
18 <property name="src.dir" value="${sarl.src.dir}" />
19 <property name="bin.dir" value="${sarl.bin.dir}" />
20 <property name="real.src.dir" value="${src.dir}/dev/civl/sarl" />
21 <property name="test.src.dir" location="${sarl.test.dir}/regress" />
22 <property name="test.bin.root.dir" location="${sarl.dir}/bin-test" />
23 <property name="test.bin.dir"
24 location="${test.bin.root.dir}/regress" />
25 <property name="junit.dir" location="${sarl.junit.dir}" />
26 <property name="junit.data.dir" location="${junit.dir}/data" />
27 <property name="junit.reports.dir" location="${junit.dir}/reports" />
28 <property name="coverage.dir" location="${sarl.coverage.dir}" />
29 <property name="bench.src.dir" location="${sarl.bench.dir}" />
30 <property name="javadoc.dir" location="${sarl.javadoc.dir}" />
31
32 <!-- Source compilation -->
33
34 <target name="compile"
35 description="Compile all Java source files for SARL.">
36 <mkdir dir="${bin.dir}" />
37 <javac release="${javaversion}" debug="true"
38 srcdir="${src.dir}" destdir="${bin.dir}"
39 encoding="UTF-8" includeantruntime="false">
40 </javac>
41 </target>
42
43 <!-- JUnit tests and Jacoco coverage analysis -->
44
45 <path id="test.compile.classpath">
46 <pathelement location="${test.src.dir}" />
47 <pathelement location="${bin.dir}" />
48 <pathelement location="${junit.jar}" />
49 <pathelement location="${hamcrest.jar}" />
50 </path>
51
52 <path id="test.execute.classpath">
53 <pathelement location="${test.bin.dir}" />
54 <pathelement location="${bin.dir}" />
55 <pathelement location="${junit.jar}" />
56 <pathelement location="${hamcrest.jar}" />
57 </path>
58
59 <target name="test-init">
60 <delete dir="${junit.dir}" quiet="true" />
61 <delete dir="${test.bin.dir}" quiet="true" />
62 <mkdir dir="${junit.dir}" />
63 <mkdir dir="${junit.data.dir}" />
64 <mkdir dir="${junit.reports.dir}" />
65 <mkdir dir="${test.bin.dir}" />
66 </target>
67
68 <target name="test-compile" depends="compile,test-init">
69 <javac release="${javaversion}" destdir="${test.bin.dir}"
70 debug="true" failonerror="false"
71 classpathref="test.compile.classpath"
72 encoding="UTF-8" includeantruntime="true">
73 <src path="${test.src.dir}" />
74 </javac>
75 </target>
76
77 <target name="test-run" depends="test-compile">
78 <jacoco:coverage
79 includes="dev/civl/sarl/*">
80 <junit fork="true" forkmode="perTest" threads="${nthreads}" timeout="900000">
81 <jvmarg value="-ea" />
82 <classpath refid="test.execute.classpath" />
83 <formatter type="brief" usefile="false" />
84 <formatter type="xml" />
85 <batchtest todir="${junit.data.dir}">
86 <fileset dir="${test.bin.dir}" includes="**/*Test.class" />
87 </batchtest>
88 </junit>
89 </jacoco:coverage>
90 <junitreport todir="${junit.data.dir}">
91 <fileset dir="${junit.data.dir}">
92 <include name="TEST-*.xml" />
93 </fileset>
94 <report format="frames" todir="${junit.reports.dir}">
95 <param name="TITLE"
96 expression="JUnit Report for SARL ${civlversion}.${revision} Regression Suite" />
97 </report>
98 </junitreport>
99 </target>
100
101 <target name="test" depends="test-run">
102 <jacoco:report>
103 <executiondata>
104 <file file="jacoco.exec" />
105 </executiondata>
106 <structure name="Test Coverage Report for SARL ${civlversion}.${revision} Regression Suite">
107 <classfiles>
108 <fileset dir="${bin.dir}" />
109 </classfiles>
110 <sourcefiles encoding="UTF-8">
111 <fileset dir="${src.dir}" />
112 </sourcefiles>
113 </structure>
114 <html destdir="coverage" />
115 </jacoco:report>
116 </target>
117
118 <!-- Benchmark Tasks -->
119
120 <!-- TODO: just make this part of regular SARL source? -->
121
122 <target name="bench-compile" depends="compile"
123 description="Compile benchmark java source files.">
124 <javac release="${javaversion}"
125 debug="true" srcdir="${bench.src.dir}" destdir="${bin.dir}"
126 encoding="UTF-8" includeantruntime="false"
127 includes="dev/civl/sarl/**/*Benchmark*.java">
128 <modulepath>
129 <pathelement path="${bin.dir}" />
130 </modulepath>
131 </javac>
132 </target>
133
134 <!-- Javadoc Tasks -->
135
136 <target name="javadoc">
137 <delete dir="${javadoc.dir}" quiet="true" />
138 <mkdir dir="${javadoc.dir}" />
139 <javadoc destdir="${javadoc.dir}"
140 Overview="${src.dir}/overview.html"
141 author="false" version="true" use="true"
142 windowtitle="SARL ${civlversion}.${revision}"
143 access="public"
144 classpathref="test.execute.classpath"
145 failonerror="false">
146 <packageset dir="${src.dir}" defaultexcludes="yes">
147 <include name="**/IF" />
148 <include name="**/IF/**" />
149 <include name="dev/civl/sarl" />
150 </packageset>
151 </javadoc>
152 </target>
153
154 <!-- Clean -->
155
156 <target name="clean" description="Delete all generated files."
157 depends="clean-default">
158 <delete dir="${bin.dir}" />
159 <delete dir="${test.bin.root.dir}" />
160 <delete dir="${junit.dir}" />
161 <delete dir="${javadoc.dir}" />
162 <delete dir="${coverage.dir}" />
163 <delete file="${sarl.dir}/jacoco.exec" />
164 </target>
165
166 <!-- Do everything -->
167
168 <target name="all" depends="test,javadoc,bench-compile" />
169
170</project>
Note: See TracBrowser for help on using the repository browser.