1 <?xml version="1.0" encoding="ISO-8859-1"?>
3 Licensed to the Apache Software Foundation (ASF) under one or more
4 contributor license agreements. See the NOTICE file distributed with
5 this work for additional information regarding copyright ownership.
6 The ASF licenses this file to You under the Apache License, Version 2.0
7 (the "License"); you may not use this file except in compliance with
8 the License. You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
19 <project name="drlvm" default="build">
21 Build contributed source and lay out results in the required format
24 <import file="make/properties.xml"/>
28 Apache Harmony DRLVM Build
33 Compiles the java and native code to produce a jre in
35 It is possible to build an individual component via
36 corresponding targets.
39 Removes all the files generated by a build.
42 Performs a full build - that is 'clean' then 'build'.
45 Runs smoke and unit tests.
48 Runs all pre-commit tests (in parallel on multi-way machines).
49 A single suite can be run as:
50 ant cunit.test - runs cunit tests
51 ant ehwa.test - runs automated Eclispe HWA scenario
52 ant kernel.test - runs tests for kernel.classes
53 ant smoke.test - runs smoke tests
54 ant jvmti.test - runs JVMTI tests
55 ant reg.test - runs regression tests
56 Also, it is possible to run a single testcase from specific suite
57 and customize JRE configuration, e.g.:
58 ant smoke.test -Dtest.case=exception.NPE -Dtest.mode=jit -Dtest.vmargs=-XX:+vm.crash_handler
61 Generates the javadoc (TBD).
64 Fetches dependencies. Note: Some of Harmony's dependencies are
65 licensed under terms other than the Apache License v2.
67 ant drlvm-echo echo debug-echo
68 Display the common properties that are used in the ant build files.
73 <target name="fetch-depends">
74 <ant antfile="make/depends.xml" target="fetch"/>
77 <target name="check-depends">
78 <ant antfile="make/depends.xml" target="check"/>
81 <target name="rebuild" depends="clean,build"
82 description="Performs a full build - that is 'clean' then 'build'" />
85 depends="drlvm-echo, -auto-fetch,
96 description="Compiles the java and native code to produce a jdk">
99 <target name="-auto-fetch" if="auto.fetch">
100 <antcall target="fetch-depends"/>
103 <target name="clean" depends=""
104 description="Removes all the files generated by a build">
105 <delete quiet="true" dir="${drlvm.build.dir}"/>
108 <!-- ================================================================
109 build individual components
110 ================================================================-->
112 <target name="build-extra" depends=""
113 description="Compiles external dependencies">
114 <ant antfile="make/extra/apr.xml"/>
117 <target name="encoder">
118 <ant antfile="make/vm/encoder.xml"/>
121 <target name="port" depends="build-extra">
122 <ant antfile="make/vm/port.xml"/>
125 <target name="port_ch" depends="port">
126 <ant antfile="make/vm/port_ch.xml"/>
129 <target name="hythr" depends="port">
130 <ant antfile="make/vm/hythr.xml"/>
133 <target name="verifier">
134 <ant antfile="make/vm/verifier.xml"/>
137 <target name="verifier-ext" description="Build a verifier extentions library">
138 <ant antfile="make/vm/verifier-ext.xml"/>
141 <target name="clean-verifier-ext" description="Clean a verifier extentions library">
142 <ant antfile="make/vm/verifier-ext.xml" target="clean"/>
145 <target name="vmcore" depends="encoder, port, port_ch, hythr, verifier">
146 <ant antfile="make/vm/vmcore.xml"/>
149 <target name="em" depends="vmcore">
150 <ant antfile="make/vm/em.xml"/>
153 <target name="interpreter" depends="vmcore">
154 <ant antfile="make/vm/interpreter.xml"/>
157 <target name="kernel">
158 <ant antfile="make/vm/kernel.xml"/>
161 <target name="vmi" depends="vmcore">
162 <ant antfile="make/vm/vmi.xml"/>
165 <target name="jitrino" depends="vmcore">
166 <ant antfile="make/vm/jitrino.xml"/>
169 <target name="gc_gen" depends="vmcore,kernel">
170 <ant antfile="make/vm/gc_gen.xml"/>
174 <!-- ================================================================
175 import the deploy stuff from hdk / classlib
176 ================================================================-->
177 <target name="setup">
178 <mkdir dir="${drlvm.deploy.dir}/lib" />
179 <mkdir dir="${drlvm.deploy.dir}/jdk/jre" />
180 <mkdir dir="${drlvm.deploy.dir}/include" />
181 <copy todir="${drlvm.deploy.dir}">
182 <fileset dir="${hy.hdk}">
183 <include name="**" if="import.hdk"/>
184 <include name="jdk/jre/**" unless="import.hdk"/>
185 <exclude name="jdk/jre/bin/default/**" unless="import.hdk"/>
186 <exclude name="jdk/jre/bin/*hythr*" unless="import.hdk"/>
191 <!-- ================================================================
192 deploy the rest of product
193 ================================================================-->
194 <target name="deploy">
195 <copy todir="${drlvm.deploy.dir}/jdk/include">
196 <fileset dir="${vm.home}/include">
197 <include name="jni_types.h" />
198 <include name="jvmti_types.h" />
199 <include name="ncai_types.h" />
200 <include name="jni.h" />
201 <include name="jvmti.h" />
202 <include name="ncai.h" />
206 <!-- a trick to drop duplicated dependencies -->
208 <fileset dir="${drlvm.bin.dir}" includes="*" excludes="*hythr*">
210 <different targetdir="${drlvm.deploy.dir}/jdk/jre/bin"/>
215 <!-- launcher should use our hythr -->
216 <copy todir="${drlvm.deploy.dir}/jdk/jre/bin" overwrite="yes">
217 <fileset dir="${drlvm.bin.dir}">
218 <include name="*hythr*"/>
222 <copy file="${drlvm.base.dir}/make/resources/harmonyvm.properties"
223 todir="${drlvm.bin.dir}"/>
225 <copy file="${drlvm.base.dir}/make/resources/readme.txt"
226 tofile="${drlvm.deploy.dir}/jdk/jre/README"/>
227 <replace file="${drlvm.deploy.dir}/jdk/jre/README" >
228 <replacefilter token="@{hy.os}" value="${hy.os}"/>
229 <replacefilter token="@{hy.arch}" value="${hy.arch}"/>
231 <fixcrlf srcDir="${drlvm.deploy.dir}/jdk/jre" includes="README" />
233 <chmod file="${drlvm.deploy.dir}/jdk/jre/bin/java*" perm="ugo+x" />
237 <!-- ==================================================================
238 place things into canonical 'deploy' directory
239 so irrespective of the platform, compiler or release/debug
240 there's a predicable place to find the output
241 ================================================================== -->
242 <target name="deploy-canonical" if="deploy.canonical.flag">
243 <property name="canonical.deploy.dir" location="${drlvm.base.dir}/deploy" />
244 <delete dir="${canonical.deploy.dir}" failonerror="false" />
245 <mkdir dir="${canonical.deploy.dir}" />
246 <copy todir="${canonical.deploy.dir}">
247 <fileset dir="${drlvm.deploy.dir}"/>
249 <chmod file="${canonical.deploy.dir}/jdk/jre/bin/java*" perm="ugo+x" />
252 <!-- ==================================================================
253 relocate build for Windows
254 ================================================================== -->
255 <target name="deploy-relocate" if="is.windows">
256 <fileset dir="${drlvm.deploy.dir}/jdk/jre/bin/" id="relocate.files">
257 <include name="**/*.dll" />
258 <!-- Ignore ICUInterface34 stub from classlib -->
259 <exclude name="ICUInterface34.dll" />
262 <pathconvert pathsep=" " property="relocate.files.all" refid="relocate.files" />
264 <exec executable="editbin" outputproperty="null" logerror="yes" failonerror="true">
265 <arg value="/LARGEADDRESSAWARE" />
266 <arg value="/BIND" />
267 <arg value="${drlvm.deploy.dir}/jdk/jre/bin/java.exe" />
270 <exec executable="editbin" outputproperty="null" logerror="yes" failonerror="true">
271 <arg value="/LARGEADDRESSAWARE" />
272 <arg value="/BIND" />
273 <arg value="/rebase:base=0x500000" />
274 <arg line="${relocate.files.all}" />
278 <!-- Main target for generating javadoc & deploying guildes -->
280 <echo message="Not yet completed"/>
283 <!-- Main target for tests run: call unit.test and smoke.test -->
284 <target name="test" depends="drlvm-echo,
285 jvmti.test, cunit.test, smoke.test, kernel.test">
286 <fail if="test.failed" message="Some tests failed"/>
289 <target name="hut.test">
290 <property name="hut.module" value="*"/>
291 <property name="test.vmargs" value=""/>
292 <ant antfile="${external.dep.CLASSLIB}/build.xml" inheritAll="no">
293 <target name="properties"/>
294 <target name="test"/>
295 <property name="hy.test.vm.name" value="drl"/>
296 <property name="test.jre.home" value="${drlvm.deploy.dir}/jdk/jre"/>
297 <property name="short.report" value="true"/>
298 <property name="hy.test.vmargs" value="${test.vmargs}"/>
299 <property name="build.module" value="${hut.module}"/>
303 <target name="test2" depends="drlvm-echo">
304 <property file="test.properties"/>
305 <!--property name="run.all.tests" value="true"/-->
306 <property name="short.report" value="true"/>
307 <mkdir dir="${base.test.dir}"/>
308 <parallel threadsPerProcessor="1" failonany="no">
309 <ant target="hut.test" output="${base.test.dir}/hut.log"/>
310 <ant target="kernel.test" output="${base.test.dir}/kernel.log"/>
311 <ant target="ehwa.test" output="${base.test.dir}/ehwa.log"/>
312 <ant target="jvmti.test" output="${base.test.dir}/jvmti.log"/>
313 <ant target="smoke.test" output="${base.test.dir}/smoke.log"/>
314 <ant target="reg.test" output="${base.test.dir}/reg.log"/>
315 <ant target="cunit.test" output="${base.test.dir}/cunit.log"/>
317 <fail if="test.failed" message="Some tests failed"/>
320 <!-- Run cunit tests only -->
321 <target name="cunit.test">
322 <ant antfile="make/tests/cunit-test.xml" target="cunit-test"/>
323 <available property="test.failed" file="${base.test.dir}/cunit.test.failed" />
326 <!-- Main target to run smoke tests -->
327 <target name="smoke.test">
328 <ant antfile="make/tests/smoke-test.xml" target="smoke-test"/>
329 <available property="test.failed" file="${base.test.dir}/smoke.test.failed" />
332 <!-- Main target to run kernel tests -->
333 <target name="kernel.test">
334 <ant antfile="make/tests/kernel-test.xml" target="kernel-test"/>
335 <available property="test.failed" file="${base.test.dir}/kernel.test.failed" />
338 <!-- Main target to run Eclipse HelloWorld test scenario -->
339 <target name="ehwa.test">
340 <ant antfile="make/tests/ehwa-test.xml" target="ehwa"/>
341 <available property="test.failed" file="${base.test.dir}/ehwa.test.failed" />
344 <!-- Main target to run jvmti tests /-->
345 <target name="jvmti.test">
346 <ant antfile="make/tests/jvmti-test.xml" target="jvmti-test"/>
347 <available property="test.failed" file="${base.test.dir}/jvmti.test.failed" />
350 <!-- Main target to run regression test /-->
351 <target name="reg.test">
352 <ant antfile="make/tests/reg-test.xml" target="reg-test"/>
353 <available property="test.failed" file="${base.test.dir}/reg.test.failed" />
356 <target name="lazy.test">
357 <ant antfile="make/tests/lazy-test.xml" target="lazy-test"/>
358 <available property="test.failed" file="${base.test.dir}/lazy.test.failed" />