1 <?xml version="1.0" encoding="UTF-8"?>
4 Licensed to the Apache Software Foundation (ASF) under one or more
5 contributor license agreements. See the NOTICE file distributed with
6 this work for additional information regarding copyright ownership.
7 The ASF licenses this file to You under the Apache License, Version 2.0
8 (the "License"); you may not use this file except in compliance with
9 the License. You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
21 <project name="build-harmony" default="build" basedir=".">
23 <!-- name of the target directory to use for building and final assembly -->
24 <property name="target.dir" value="target" />
26 <!-- release property file which is added to source release -->
27 <property file="release.properties" />
29 <!-- debug or release version -->
30 <property name="hy.cfg" value="release" />
32 <property name="hy.local.zlib" value="false" />
35 Apache Harmony project federation script
40 Apache Harmony Ant Build
45 Compiles the java and native code to produce a jdk in
49 Removes all the files generated by a build.
52 Performs a full build - that is 'clean' then 'build'.
55 Produces a archive (tar/zip) of a build.
58 Fetches dependencies. Note: Some of Harmony's dependencies are
59 licensed under terms other than the Apache License v2.
62 Display the common build properties.
68 <!-- ============================================================== -->
69 <!-- main target - should checkout, build and package hdk,
71 <!-- ============================================================== -->
73 description="setup and build complete implementation"
82 <target name="snapshot"
83 description="setup and build complete src + binaries set"
92 description="build complete implementation"
96 build-commonresources,
100 <target name="bundle-src"
101 description="assemble source snapshot"
108 <!-- ============================================================== -->
109 <!-- populates the source directories, working_classlib,
110 working_vm, working_jdktools, and common_resources -->
111 <!-- ============================================================== -->
112 <target name="populate-src"
113 description="checkout the class library and VM source trees"
119 switch-svn-commonresources" />
121 <!-- ============================================================== -->
122 <!-- creates the HDK bundle appropriate for the platform -->
123 <!-- ============================================================== -->
124 <target name="bundle-hdk"
125 depends="assemble-artifacts,
130 <!-- ============================================================== -->
131 <!-- builds with a clean first -->
132 <!-- ============================================================== -->
133 <target name="rebuild" depends="clean, build"
134 description="Performs a full build - that is 'clean' then 'build'" />
136 <!-- ============================================================== -->
137 <!-- fetches external dependencies -->
138 <!-- ============================================================== -->
139 <target name="fetch-depends"
140 description="Fetches dependencies. Note: Some of Harmony dependencies are licensed under terms other than the Apache License v2."
141 depends="fetch-classlib-libs,
143 fetch-commonresources,
144 fetch-jdktools-libs"/>
146 <target name="bundle-hdk-tgz" depends="init" if="is.unix">
148 <!-- create the tar file and then md5 checksum using harmony-hdk-rev as the root,
149 and setting exec bits as needed -->
150 <tar tarfile="${target.dir}/${deploy.hdk.tar}" compression="gzip">
151 <tarfileset dir="${target.dir}/hdk"
152 prefix="${archive.dir.prefix}hdk-${harmony.version}"
154 <include name="jdk/jre/bin/java"/>
155 <include name="jdk/bin/*"/>
157 <tarfileset dir="${target.dir}/hdk"
158 prefix="${archive.dir.prefix}hdk-${harmony.version}">
160 <exclude name="jdk/jre/bin/java"/>
161 <exclude name="jdk/bin/*"/>
162 <exclude name="jdk/jre/README"/>
164 <tarfileset dir="${target.dir}/hdk/jdk/jre"
165 prefix="${archive.dir.prefix}hdk-${harmony.version}">
166 <include name="README"/>
170 <chksum dir="${target.dir}" file="${deploy.hdk.tar}" />
171 <chksum dir="${target.dir}" file="${deploy.hdk.tar}" type="sha" />
175 <target name="bundle-hdk-zip" depends="init" unless="is.unix">
176 <!-- create the tar file and then md5 checksum using harmony-hdk-rev as the root,
177 and setting exec bits as needed -->
178 <zip destfile="${target.dir}/${deploy.hdk.zip}" >
179 <zipfileset dir="${target.dir}/hdk"
180 prefix="${archive.dir.prefix}hdk-${harmony.version}"
182 <include name="jdk/jre/bin/java.exe"/>
183 <include name="jdk/jre/bin/javaw.exe"/>
184 <include name="jdk/bin/*"/>
186 <zipfileset dir="${target.dir}/hdk"
187 prefix="${archive.dir.prefix}hdk-${harmony.version}">
189 <exclude name="jdk/jre/bin/java.exe"/>
190 <exclude name="jdk/jre/bin/javaw.exe"/>
191 <exclude name="jdk/bin/*"/>
192 <exclude name="jdk/jre/README"/>
194 <zipfileset dir="${target.dir}/hdk/jdk/jre"
195 prefix="${archive.dir.prefix}hdk-${harmony.version}">
196 <include name="README"/>
200 <chksum dir="${target.dir}" file="${deploy.hdk.zip}" />
201 <chksum dir="${target.dir}" file="${deploy.hdk.zip}" type="sha" />
204 <!-- ============================================================== -->
205 <!-- creates the JDK bundle appropriate for the platform -->
206 <!-- ============================================================== -->
207 <target name="bundle-jdk"
208 depends="assemble-jdk-doc,
212 <target name="bundle-jdk-tgz" depends="init" if="is.unix">
214 <tar tarfile="${target.dir}/${deploy.jdk.tar}" compression="gzip" >
215 <tarfileset dir="${target.dir}/hdk/jdk"
216 prefix="${archive.dir.prefix}jdk-${harmony.version}"
218 <include name="jre/bin/java"/>
219 <include name="bin/*"/>
221 <tarfileset dir="${target.dir}/hdk/jdk"
222 prefix="${archive.dir.prefix}jdk-${harmony.version}">
224 <exclude name="jre/bin/java"/>
225 <exclude name="bin/*"/>
226 <exclude name="jre/README"/>
228 <tarfileset dir="${target.dir}/hdk/jdk/jre"
229 prefix="${archive.dir.prefix}jdk-${harmony.version}">
230 <include name="README"/>
234 <chksum dir="${target.dir}" file="${deploy.jdk.tar}" />
235 <chksum dir="${target.dir}" file="${deploy.jdk.tar}" type="sha" />
239 <target name="bundle-jdk-zip" depends="init" unless="is.unix">
240 <zip destfile="${target.dir}/${deploy.jdk.zip}">
241 <zipfileset dir="${target.dir}/hdk/jdk"
242 prefix="${archive.dir.prefix}jdk-${harmony.version}"
244 <include name="jre/bin/java.exe"/>
245 <include name="jre/bin/javaw.exe"/>
246 <include name="bin/*"/>
248 <zipfileset dir="${target.dir}/hdk/jdk"
249 prefix="${archive.dir.prefix}jdk-${harmony.version}">
251 <exclude name="jre/bin/java.exe"/>
252 <exclude name="jre/bin/javaw.exe"/>
253 <exclude name="bin/*"/>
254 <exclude name="jre/README"/>
256 <zipfileset dir="${target.dir}/hdk/jdk/jre"
257 prefix="${archive.dir.prefix}jdk-${harmony.version}">
258 <include name="README"/>
261 <chksum dir="${target.dir}" file="${deploy.jdk.zip}" />
262 <chksum dir="${target.dir}" file="${deploy.jdk.zip}" type="sha" />
265 <!-- ============================================================== -->
266 <!-- creates the JRE bundle appropriate for the platform -->
267 <!-- ============================================================== -->
268 <target name="bundle-jre"
269 depends="assemble-jre-doc,
274 <target name="bundle-jre-tgz" depends="init" if="is.unix">
276 <tar tarfile="${target.dir}/${deploy.jre.tar}" compression="gzip" >
277 <tarfileset dir="${target.dir}/hdk/jdk/jre"
278 prefix="${archive.dir.prefix}jre-${harmony.version}"
280 <include name="bin/java"/>
282 <tarfileset dir="${target.dir}/hdk/jdk/jre"
283 prefix="${archive.dir.prefix}jre-${harmony.version}">
285 <exclude name="bin/java"/>
289 <chksum dir="${target.dir}" file="${deploy.jre.tar}" />
290 <chksum dir="${target.dir}" file="${deploy.jre.tar}" type="sha" />
294 <target name="bundle-jre-zip" depends="init" unless="is.unix">
295 <zip destfile="${target.dir}/${deploy.jre.zip}">
296 <zipfileset dir="${target.dir}/hdk/jdk/jre"
297 prefix="${archive.dir.prefix}jre-${harmony.version}"
299 <include name="bin/java.exe"/>
300 <include name="bin/javaw.exe"/>
302 <zipfileset dir="${target.dir}/hdk/jdk/jre"
303 prefix="${archive.dir.prefix}jre-${harmony.version}">
305 <exclude name="bin/java.exe"/>
306 <exclude name="bin/javaw.exe"/>
309 <chksum dir="${target.dir}" file="${deploy.jre.zip}" />
310 <chksum dir="${target.dir}" file="${deploy.jre.zip}" type="sha" />
314 <!-- ============================================================== -->
315 <!-- from the classlib and vm builds, creates the hdk and jre -->
316 <!-- ============================================================== -->
317 <target name="assemble-artifacts"
322 <target name="assemble-stuff">
323 <!-- create the top-level hdk directory -->
324 <mkdir dir="${target.dir}/hdk"/>
326 <!-- copy the classlib/deploy tree as the hdk
327 filtering out the jre, as that comes from
329 <!-- TODO: classlib files should come from classlib. So we
330 should filter out classlib files when copying out of
331 working_vm and *not* when copying out of
332 working_classlib. And if necessary add specific excludes
333 so we know exactly why it is not done in the obvious
335 <copy todir="${target.dir}/hdk">
336 <fileset dir="working_classlib/deploy">
337 <exclude name="**/jre/**/*" />
338 <exclude name="**/jdk/include/*" />
342 <!-- now copy the drlvm/build/deploy -->
343 <!-- set overwrite flag to take hythr from VM -->
344 <copy todir="${target.dir}/hdk" overwrite="true">
345 <fileset dir="working_vm/deploy">
346 <!-- TODO: where should these .pdb files go? -->
347 <exclude name="**/*.pdb" unless="copy.progdb" />
351 <!-- now copy the working_jdktools/deploy/jdk -->
352 <copy todir="${target.dir}/hdk/jdk/">
353 <fileset dir="working_jdktools/deploy/jdk" />
357 <target name="chmod-stuff" if="is.unix">
358 <chmod file="${target.dir}/hdk/jdk/bin/*" perm="ugo+x" />
359 <chmod file="${target.dir}/hdk/jdk/jre/bin/java*" perm="ugo+x" />
360 <chmod file="${target.dir}/hdk/jdk/jre/bin/keytool*" perm="ugo+x" />
361 <chmod file="${target.dir}/hdk/jdk/jre/bin/policytool*" perm="ugo+x" />
362 <chmod file="${target.dir}/hdk/jdk/jre/bin/unpack200*" perm="ugo+x" />
363 <chmod file="${target.dir}/hdk/jdk/jre/bin/pack200*" perm="ugo+x" />
366 <target name="assemble-jdk">
368 <!-- create the top-level jdk directory -->
369 <mkdir dir="${target.dir}/jdk"/>
371 <!-- now copy the drlvm/build/deploy/jre
372 contents into the jre in the JDK -->
373 <copy todir="${target.dir}/jdk/jre">
374 <fileset dir="working_vm/build/deploy/jdk/jre">
375 <exclude name="**/*.pdb" unless="copy.progdb" />
379 <!-- now copy the drlvm/build/deploy/jre
380 contents into the jre in the JDK -->
381 <copy todir="${target.dir}/jdk/">
382 <fileset dir="working_jdktools/deploy/jdk">
383 <exclude name="**/*.pdb" unless="copy.progdb" />
389 <!-- ============================================================== -->
390 <!-- copies a license and notices into the root of the hdk -->
391 <!-- ============================================================== -->
392 <target name="assemble-hdk-doc">
394 <copy todir="${target.dir}/hdk" overwrite="true">
396 <include name="LICENSE" />
397 <include name="NOTICE" />
403 <!-- ============================================================== -->
404 <!-- copies a license and notices into the root of the JDK and JRE -->
405 <!-- ============================================================== -->
406 <target name="assemble-jre-doc">
408 <copy todir="${target.dir}/hdk/jdk/jre" overwrite="true">
410 <include name="LICENSE" />
411 <include name="NOTICE" />
416 <target name="assemble-jdk-doc">
417 <copy todir="${target.dir}/hdk/jdk/" overwrite="true">
419 <include name="LICENSE" />
420 <include name="NOTICE" />
425 <!-- ============================================================== -->
426 <!-- ensures dependencies are up to date, then builds classlib -->
427 <!-- ============================================================== -->
429 <propertyset id="required.props">
430 <propertyref name="hy.cfg" />
431 <propertyref name="hy.local.zlib" />
432 <propertyref name="use.libstdc++5" />
433 <propertyref name="harmony.java.version" />
436 <target name="build-classlib" depends="auto-fetch-classlib-libs">
437 <ant antfile="working_classlib/build.xml" target="build" inheritAll="false" >
438 <propertyset refid="required.props" />
439 <property name="svn.info" value="${harmony.long.version}"/>
440 <property name="svn.revision" value="${harmony.version}"/>
441 <property name="keep.working" value="true" />
443 <!-- hack to make sure the vm doesn't use the classlib
444 LICENSE/NOTICE files as they don't cover ICU4C
446 <copy todir="working_classlib/deploy" overwrite="true">
448 <include name="LICENSE" />
449 <include name="NOTICE" />
454 <target name="auto-fetch-classlib-libs" if="auto.fetch">
455 <ant target="fetch-classlib-libs">
456 <propertyset refid="required.props" />
457 <property name="svn.info" value="${harmony.long.version}"/>
458 <property name="svn.revision" value="${harmony.version}"/>
462 <target name="fetch-classlib-libs">
463 <ant antfile="working_classlib/build.xml" target="fetch-depends" inheritall="false" >
464 <propertyset refid="required.props" />
465 <property name="svn.info" value="${harmony.long.version}"/>
466 <property name="svn.revision" value="${harmony.version}"/>
470 <target name="clean-classlib">
471 <ant antfile="working_classlib/build.xml" target="clean" inheritAll="false" >
472 <propertyset refid="required.props" />
473 <property name="svn.info" value="${harmony.long.version}"/>
474 <property name="svn.revision" value="${harmony.version}"/>
475 <property name="keep.working" value="true" />
479 <target name="init-classlib-hdk">
480 <ant antfile="working_classlib/build.xml"
481 target="-init-hdk" inheritAll="false" >
482 <property name="hy.cfg" value="${hy.cfg}"/>
483 <property name="svn.info" value="${harmony.long.version}"/>
484 <property name="svn.revision" value="${harmony.version}"/>
485 <property name="keep.working" value="true" />
489 <!-- ============================================================== -->
490 <!-- ensures that dependencies are up to date and then builds a vm -->
491 <!-- ============================================================== -->
492 <target name="build-vm" depends="auto-fetch-vm-libs">
493 <ant antfile="working_vm/build.xml" target="build" inheritAll="false" >
494 <propertyset refid="required.props" />
495 <property name="svn.info" value="${harmony.long.version}"/>
496 <property name="svn.revision" value="${harmony.version}"/>
497 <property name="deploy.canonical.flag" value="true"/>
501 <target name="auto-fetch-vm-libs" if="auto.fetch">
502 <ant target="fetch-vm-libs">
503 <propertyset refid="required.props" />
504 <property name="svn.info" value="${harmony.long.version}"/>
505 <property name="svn.revision" value="${harmony.version}"/>
509 <target name="fetch-vm-libs">
510 <ant antfile="working_vm/build.xml" target="fetch-depends" inheritall="false" >
511 <propertyset refid="required.props" />
512 <property name="svn.info" value="${harmony.long.version}"/>
513 <property name="svn.revision" value="${harmony.version}"/>
517 <target name="clean-vm">
518 <ant antfile="working_vm/build.xml" target="clean" inheritall="false" >
519 <propertyset refid="required.props" />
520 <property name="svn.info" value="${harmony.long.version}"/>
521 <property name="svn.revision" value="${harmony.version}"/>
522 <property name="deploy.canonical.flag" value="true"/>
526 <!-- ============================================================== -->
527 <!-- fetches the common resources -->
528 <!-- ============================================================== -->
529 <target name="build-commonresources" depends="auto-fetch-commonresources"/>
531 <target name="auto-fetch-commonresources" if="auto.fetch">
532 <ant target="fetch-commonresources">
533 <propertyset refid="required.props" />
534 <property name="svn.info" value="${harmony.long.version}"/>
535 <property name="svn.revision" value="${harmony.version}"/>
539 <target name="fetch-commonresources">
540 <ant antfile="common_resources/build.xml" target="fetch-depends" inheritall="false" >
541 <property name="hy.cfg" value="${hy.cfg}"/>
542 <property name="svn.info" value="${harmony.long.version}"/>
543 <property name="svn.revision" value="${harmony.version}"/>
547 <!-- ============================================================== -->
548 <!-- ensures dependencies are up to date, then builds jdktools -->
549 <!-- ============================================================== -->
550 <target name="build-jdktools" depends="auto-fetch-jdktools-libs">
551 <ant antfile="working_jdktools/build.xml" target="build" inheritall="false" >
552 <property name="hy.cfg" value="${hy.cfg}"/>
553 <property name="svn.info" value="${harmony.long.version}"/>
554 <property name="svn.revision" value="${harmony.version}"/>
558 <target name="auto-fetch-jdktools-libs" if="auto.fetch">
559 <ant target="fetch-jdktools-libs" inheritall="false" >
560 <property name="hy.cfg" value="${hy.cfg}"/>
564 <target name="fetch-jdktools-libs">
565 <ant antfile="working_jdktools/build.xml" target="fetch-depends" inheritall="false" >
566 <property name="hy.cfg" value="${hy.cfg}"/>
570 <target name="clean-jdktools">
571 <ant antfile="working_jdktools/build.xml" target="clean" inheritall="false" >
572 <property name="hy.cfg" value="${hy.cfg}"/>
573 <property name="svn.info" value="${harmony.long.version}"/>
574 <property name="svn.revision" value="${harmony.version}"/>
578 <!-- ============================================================== -->
579 <!-- recreates distribution dir -->
580 <!-- ============================================================== -->
581 <target name="setup" depends="init, properties">
582 <delete dir="${target.dir}"/>
583 <mkdir dir="${target.dir}"/>
587 <!-- ============================================================== -->
588 <!-- hard reset - removes checked out classlib and vm tree -->
589 <!-- ============================================================== -->
591 description="removes vm and classlib dirs and resets - BE SURE YOU WANT TO DO THIS"
594 <!-- delete the working directories and then do an svn update to reset them -->
595 <delete dir="working_classlib"/>
596 <delete dir="working_vm"/>
598 <exec executable="svn" dir="." failonerror="true">
599 <arg line="update" />
605 depends="init-classlib-hdk,
610 <delete dir="${target.dir}" failonerror="false" />
613 <!-- ============================================================== -->
614 <!-- switches the working_vm directory to vm module (DRLVM for now) -->
615 <!-- ============================================================== -->
616 <target name="switch-svn-vm" depends="init" if="is.svn">
617 <exec executable="svn" dir="working_vm" failonerror="true">
618 <arg line="-r${svn.revision}"/>
619 <arg line="switch" />
620 <arg line="${vm.svn.url}" />
624 <!-- ============================================================== -->
625 <!-- switches the working_classlib directory to classlib -->
626 <!-- ============================================================== -->
627 <target name="switch-svn-classlib" depends="init" if="is.svn">
628 <exec executable="svn" dir="working_classlib" failonerror="true">
629 <arg line="-r${svn.revision}"/>
630 <arg line="switch" />
631 <arg line="${classlib.svn.url}" />
635 <!-- ============================================================== -->
636 <!-- switches the working_jdktools directory to jdktools -->
637 <!-- ============================================================== -->
638 <target name="switch-svn-jdktools" depends="init" if="is.svn">
639 <exec executable="svn" dir="working_jdktools" failonerror="true">
640 <arg line="-r${svn.revision}"/>
641 <arg line="switch" />
642 <arg line="${jdktools.svn.url}" />
646 <!-- ============================================================== -->
647 <!-- switches the common_resources directory to common_resources -->
648 <!-- ============================================================== -->
649 <target name="switch-svn-commonresources" depends="init" if="is.svn">
650 <exec executable="svn" dir="common_resources" failonerror="true">
651 <arg line="-r${svn.revision}"/>
652 <arg line="switch" />
653 <arg line="${commonresources.svn.url}" />
657 <!-- ============================================================== -->
658 <!-- sets up a platform -->
659 <!-- ============================================================== -->
660 <target name="init" depends="svn-prop">
661 <!-- Determine our operating system -->
662 <condition property="is.windows">
663 <os family="windows" />
666 <condition property="is.unix">
670 <condition property="is.linux">
674 <!-- this special case makes sense -->
675 <condition property="harmony.os" value="windows">
676 <isset property="is.windows"/>
678 <condition property="harmony.os" value="linux">
682 <property name="harmony.os" value="${os.name}" />
684 <!-- Conditions for different architectures -->
685 <condition property="is.x86_64">
688 <condition property="is.x86">
694 <condition property="is.ia64">
697 <condition property="is.64bit">
703 <condition property="is.32bit">
709 <condition property="harmony.bits" value="32">
710 <isset property="is.32bit" />
712 <property name="harmony.bits" value="64" />
714 <!-- Normalized architecture name -->
715 <condition property="harmony.arch" value="x86">
716 <isset property="is.x86" />
718 <condition property="harmony.arch" value="x86_64">
725 <property name="harmony.arch" value="${os.arch}" />
727 <property name="harmony.deploy.suffix" value="-snapshot" />
729 <condition property="harmony.java.version" value="6.0" else="5.0">
730 <isset property="java6" />
733 <property name="deploy.file.prefix"
734 value="apache-harmony-${harmony.java.version}-" />
736 <property name="archive.dir.prefix"
737 value="harmony-${harmony.java.version}-" />
739 <property name="deploy.hdk.file.prefix"
740 value="${deploy.file.prefix}hdk-r${harmony.version}" />
741 <property name="deploy.hdk.tar"
742 value="${deploy.hdk.file.prefix}-${harmony.os}-${harmony.arch}-${harmony.bits}${harmony.deploy.suffix}.tar.gz" />
743 <property name="deploy.hdk.zip"
744 value="${deploy.hdk.file.prefix}-${harmony.os}-${harmony.arch}-${harmony.bits}${harmony.deploy.suffix}.zip" />
746 <property name="deploy.jdk.file.prefix"
747 value="${deploy.file.prefix}jdk-r${harmony.version}" />
748 <property name="deploy.jdk.tar"
749 value="${deploy.jdk.file.prefix}-${harmony.os}-${harmony.arch}-${harmony.bits}${harmony.deploy.suffix}.tar.gz" />
750 <property name="deploy.jdk.zip"
751 value="${deploy.jdk.file.prefix}-${harmony.os}-${harmony.arch}-${harmony.bits}${harmony.deploy.suffix}.zip" />
753 <property name="deploy.jre.file.prefix"
754 value="${deploy.file.prefix}jre-r${harmony.version}" />
755 <property name="deploy.jre.tar"
756 value="${deploy.jre.file.prefix}-${harmony.os}-${harmony.arch}-${harmony.bits}${harmony.deploy.suffix}.tar.gz" />
757 <property name="deploy.jre.zip"
758 value="${deploy.jre.file.prefix}-${harmony.os}-${harmony.arch}-${harmony.bits}${harmony.deploy.suffix}.zip" />
760 <property name="deploy.src.file.prefix"
761 value="${deploy.file.prefix}src-r${harmony.version}" />
762 <property name="deploy.src.tar"
763 value="${deploy.src.file.prefix}${harmony.deploy.suffix}.tar.gz" />
764 <property name="deploy.src.zip"
765 value="${deploy.src.file.prefix}${harmony.deploy.suffix}.zip" />
767 <!-- copy symbol debug info to debug build on Windows -->
768 <condition property="copy.progdb">
769 <equals arg1="${hy.cfg}" arg2="debug" />
772 <!-- workaround for drlvm build till it starts with a script-->
773 <condition property="custom.props" value="-Dhy.javac.compiler=${hy.javac.compiler}"
775 <isset property="hy.javac.compiler"/>
780 <target name="properties" depends="init">
782 Apache Harmony Federated Build
783 ==========================================
784 svn rev : ${harmony.version}
785 operating system : ${harmony.os}
786 CPU architecture : ${harmony.arch}
787 word length : ${harmony.bits}
788 ant os name/arch : ${os.name}/${os.arch}
789 hosting Java : ${java.version} (${java.vendor})
790 build mode : ${hy.cfg}
791 output location : ${target.dir}
792 SVN root : ${svn.root}
796 <!-- ============================================================== -->
797 <!-- svn-prop: gets svn revision number of the build.xml file -->
798 <!-- ============================================================== -->
799 <target name="svn-prop">
801 <tempfile suffix=".xml" property="svn.tmp"/>
802 <exec executable="svn" output="${svn.tmp}" resultproperty="svn.rc">
803 <arg line="info ${basedir} --non-interactive --xml" />
805 <condition property="svn.info.file" value="${svn.tmp}">
806 <equals arg1="0" arg2="${svn.rc}"/>
808 <xmlproperty file="${svn.info.file}" prefix="federated"
809 keeproot="no" collapseAttributes="yes"/>
810 <delete file="${svn.tmp}" quiet="true"/>
812 <condition property="is.svn">
813 <isset property="federated.entry.revision"/>
815 <condition property="svn.revision" value="${federated.entry.revision}" else="unknown">
816 <isset property="is.svn"/>
818 <condition property="svn.root"
819 value="${federated.entry.repository.root}"
820 else="http://svn.apache.org/repos/asf">
821 <isset property="is.svn"/>
824 <condition property="svn.info" value="${svn.root} ${svn.revision}">
825 <isset property="is.svn"/>
828 <format property="svn.info" pattern="'Unknown revision at' dd-MMM-yyyy hh:mm aa"/>
831 <property name="harmony.version" value="${svn.revision}" />
832 <property name="harmony.long.version" value="${svn.info}" />
834 <!-- default SVN URLs -->
835 <condition property="classlib.svn.url"
836 value="${svn.root}/harmony/enhanced/classlib/branches/java6"
837 else="${svn.root}/harmony/enhanced/classlib/trunk">
838 <isset property="java6" />
841 <property name="vm.svn.url" value="${svn.root}/harmony/enhanced/drlvm/trunk" />
843 <condition property="jdktools.svn.url"
844 value="${svn.root}/harmony/enhanced/jdktools/branches/java6"
845 else="${svn.root}/harmony/enhanced/jdktools/trunk">
846 <isset property="java6" />
849 <property name="commonresources.svn.url" value="${svn.root}/harmony/enhanced/common_resources/trunk" />
852 <target name="bundle-src-tgz" depends="init" if="is.unix">
854 <tar tarfile="${target.dir}/${deploy.src.tar}" compression="gzip"
856 <tarfileset dir="${target.dir}/src" prefix="${deploy.file.prefix}src-r${harmony.version}" mode="755">
857 <include name="debian/rules"/>
859 <tarfileset dir="${target.dir}/src" prefix="${deploy.file.prefix}src-r${harmony.version}">
861 <exclude name="debian/rules"/>
865 <chksum dir="${target.dir}" file="${deploy.src.tar}" />
866 <chksum dir="${target.dir}" file="${deploy.src.tar}" type="sha" />
870 <target name="bundle-src-zip" depends="init" unless="is.unix">
871 <zip destfile="${target.dir}/${deploy.src.zip}">
872 <zipfileset dir="${target.dir}/src"
873 prefix="${deploy.file.prefix}src-r${harmony.version}"
875 <include name="debian/rules"/>
877 <zipfileset dir="${target.dir}/src"
878 prefix="${deploy.file.prefix}src-r${harmony.version}">
880 <exclude name="debian/rules"/>
883 <chksum dir="${target.dir}" file="${deploy.src.zip}" />
884 <chksum dir="${target.dir}" file="${deploy.src.zip}" type="sha" />
887 <target name="copy-src" depends="init,populate-src">
888 <exec executable="svn">
889 <arg value="export" />
891 <arg value="${target.dir}/src" />
893 <echo file="${target.dir}/src/release.properties">
894 harmony.version=${harmony.version}
895 harmony.long.version=${harmony.long.version}
896 harmony.deploy.suffix=${harmony.deploy.suffix}
897 harmony.java.version=${harmony.java.version}
899 <chmod file="${target.dir}/src/debian/rules" perm="ugo+x" />
903 depends="test-classlib,test-jdktools,process-test-output" />
905 <target name="clean-tests">
906 <delete dir="build/test_report" />
909 <target name="test-classlib" depends="clean-tests">
910 <ant antfile="working_classlib/make/build-test.xml"
911 target="test-modules" inheritAll="false" >
912 <propertyset refid="required.props" />
913 <property name="svn.info" value="${harmony.long.version}"/>
914 <property name="svn.revision" value="${harmony.version}"/>
915 <property name="keep.working" value="true" />
916 <property name="tests.output" location="build/test_report" />
917 <property name="test.jre.home" location="target/hdk/jdk/jre" />
921 <target name="test-jdktools" depends="clean-tests">
922 <ant antfile="working_jdktools/make/build-test.xml"
923 target="test-modules" inheritAll="false" >
924 <propertyset refid="required.props" />
925 <property name="svn.info" value="${harmony.long.version}"/>
926 <property name="svn.revision" value="${harmony.version}"/>
927 <property name="keep.working" value="true" />
928 <property name="tests.output" location="build/test_report" />
929 <property name="test.jre.home" location="target/hdk/jdk/jre" />
933 <target name="process-test-output">
934 <ant antfile="working_classlib/make/build-test.xml"
935 target="process-test-output" inheritAll="false" >
936 <propertyset refid="required.props" />
937 <property name="svn.info" value="${harmony.long.version}"/>
938 <property name="svn.revision" value="${harmony.version}"/>
939 <property name="keep.working" value="true" />
940 <property name="tests.output" location="build/test_report" />
941 <property name="test.jre.home" location="target/hdk/jdk/jre" />
945 <!-- ============================================================== -->
946 <!-- produces a nice looking checksum -->
947 <!-- ============================================================== -->
948 <macrodef name="chksum">
949 <attribute name="dir" />
950 <attribute name="file" />
951 <attribute name="type" default="md5" />
953 <checksum property="@{file}.@{type}"
954 file="@{dir}/@{file}"
955 algorithm="@{type}" />
956 <echo file="@{dir}/@{file}.@{type}"
957 message="${@{file}.@{type}} @{file}${line.separator}" />