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

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 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" default="compile"
14 xmlns:jacoco="antlib:org.jacoco.ant">
15 <import file="../../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 destfile="${sarl.dir}/jacoco.exec">
80 <junit fork="true" forkmode="perTest"
81 threads="${nthreads}" timeout="900000">
82 <jvmarg value="-ea" />
83 <classpath refid="test.execute.classpath" />
84 <formatter type="brief" usefile="false" />
85 <formatter type="xml" />
86 <batchtest todir="${junit.data.dir}">
87 <fileset dir="${test.bin.dir}" includes="**/*Test.class" />
88 </batchtest>
89 </junit>
90 </jacoco:coverage>
91 <junitreport todir="${junit.data.dir}">
92 <fileset dir="${junit.data.dir}">
93 <include name="TEST-*.xml" />
94 </fileset>
95 <report format="frames" todir="${junit.reports.dir}">
96 <param name="TITLE"
97 expression="JUnit Report for SARL ${civlversion}.${revision} Regression Suite" />
98 </report>
99 </junitreport>
100 </target>
101
102 <target name="test" depends="test-run">
103 <jacoco:report>
104 <executiondata>
105 <file file="jacoco.exec" />
106 </executiondata>
107 <structure name="Test Coverage Report for SARL ${civlversion}.${revision} Regression Suite">
108 <classfiles>
109 <fileset dir="${bin.dir}" />
110 </classfiles>
111 <sourcefiles encoding="UTF-8">
112 <fileset dir="${src.dir}" />
113 </sourcefiles>
114 </structure>
115 <html destdir="coverage" />
116 </jacoco:report>
117 </target>
118
119 <!-- Benchmark Tasks -->
120
121 <!-- TODO: just make this part of regular SARL source? -->
122
123 <target name="bench-compile" depends="compile"
124 description="Compile benchmark java source files.">
125 <javac release="${javaversion}"
126 debug="true" srcdir="${bench.src.dir}" destdir="${bin.dir}"
127 encoding="UTF-8" includeantruntime="false"
128 includes="dev/civl/sarl/**/*Benchmark*.java">
129 <modulepath>
130 <pathelement path="${bin.dir}" />
131 </modulepath>
132 </javac>
133 </target>
134
135 <!-- Javadoc Tasks -->
136
137 <target name="javadoc">
138 <delete dir="${javadoc.dir}" quiet="true" />
139 <mkdir dir="${javadoc.dir}" />
140 <javadoc destdir="${javadoc.dir}"
141 Overview="${src.dir}/overview.html"
142 author="false" version="true" use="true"
143 windowtitle="SARL ${civlversion}.${revision}"
144 access="public"
145 classpathref="test.execute.classpath"
146 failonerror="false">
147 <packageset dir="${src.dir}" defaultexcludes="yes">
148 <include name="**/IF" />
149 <include name="**/IF/**" />
150 <include name="dev/civl/sarl" />
151 </packageset>
152 </javadoc>
153 </target>
154
155 <!-- Clean -->
156
157 <target name="clean" description="Delete all generated files."
158 depends="clean-default">
159 <delete dir="${bin.dir}" />
160 <delete dir="${test.bin.root.dir}" />
161 <delete dir="${junit.dir}" />
162 <delete dir="${javadoc.dir}" />
163 <delete dir="${coverage.dir}" />
164 <delete file="${sarl.dir}/jacoco.exec" />
165 </target>
166
167 <!-- Do everything -->
168
169 <target name="all" depends="test,javadoc,bench-compile" />
170
171</project>
Note: See TracBrowser for help on using the repository browser.