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="default" basedir=".">
23 <!-- name of the target directory to use for building and final assembly -->
24 <property name="target.dir" value="target" />
26 <!-- classlib location to tell DRLVM build -->
27 <property name="drlvm.classlib.offset" value="../../../working_classlib"/>
29 <!-- release property file which is added to source release -->
30 <property file="release.properties" />
32 <!-- debug or release version -->
33 <property name="hy.cfg" value="release" />
35 <property name="hy.no.sig" value="false" />
38 Apache Harmony subproject federation script
41 <!-- ================================================================================ -->
42 <!-- main target - should checkout, build and package hdk, jdk and jre -->
43 <!-- ================================================================================ -->
44 <target name="default"
45 description="setup and build complete implementation"
54 <target name="make-snapshot"
55 description="setup and build complete src + binaries set"
63 <target name="build-all"
64 description="build complete implementation"
68 build_commonresources,
71 <target name="bundle_src"
72 description="assemble source snapshot"
73 depends="setup,copy_source,bundle_src_tgz,bundle_src_zip" />
75 <!-- =============================================================================== -->
76 <!-- populates the source directories, working_classlib and working_vm -->
77 <!-- =============================================================================== -->
78 <target name="populate_source" depends="init, show_props, switch_svn_vm, switch_svn_classlib,
79 switch_svn_jdktools, switch_svn_commonresources"
80 description="checkout the class library and VM source trees"/>
82 <!-- ================================================================================ -->
83 <!-- creates the HDK bundle appropriate for the platform -->
84 <!-- ================================================================================ -->
85 <target name="bundle_hdk" depends="assemble_artifacts, assemble_hdk_doc,bundle_hdk_tgz,bundle_hdk_zip"/>
87 <target name="bundle_hdk_tgz" depends="init" if="is.unix">
89 <!-- create the tar file and then md5 checksum using harmony-hdk-rev as the root,
90 and setting exec bits as needed -->
91 <tar tarfile="${target.dir}/${deploy.hdk.tar}" compression="gzip">
92 <tarfileset dir="${target.dir}/hdk" prefix="harmony-hdk-${harmony.version}" mode="755">
93 <include name="jdk/jre/bin/java"/>
94 <include name="jdk/bin/*"/>
96 <tarfileset dir="${target.dir}/hdk" prefix="harmony-hdk-${harmony.version}">
98 <exclude name="jdk/jre/bin/java"/>
99 <exclude name="jdk/bin/*"/>
103 <chksum dir="${target.dir}" file="${deploy.hdk.tar}" />
104 <chksum dir="${target.dir}" file="${deploy.hdk.tar}" type="sha" />
108 <target name="bundle_hdk_zip" depends="init" unless="is.unix">
109 <!-- create the tar file and then md5 checksum using harmony-hdk-rev as the root,
110 and setting exec bits as needed -->
111 <zip destfile="${target.dir}/${deploy.hdk.zip}" >
112 <zipfileset dir="${target.dir}/hdk" prefix="harmony-hdk-${harmony.version}" filemode="755">
113 <include name="jdk/jre/bin/java.exe"/>
114 <include name="jdk/jre/bin/javaw.exe"/>
115 <include name="jdk/bin/*"/>
117 <zipfileset dir="${target.dir}/hdk" prefix="harmony-hdk-${harmony.version}">
119 <exclude name="jdk/jre/bin/java.exe"/>
120 <exclude name="jdk/jre/bin/javaw.exe"/>
121 <exclude name="jdk/bin/*"/>
125 <chksum dir="${target.dir}" file="${deploy.hdk.zip}" />
126 <chksum dir="${target.dir}" file="${deploy.hdk.zip}" type="sha" />
129 <!-- ================================================================================ -->
130 <!-- creates the JDK bundle appropriate for the platform -->
131 <!-- ================================================================================ -->
132 <target name="bundle_jdk" depends="assemble_jdk_doc,bundle_jdk_tgz,bundle_jdk_zip"/>
134 <target name="bundle_jdk_tgz" depends="init" if="is.unix">
136 <tar tarfile="${target.dir}/${deploy.jdk.tar}" compression="gzip" >
137 <tarfileset dir="${target.dir}/hdk/jdk" prefix="harmony-jdk-${harmony.version}" mode="755">
138 <include name="jre/bin/java"/>
139 <include name="bin/*"/>
141 <tarfileset dir="${target.dir}/hdk/jdk" prefix="harmony-jdk-${harmony.version}">
143 <exclude name="jre/bin/java"/>
144 <exclude name="bin/*"/>
148 <chksum dir="${target.dir}" file="${deploy.jdk.tar}" />
149 <chksum dir="${target.dir}" file="${deploy.jdk.tar}" type="sha" />
153 <target name="bundle_jdk_zip" depends="init" unless="is.unix">
154 <zip destfile="${target.dir}/${deploy.jdk.zip}">
155 <zipfileset dir="${target.dir}/hdk/jdk" prefix="harmony-jdk-${harmony.version}" filemode="755">
156 <include name="jre/bin/java.exe"/>
157 <include name="jre/bin/javaw.exe"/>
158 <include name="bin/*"/>
160 <zipfileset dir="${target.dir}/hdk/jdk" prefix="harmony-jdk-${harmony.version}">
162 <exclude name="jre/bin/java.exe"/>
163 <exclude name="jre/bin/javaw.exe"/>
164 <exclude name="bin/*"/>
167 <chksum dir="${target.dir}" file="${deploy.jdk.zip}" />
168 <chksum dir="${target.dir}" file="${deploy.jdk.zip}" type="sha" />
171 <!-- ================================================================================ -->
172 <!-- creates the JRE bundle appropriate for the platform -->
173 <!-- ================================================================================ -->
174 <target name="bundle_jre" depends="assemble_jre_doc,bundle_jre_tgz,bundle_jre_zip"/>
177 <target name="bundle_jre_tgz" depends="init" if="is.unix">
179 <tar tarfile="${target.dir}/${deploy.jre.tar}" compression="gzip" >
180 <tarfileset dir="${target.dir}/hdk/jdk/jre" prefix="harmony-jre-${harmony.version}" mode="755">
181 <include name="bin/java"/>
183 <tarfileset dir="${target.dir}/hdk/jdk/jre" prefix="harmony-jre-${harmony.version}">
185 <exclude name="bin/java"/>
189 <chksum dir="${target.dir}" file="${deploy.jre.tar}" />
190 <chksum dir="${target.dir}" file="${deploy.jre.tar}" type="sha" />
194 <target name="bundle_jre_zip" depends="init" unless="is.unix">
195 <zip destfile="${target.dir}/${deploy.jre.zip}">
196 <zipfileset dir="${target.dir}/hdk/jdk/jre" prefix="harmony-jre-${harmony.version}" filemode="755">
197 <include name="bin/java.exe"/>
198 <include name="bin/javaw.exe"/>
200 <zipfileset dir="${target.dir}/hdk/jdk/jre" prefix="harmony-jre-${harmony.version}">
202 <exclude name="bin/java.exe"/>
203 <exclude name="bin/javaw.exe"/>
206 <chksum dir="${target.dir}" file="${deploy.jre.zip}" />
207 <chksum dir="${target.dir}" file="${deploy.jre.zip}" type="sha" />
211 <!-- ================================================================================ -->
212 <!-- from the classlib and vm builds, creates the hdk and jre -->
213 <!-- ================================================================================ -->
214 <target name="assemble_artifacts" depends="init, assemble_stuff, chmod_stuff"/>
216 <target name="assemble_stuff">
217 <!-- create the top-level hdk directory -->
218 <mkdir dir="${target.dir}/hdk"/>
220 <!-- copy the classlib/deploy tree as the hdk
221 filtering out the jre, as that comes from
223 <copy todir="${target.dir}/hdk">
224 <fileset dir="working_classlib/deploy">
225 <exclude name="**/jre/**/*" />
226 <exclude name="**/jdk/lib/*" />
227 <exclude name="**/jdk/include/*" />
228 <exclude name="**/*.pdb" unless="copy.progdb" />
232 <!-- now copy the drlvm/build/deploy -->
233 <!-- set overwrite flag to take hythr from VM -->
234 <copy todir="${target.dir}/hdk" overwrite="true">
235 <fileset dir="working_vm/build/deploy">
236 <exclude name="**/*.pdb" unless="copy.progdb" />
240 <!-- now copy the working_jdktools/deploy/jdk -->
241 <copy todir="${target.dir}/hdk/jdk/">
242 <fileset dir="working_jdktools/deploy/jdk">
243 <exclude name="**/*.pdb" unless="copy.progdb" />
248 <target name="chmod_stuff" if="is.unix">
249 <chmod file="${target.dir}/hdk/jdk/bin/*" perm="ugo+x" />
250 <chmod file="${target.dir}/hdk/jdk/jre/bin/java*" perm="ugo+x" />
253 <target name="assemble_jdk">
255 <!-- create the top-level jdk directory -->
256 <mkdir dir="${target.dir}/jdk"/>
258 <!-- now copy the drlvm/build/deploy/jre
259 contents into the jre in the JDK -->
260 <copy todir="${target.dir}/jdk/jre">
261 <fileset dir="working_vm/build/deploy/jdk/jre">
262 <exclude name="**/*.pdb" unless="copy.progdb" />
266 <!-- now copy the drlvm/build/deploy/jre
267 contents into the jre in the JDK -->
268 <copy todir="${target.dir}/jdk/">
269 <fileset dir="working_jdktools/deploy/jdk">
270 <exclude name="**/*.pdb" unless="copy.progdb" />
276 <!-- ================================================================================ -->
277 <!-- copy license and notices into the root of the hdk -->
278 <!-- ================================================================================ -->
279 <target name="assemble_hdk_doc">
281 <copy todir="${target.dir}/hdk">
283 <include name="COPYRIGHT" />
284 <include name="LICENSE" />
285 <include name="NOTICE" />
286 <include name="THIRD_PARTY_NOTICES.txt" />
292 <!-- ================================================================================ -->
293 <!-- copy license and notices into the root of the JDK and JRE -->
294 <!-- ================================================================================ -->
295 <target name="assemble_jre_doc">
297 <copy todir="${target.dir}/hdk/jdk/jre">
299 <include name="COPYRIGHT" />
300 <include name="LICENSE" />
301 <include name="NOTICE" />
302 <include name="THIRD_PARTY_NOTICES.txt" />
307 <target name="assemble_jdk_doc">
308 <copy todir="${target.dir}/hdk/jdk/">
310 <include name="COPYRIGHT" />
311 <include name="LICENSE" />
312 <include name="NOTICE" />
313 <include name="THIRD_PARTY_NOTICES.txt" />
318 <!-- ================================================================================ -->
319 <!-- build the classlib - ensure depends are up to date an then rebuild -->
320 <!-- ================================================================================ -->
321 <target name="build_classlib" depends="auto_fetch_classlib_libs">
322 <ant antfile="working_classlib/build.xml" target="rebuild" inheritAll="false" >
323 <property name="hy.cfg" value="${hy.cfg}"/>
324 <property name="hy.no.sig" value="${hy.no.sig}"/>
325 <property name="svn.info" value="${harmony.long.version}"/>
326 <property name="svn.version" value="${harmony.version}"/>
327 <property name="keep.working" value="true" />
331 <target name="auto_fetch_classlib_libs" if="auto.fetch">
332 <ant target="fetch_classlib_libs">
333 <property name="hy.cfg" value="${hy.cfg}"/>
334 <property name="hy.no.sig" value="${hy.no.sig}"/>
335 <property name="svn.info" value="${harmony.long.version}"/>
336 <property name="svn.version" value="${harmony.version}"/>
340 <target name="fetch_classlib_libs">
341 <ant antfile="working_classlib/build.xml" target="fetch-depends" inheritall="false" >
342 <property name="hy.cfg" value="${hy.cfg}"/>
343 <property name="hy.no.sig" value="${hy.no.sig}"/>
344 <property name="svn.info" value="${harmony.long.version}"/>
345 <property name="svn.version" value="${harmony.version}"/>
349 <target name="clean_classlib">
350 <ant antfile="working_classlib/build.xml" target="clean" inheritAll="false" >
351 <property name="hy.cfg" value="${hy.cfg}"/>
352 <property name="hy.no.sig" value="${hy.no.sig}"/>
353 <property name="svn.info" value="${harmony.long.version}"/>
354 <property name="svn.version" value="${harmony.version}"/>
355 <property name="keep.working" value="true" />
359 <target name="init_classlib_hdk">
360 <ant antfile="working_classlib/make/build-native.xml"
361 target="copy-makefile-includes" inheritAll="false" >
362 <property name="hy.cfg" value="${hy.cfg}"/>
363 <property name="svn.info" value="${harmony.long.version}"/>
364 <property name="svn.version" value="${harmony.version}"/>
365 <property name="keep.working" value="true" />
369 <!-- ================================================================================ -->
370 <!-- build the vm - ensure depends are up to date an then rebuild -->
371 <!-- ================================================================================ -->
372 <target name="build_vm" depends="init,build_vm_unix,build_vm_windows"/>
374 <target name="clean_vm"
375 depends="init,build_vm_unix_clean,build_vm_windows_clean"/>
377 <target name="build_vm_unix"
378 depends="build_vm_unix_auto_update, build_vm_unix_clean, build_vm_unix_build"
381 <target name="build_vm_unix_update" depends="init" if="is.unix">
382 <exec executable="sh" dir="working_vm/build" failonerror="true">
383 <arg line="build.sh update -Dexternal.dep.CLASSLIB.loc=${drlvm.classlib.offset}"/>
384 <arg line="-Ddeploy.canonical.flag=true"/>
385 <env key="BUILD_CFG" value="${hy.cfg}"/>
389 <target name="build_vm_unix_auto_update" if="auto.fetch">
390 <ant target="build_vm_unix_update" inheritall="true"/>
393 <target name="build_vm_unix_clean" depends="init" if="is.unix">
394 <exec executable="sh" dir="working_vm/build" failonerror="true">
395 <arg line="build.sh clean -Dexternal.dep.CLASSLIB.loc=${drlvm.classlib.offset}"/>
396 <arg line="-Ddeploy.canonical.flag=true"/>
397 <env key="BUILD_CFG" value="${hy.cfg}"/>
401 <target name="build_vm_unix_build" depends="init" if="is.unix">
402 <exec executable="sh" dir="working_vm/build" failonerror="true">
403 <arg line="build.sh -Dexternal.dep.CLASSLIB.loc=${drlvm.classlib.offset}"/>
404 <arg line="-Ddeploy.canonical.flag=true"/>
405 <arg line="-Dsvn.revision=${harmony.version}" />
406 <arg line="-Dhy.no.sig=${hy.no.sig}"/>
407 <arg line="${custom.props}"/>
408 <env key="BUILD_CFG" value="${hy.cfg}"/>
412 <target name="build_vm_windows"
413 depends="build_vm_windows_auto_update, build_vm_windows_clean, build_vm_windows_build"
416 <target name="build_vm_windows_update" unless="is.unix">
417 <exec executable="cmd" dir="working_vm/build" failonerror="true">
418 <arg line="/c build.bat update -Dexternal.dep.CLASSLIB.loc=${drlvm.classlib.offset}"/>
419 <arg line="-Ddeploy.canonical.flag=true"/>
420 <env key="BUILD_CFG" value="${hy.cfg}"/>
421 <env key="CXX" value="msvc"/>
425 <target name="build_vm_windows_auto_update" if="auto.fetch">
426 <ant target="build_vm_windows_update" inheritall="true"/>
429 <target name="build_vm_windows_clean" depends="init" unless="is.unix">
430 <exec executable="cmd" dir="working_vm/build" failonerror="true">
431 <arg line="/c build.bat clean -Dexternal.dep.CLASSLIB.loc=${drlvm.classlib.offset}"/>
432 <arg line="-Ddeploy.canonical.flag=true"/>
433 <env key="BUILD_CFG" value="${hy.cfg}"/>
434 <env key="CXX" value="msvc"/>
438 <target name="build_vm_windows_build" depends="init" unless="is.unix">
439 <exec executable="cmd" dir="working_vm/build" failonerror="true">
440 <arg line="/c build.bat -Dexternal.dep.CLASSLIB.loc=${drlvm.classlib.offset}"/>
441 <arg line="-Ddeploy.canonical.flag=true"/>
442 <arg line="-Dhy.no.sig=${hy.no.sig}"/>
443 <arg line="${custom.props}"/>
444 <env key="BUILD_CFG" value="${hy.cfg}"/>
445 <env key="CXX" value="msvc"/>
449 <!-- ================================================================================ -->
450 <!-- build the common resources - ensure depends are up to date an then rebuild -->
451 <!-- ================================================================================ -->
452 <target name="build_commonresources">
453 <ant antfile="common_resources/build.xml" target="fetch-depends" inheritall="false" >
454 <property name="hy.cfg" value="${hy.cfg}"/>
455 <property name="svn.info" value="${harmony.long.version}"/>
456 <property name="svn.version" value="${harmony.version}"/>
460 <!-- ================================================================================ -->
461 <!-- build the common resources - ensure depends are up to date an then rebuild -->
462 <!-- ================================================================================ -->
463 <target name="build_jdktools" depends="auto_fetch_jdktools_libs">
464 <ant antfile="working_jdktools/build.xml" target="rebuild" inheritall="false" >
465 <property name="hy.cfg" value="${hy.cfg}"/>
466 <property name="svn.info" value="${harmony.long.version}"/>
467 <property name="svn.version" value="${harmony.version}"/>
471 <target name="auto_fetch_jdktools_libs" if="auto.fetch">
472 <ant target="fetch_jdktools_libs" inheritall="false" >
473 <property name="hy.cfg" value="${hy.cfg}"/>
477 <target name="fetch_jdktools_libs" if="auto.fetch">
478 <ant antfile="working_jdktools/build.xml" target="fetch-depends" inheritall="false" >
479 <property name="hy.cfg" value="${hy.cfg}"/>
483 <target name="clean_jdktools">
484 <ant antfile="working_jdktools/build.xml" target="clean" inheritall="false" >
485 <property name="hy.cfg" value="${hy.cfg}"/>
486 <property name="svn.info" value="${harmony.long.version}"/>
487 <property name="svn.version" value="${harmony.version}"/>
491 <!-- ================================================================================ -->
492 <!-- trivial setup -->
493 <!-- ================================================================================ -->
494 <target name="setup" depends="init, show_props">
495 <delete dir="${target.dir}"/>
496 <mkdir dir="${target.dir}"/>
500 <!-- ================================================================================ -->
501 <!-- hard reset - remove checked out classlib and vm tree- be sure you want this -->
502 <!-- ================================================================================ -->
504 description="removes vm and classlib dirs and resets - BE SURE YOU WANT TO DO THIS"
507 <!-- delete the working directories and then do an svn update to reset them -->
508 <delete dir="working_classlib"/>
509 <delete dir="working_vm"/>
511 <exec executable="svn" dir="." failonerror="true">
512 <arg line="update" />
518 depends="init_classlib_hdk,clean_jdktools,clean_classlib,clean_vm" >
519 <delete dir="${target.dir}" failonerror="false" />
522 <!-- ================================================================================ -->
523 <!-- Switches the working_vm directory to vm choice - wired for DRLVM for now -->
524 <!-- ================================================================================ -->
525 <target name="switch_svn_vm" depends="init" if="is.svn">
526 <exec executable="svn" dir="working_vm" failonerror="true">
527 <arg line="-r${svn.revision}"/>
528 <arg line="switch" />
529 <arg line="${vm.svn.url}" />
533 <!-- ================================================================================ -->
534 <!-- Switches the working_vm directory to classlib choice -->
535 <!-- ================================================================================ -->
536 <target name="switch_svn_classlib" depends="init" if="is.svn">
537 <exec executable="svn" dir="working_classlib" failonerror="true">
538 <arg line="-r${svn.revision}"/>
539 <arg line="switch" />
540 <arg line="${classlib.svn.url}" />
544 <!-- ================================================================================ -->
545 <!-- Switches the working_jdktools directory to jdktools -->
546 <!-- ================================================================================ -->
547 <target name="switch_svn_jdktools" depends="init" if="is.svn">
548 <exec executable="svn" dir="working_jdktools" failonerror="true">
549 <arg line="-r${svn.revision}"/>
550 <arg line="switch" />
551 <arg line="${jdktools.svn.url}" />
555 <!-- ================================================================================ -->
556 <!-- Switches the common_resources directory to common_resources -->
557 <!-- ================================================================================ -->
558 <target name="switch_svn_commonresources" depends="init" if="is.svn">
559 <exec executable="svn" dir="common_resources" failonerror="true">
560 <arg line="-r${svn.revision}"/>
561 <arg line="switch" />
562 <arg line="${commonresources.svn.url}" />
566 <!-- ================================================================================ -->
568 <!-- basic setup - reused stuff from classlib/properties.xml for expediency -->
569 <!-- ================================================================================ -->
570 <target name="init" depends="svn-prop">
571 <!-- Determine our operating system -->
572 <condition property="is.windows">
573 <os family="windows" />
576 <condition property="is.unix">
580 <condition property="is.linux">
584 <!-- this special case makes sense -->
585 <condition property="harmony.os" value="windows">
586 <isset property="is.windows"/>
588 <condition property="harmony.os" value="linux">
592 <property name="harmony.os" value="${os.name}" />
594 <!-- Conditions for different architectures -->
595 <condition property="is.x86_64">
598 <condition property="is.x86">
604 <condition property="is.ia64">
607 <condition property="is.64bit">
613 <condition property="is.32bit">
619 <condition property="harmony.bits" value="32">
620 <isset property="is.32bit" />
622 <property name="harmony.bits" value="64" />
624 <!-- Normalized architecture name -->
625 <condition property="harmony.arch" value="x86">
626 <isset property="is.x86" />
628 <condition property="harmony.arch" value="x86_64">
635 <property name="harmony.arch" value="${os.arch}" />
637 <property name="harmony.deploy.suffix" value="-snapshot" />
639 <property name="deploy.hdk.file.prefix"
640 value="apache-harmony-hdk-r${harmony.version}" />
641 <property name="deploy.hdk.tar"
642 value="${deploy.hdk.file.prefix}-${harmony.os}-${harmony.arch}-${harmony.bits}${harmony.deploy.suffix}.tar.gz" />
643 <property name="deploy.hdk.zip"
644 value="${deploy.hdk.file.prefix}-${harmony.os}-${harmony.arch}-${harmony.bits}${harmony.deploy.suffix}.zip" />
646 <property name="deploy.jdk.file.prefix"
647 value="apache-harmony-jdk-r${harmony.version}" />
648 <property name="deploy.jdk.tar"
649 value="${deploy.jdk.file.prefix}-${harmony.os}-${harmony.arch}-${harmony.bits}${harmony.deploy.suffix}.tar.gz" />
650 <property name="deploy.jdk.zip"
651 value="${deploy.jdk.file.prefix}-${harmony.os}-${harmony.arch}-${harmony.bits}${harmony.deploy.suffix}.zip" />
653 <property name="deploy.jre.file.prefix"
654 value="apache-harmony-jre-r${harmony.version}" />
655 <property name="deploy.jre.tar"
656 value="${deploy.jre.file.prefix}-${harmony.os}-${harmony.arch}-${harmony.bits}${harmony.deploy.suffix}.tar.gz" />
657 <property name="deploy.jre.zip"
658 value="${deploy.jre.file.prefix}-${harmony.os}-${harmony.arch}-${harmony.bits}${harmony.deploy.suffix}.zip" />
660 <property name="deploy.src.file.prefix"
661 value="apache-harmony-src-r${harmony.version}" />
662 <property name="deploy.src.tar"
663 value="${deploy.src.file.prefix}${harmony.deploy.suffix}.tar.gz" />
664 <property name="deploy.src.zip"
665 value="${deploy.src.file.prefix}${harmony.deploy.suffix}.zip" />
667 <!-- copy symbol debug info to debug build on Windows -->
668 <condition property="copy.progdb">
669 <equals arg1="${hy.cfg}" arg2="debug" />
672 <!-- workaround for drlvm build till it starts with a script-->
673 <condition property="custom.props" value="-Dhy.javac.compiler=${hy.javac.compiler}"
675 <isset property="hy.javac.compiler"/>
680 <target name="show_props" depends="init">
682 Apache Harmony Federated Build
683 ==========================================
684 svn rev : ${harmony.version}
685 operating system : ${harmony.os}
686 architecture : ${harmony.arch}-${harmony.bits}
687 ant os name/arch : ${os.name}/${os.arch}
688 hosting Java : ${java.version} (${java.vendor})
689 build mode : ${hy.cfg}
690 output location : ${target.dir}
691 DRLVM classlib : ${drlvm.classlib.offset}
692 SVN root : ${svn.root}
696 <!-- ================================================================================ -->
697 <!-- svn-prop : get svn revision number of the build.xml file -->
699 <!-- taken from classlib/properties.xml, because of uncertainty -->
700 <!-- of state of the working_classlib dir, I need a copy -->
701 <!-- TODO - we want to be able to pass property in to ant so we don't need a -->
702 <!-- pause and it's reproducable -->
703 <!-- ================================================================================ -->
704 <target name="svn-prop">
705 <exec executable="svn"
707 failifexecutionfails="false"
708 resultproperty="svn.rc">
710 <arg value="build.xml" />
711 <redirector outputproperty="svn.revision.tmp">
714 <contains value="Revision: " />
717 <replacestring from="Revision: " to=""/>
722 <condition property="is.svn" value="true">
723 <equals arg1="${svn.rc}" arg2="0" />
725 <condition property="svn.revision" value="${svn.revision.tmp}" >
726 <equals arg1="${svn.rc}" arg2="0" />
728 <property name="svn.revision" value="unknown" />
729 <property name="harmony.version" value="${svn.revision}" />
731 <exec executable="svn"
732 failifexecutionfails="false"
733 resultproperty="svn.rc">
735 <redirector outputproperty="svn.root.tmp">
738 <regexp pattern="Repository Root:" />
739 </linecontainsregexp>
741 <replacestring from="Repository Root: " to=""/>
747 <condition property="svn.info" value="${svn.root.tmp} ${svn.revision}" >
748 <equals arg1="${svn.rc}" arg2="0" />
751 <format property="svn.info"
752 pattern="'Unknown revision at' dd-MMM-yyyy hh:mm aa"/>
754 <property name="harmony.long.version" value="${svn.info}" />
756 <condition property="svn.root" value="${svn.root.tmp}" >
757 <equals arg1="${svn.rc}" arg2="0" />
760 <!-- default SVN URLs -->
761 <property name="svn.root" value="http://svn.apache.org/repos/asf"/>
763 <condition property="classlib.svn.url"
764 value="${svn.root}/harmony/enhanced/classlib/branches/java6"
765 else="${svn.root}/harmony/enhanced/classlib/trunk">
766 <isset property="java6" />
769 <property name="vm.svn.url" value="${svn.root}/harmony/enhanced/drlvm/trunk" />
770 <property name="jdktools.svn.url" value="${svn.root}/harmony/enhanced/jdktools/trunk" />
771 <property name="commonresources.svn.url" value="${svn.root}/harmony/enhanced/common_resources" />
774 <target name="bundle_src_tgz" depends="init" if="is.unix">
776 <tar tarfile="${target.dir}/${deploy.src.tar}" compression="gzip"
778 <tarfileset dir="${target.dir}/src" prefix="apache-harmony-src-r${harmony.version}">
783 <chksum dir="${target.dir}" file="${deploy.src.tar}" />
784 <chksum dir="${target.dir}" file="${deploy.src.tar}" type="sha" />
788 <target name="bundle_src_zip" depends="init" unless="is.unix">
789 <zip destfile="${target.dir}/${deploy.src.zip}">
790 <zipfileset dir="${target.dir}/src" prefix="apache-harmony-src-r${harmony.version}">
794 <chksum dir="${target.dir}" file="${deploy.src.zip}" />
795 <chksum dir="${target.dir}" file="${deploy.src.zip}" type="sha" />
798 <target name="copy_source" depends="init,populate_source">
799 <exec executable="svn">
800 <arg value="export" />
802 <arg value="${target.dir}/src" />
804 <exec executable="svn">
805 <arg value="export" />
806 <arg value="working_classlib/modules/concurrent/standard" />
807 <arg value="${target.dir}/src/working_classlib/modules/concurrent/standard" />
809 <echo file="${target.dir}/src/release.properties">
810 harmony.version=${harmony.version}
811 harmony.long.version=${harmony.long.version}
812 harmony.deploy.suffix=${harmony.deploy.suffix}
816 <!-- ================================================================================ -->
817 <!-- produces a nicer looking checksum - taken from classlib/build.xml -->
818 <!-- ================================================================================ -->
819 <macrodef name="chksum">
820 <attribute name="dir" />
821 <attribute name="file" />
822 <attribute name="type" default="md5" />
824 <checksum property="@{file}.@{type}"
825 file="@{dir}/@{file}"
826 algorithm="@{type}" />
827 <echo file="@{dir}/@{file}.@{type}"
828 message="${@{file}.@{type}} @{file}${line.separator}" />