[r815644] Change hythread API to use 'const char*' for constant strings rather than
[drlvm.git] / build.xml
blobf623f2fb18ba9243d23adcbf5f92a29fa9c1151d
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!--
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
9   
10        http://www.apache.org/licenses/LICENSE-2.0
11   
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.
17 -->
19 <project name="drlvm" default="build">
20     <description>
21         Build contributed source and lay out results in the required format 
22     </description>
23     
24     <import file="make/properties.xml"/>
26     <target name="help">
27         <echo>
28 Apache Harmony DRLVM Build
30 Usage:
32   ant build
33     Compiles the java and native code to produce a jre in
34     "deploy/jdk/jre".
35     It is possible to build an individual component via 
36     corresponding targets.
38   ant clean
39     Removes all the files generated by a build.
41   ant rebuild
42     Performs a full build - that is 'clean' then 'build'.
44   ant test
45     Runs smoke and unit tests.
46             
47   ant test2
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
59             
60   ant doc
61     Generates the javadoc (TBD).
63   ant fetch-depends
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.
70         </echo>
71     </target>
73     <target name="fetch-depends">
74         <ant antfile="make/depends.xml" target="fetch"/>
75     </target>
76     
77     <target name="check-depends">
78         <ant antfile="make/depends.xml" target="check"/>
79     </target>
81     <target name="rebuild" depends="clean,build"
82         description="Performs a full build - that is 'clean' then 'build'" />
84     <target name="build" 
85         depends="drlvm-echo, -auto-fetch,
86         setup,
87         interpreter,
88         kernel,
89         em,
90         vmi,
91         jitrino,
92         gc_gen,
93         deploy,
94         deploy-relocate,
95         deploy-canonical"
96         description="Compiles the java and native code to produce a jdk">
97     </target>
98     
99     <target name="-auto-fetch" if="auto.fetch">
100         <antcall target="fetch-depends"/>
101     </target>
103     <target name="clean" depends="" 
104             description="Removes all the files generated by a build">
105         <delete quiet="true" dir="${drlvm.build.dir}"/>
106     </target>
107     
108     <!-- ================================================================
109             build individual components
110          ================================================================-->
112     <target name="build-extra" depends=""
113         description="Compiles external dependencies">
114         <ant antfile="make/extra/apr.xml"/>
115     </target>
117     <target name="encoder">
118         <ant antfile="make/vm/encoder.xml"/>
119     </target>
121     <target name="port" depends="build-extra">
122         <ant antfile="make/vm/port.xml"/>
123     </target>
125     <target name="port_ch" depends="port">
126         <ant antfile="make/vm/port_ch.xml"/>
127     </target>
129     <target name="hythr" depends="port">
130         <ant antfile="make/vm/hythr.xml"/>
131     </target>
133     <target name="verifier">
134         <ant antfile="make/vm/verifier.xml"/>
135     </target>
137     <target name="verifier-ext" description="Build a verifier extentions library">
138         <ant antfile="make/vm/verifier-ext.xml"/>
139     </target>
141     <target name="clean-verifier-ext" description="Clean a verifier extentions library">
142         <ant antfile="make/vm/verifier-ext.xml" target="clean"/>
143     </target>
145     <target name="vmcore" depends="encoder, port, port_ch, hythr, verifier">
146         <ant antfile="make/vm/vmcore.xml"/>
147     </target>
149     <target name="em" depends="vmcore">
150         <ant antfile="make/vm/em.xml"/>
151     </target>
153     <target name="interpreter" depends="vmcore">
154         <ant antfile="make/vm/interpreter.xml"/>
155     </target>
157     <target name="kernel">
158         <ant antfile="make/vm/kernel.xml"/>
159     </target>
161     <target name="vmi" depends="vmcore">
162         <ant antfile="make/vm/vmi.xml"/>
163     </target>
165     <target name="jitrino" depends="vmcore">
166         <ant antfile="make/vm/jitrino.xml"/>
167     </target>
169     <target name="gc_gen" depends="vmcore,kernel">
170         <ant antfile="make/vm/gc_gen.xml"/>
171     </target>
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"/>
187             </fileset>
188         </copy>
189     </target>
190         
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" />
203             </fileset>
204         </copy>
206         <!-- a trick to drop duplicated dependencies -->
207         <delete quiet="yes">
208             <fileset dir="${drlvm.bin.dir}" includes="*" excludes="*hythr*">
209                 <not>
210                     <different targetdir="${drlvm.deploy.dir}/jdk/jre/bin"/>
211                 </not>
212             </fileset>
213         </delete>
214         
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*"/>
219             </fileset>
220         </copy>
221         
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}"/>
230         </replace>
231         <fixcrlf srcDir="${drlvm.deploy.dir}/jdk/jre" includes="README" />
232         
233         <chmod file="${drlvm.deploy.dir}/jdk/jre/bin/java*" perm="ugo+x" />
234     </target>
235     
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}"/>
248         </copy>
249         <chmod file="${canonical.deploy.dir}/jdk/jre/bin/java*" perm="ugo+x" />
250     </target>
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" />
260         </fileset>
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" />
268         </exec>
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}" />
275         </exec>
276     </target>
277         
278     <!-- Main target for generating javadoc & deploying guildes -->
279     <target name="doc">
280         <echo message="Not yet completed"/>
281     </target>
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"/>
287     </target>
288     
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}"/>
300         </ant>
301     </target>
302     
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"/>
316         </parallel>
317         <fail if="test.failed" message="Some tests failed"/>
318     </target>
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" />
324     </target>
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" />
330     </target>
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" />
336     </target>
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" />
342     </target>
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" />
348     </target>
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" />
354     </target>
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" />
359     </target>
361 </project>