blob: f3802b50a1e5e02a32a663bc47f7ca7bf7fa7af5 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="build-harmony" default="build" basedir=".">
<!-- name of the target directory to use for building and final assembly -->
<property name="target.dir" value="target" />
<!-- release property file which is added to source release -->
<property file="release.properties" />
<!-- debug or release version -->
<property name="hy.cfg" value="release" />
<property name="hy.local.zlib" value="false" />
<description>
Apache Harmony project federation script
</description>
<target name="help">
<echo>
Apache Harmony Ant Build
Usage:
ant build
Compiles the java and native code to produce a jdk in
"target/hdk".
ant clean
Removes all the files generated by a build.
ant rebuild
Performs a full build - that is 'clean' then 'build'.
ant snapshot
Produces a archive (tar/zip) of a build.
ant fetch-depends
Fetches dependencies. Note: Some of Harmony's dependencies are
licensed under terms other than the Apache License v2.
ant properties
Display the common build properties.
</echo>
</target>
<!-- ============================================================== -->
<!-- main target - should checkout, build and package hdk,
jdk and jre -->
<!-- ============================================================== -->
<target name="all"
description="setup and build complete implementation"
depends="setup,
populate-src,
clean,
build,
bundle-hdk,
bundle-jdk,
bundle-jre"/>
<target name="snapshot"
description="setup and build complete src + binaries set"
depends="bundle-src,
clean,
build,
bundle-hdk,
bundle-jdk,
bundle-jre"/>
<target name="build"
description="build complete implementation"
depends="properties,
build-classlib,
build-vm,
build-commonresources,
build-jdktools,
assemble-artifacts"/>
<target name="bundle-src"
description="assemble source snapshot"
depends="clean,
setup,
copy-src,
bundle-src-tgz,
bundle-src-zip" />
<!-- ============================================================== -->
<!-- populates the source directories, working_classlib,
working_vm, working_jdktools, and common_resources -->
<!-- ============================================================== -->
<target name="populate-src"
description="checkout the class library and VM source trees"
depends="init,
properties,
switch-svn-vm,
switch-svn-classlib,
switch-svn-jdktools,
switch-svn-commonresources" />
<!-- ============================================================== -->
<!-- creates the HDK bundle appropriate for the platform -->
<!-- ============================================================== -->
<target name="bundle-hdk"
depends="assemble-artifacts,
assemble-hdk-doc,
bundle-hdk-tgz,
bundle-hdk-zip" />
<!-- ============================================================== -->
<!-- builds with a clean first -->
<!-- ============================================================== -->
<target name="rebuild" depends="clean, build"
description="Performs a full build - that is 'clean' then 'build'" />
<!-- ============================================================== -->
<!-- fetches external dependencies -->
<!-- ============================================================== -->
<target name="fetch-depends"
description="Fetches dependencies. Note: Some of Harmony dependencies are licensed under terms other than the Apache License v2."
depends="fetch-classlib-libs,
fetch-vm-libs,
fetch-commonresources,
fetch-jdktools-libs"/>
<target name="bundle-hdk-tgz" depends="init" if="is.unix">
<!-- create the tar file and then md5 checksum using harmony-hdk-rev as the root,
and setting exec bits as needed -->
<tar tarfile="${target.dir}/${deploy.hdk.tar}" compression="gzip">
<tarfileset dir="${target.dir}/hdk"
prefix="${archive.dir.prefix}hdk-${harmony.version}"
mode="755">
<include name="jdk/jre/bin/java"/>
<include name="jdk/bin/*"/>
</tarfileset>
<tarfileset dir="${target.dir}/hdk"
prefix="${archive.dir.prefix}hdk-${harmony.version}">
<include name="**"/>
<exclude name="jdk/jre/bin/java"/>
<exclude name="jdk/bin/*"/>
<exclude name="jdk/jre/README"/>
</tarfileset>
<tarfileset dir="${target.dir}/hdk/jdk/jre"
prefix="${archive.dir.prefix}hdk-${harmony.version}">
<include name="README"/>
</tarfileset>
</tar>
<chksum dir="${target.dir}" file="${deploy.hdk.tar}" />
<chksum dir="${target.dir}" file="${deploy.hdk.tar}" type="sha" />
</target>
<target name="bundle-hdk-zip" depends="init" unless="is.unix">
<!-- create the tar file and then md5 checksum using harmony-hdk-rev as the root,
and setting exec bits as needed -->
<zip destfile="${target.dir}/${deploy.hdk.zip}" >
<zipfileset dir="${target.dir}/hdk"
prefix="${archive.dir.prefix}hdk-${harmony.version}"
filemode="755">
<include name="jdk/jre/bin/java.exe"/>
<include name="jdk/jre/bin/javaw.exe"/>
<include name="jdk/bin/*"/>
</zipfileset>
<zipfileset dir="${target.dir}/hdk"
prefix="${archive.dir.prefix}hdk-${harmony.version}">
<include name="**"/>
<exclude name="jdk/jre/bin/java.exe"/>
<exclude name="jdk/jre/bin/javaw.exe"/>
<exclude name="jdk/bin/*"/>
<exclude name="jdk/jre/README"/>
</zipfileset>
<zipfileset dir="${target.dir}/hdk/jdk/jre"
prefix="${archive.dir.prefix}hdk-${harmony.version}">
<include name="README"/>
</zipfileset>
</zip>
<chksum dir="${target.dir}" file="${deploy.hdk.zip}" />
<chksum dir="${target.dir}" file="${deploy.hdk.zip}" type="sha" />
</target>
<!-- ============================================================== -->
<!-- creates the JDK bundle appropriate for the platform -->
<!-- ============================================================== -->
<target name="bundle-jdk"
depends="assemble-jdk-doc,
bundle-jdk-tgz,
bundle-jdk-zip" />
<target name="bundle-jdk-tgz" depends="init" if="is.unix">
<tar tarfile="${target.dir}/${deploy.jdk.tar}" compression="gzip" >
<tarfileset dir="${target.dir}/hdk/jdk"
prefix="${archive.dir.prefix}jdk-${harmony.version}"
mode="755">
<include name="jre/bin/java"/>
<include name="bin/*"/>
</tarfileset>
<tarfileset dir="${target.dir}/hdk/jdk"
prefix="${archive.dir.prefix}jdk-${harmony.version}">
<include name="**"/>
<exclude name="jre/bin/java"/>
<exclude name="bin/*"/>
<exclude name="jre/README"/>
</tarfileset>
<tarfileset dir="${target.dir}/hdk/jdk/jre"
prefix="${archive.dir.prefix}jdk-${harmony.version}">
<include name="README"/>
</tarfileset>
</tar>
<chksum dir="${target.dir}" file="${deploy.jdk.tar}" />
<chksum dir="${target.dir}" file="${deploy.jdk.tar}" type="sha" />
</target>
<target name="bundle-jdk-zip" depends="init" unless="is.unix">
<zip destfile="${target.dir}/${deploy.jdk.zip}">
<zipfileset dir="${target.dir}/hdk/jdk"
prefix="${archive.dir.prefix}jdk-${harmony.version}"
filemode="755">
<include name="jre/bin/java.exe"/>
<include name="jre/bin/javaw.exe"/>
<include name="bin/*"/>
</zipfileset>
<zipfileset dir="${target.dir}/hdk/jdk"
prefix="${archive.dir.prefix}jdk-${harmony.version}">
<include name="**"/>
<exclude name="jre/bin/java.exe"/>
<exclude name="jre/bin/javaw.exe"/>
<exclude name="bin/*"/>
<exclude name="jre/README"/>
</zipfileset>
<zipfileset dir="${target.dir}/hdk/jdk/jre"
prefix="${archive.dir.prefix}jdk-${harmony.version}">
<include name="README"/>
</zipfileset>
</zip>
<chksum dir="${target.dir}" file="${deploy.jdk.zip}" />
<chksum dir="${target.dir}" file="${deploy.jdk.zip}" type="sha" />
</target>
<!-- ============================================================== -->
<!-- creates the JRE bundle appropriate for the platform -->
<!-- ============================================================== -->
<target name="bundle-jre"
depends="assemble-jre-doc,
bundle-jre-tgz,
bundle-jre-zip" />
<target name="bundle-jre-tgz" depends="init" if="is.unix">
<tar tarfile="${target.dir}/${deploy.jre.tar}" compression="gzip" >
<tarfileset dir="${target.dir}/hdk/jdk/jre"
prefix="${archive.dir.prefix}jre-${harmony.version}"
mode="755">
<include name="bin/java"/>
</tarfileset>
<tarfileset dir="${target.dir}/hdk/jdk/jre"
prefix="${archive.dir.prefix}jre-${harmony.version}">
<include name="**"/>
<exclude name="bin/java"/>
</tarfileset>
</tar>
<chksum dir="${target.dir}" file="${deploy.jre.tar}" />
<chksum dir="${target.dir}" file="${deploy.jre.tar}" type="sha" />
</target>
<target name="bundle-jre-zip" depends="init" unless="is.unix">
<zip destfile="${target.dir}/${deploy.jre.zip}">
<zipfileset dir="${target.dir}/hdk/jdk/jre"
prefix="${archive.dir.prefix}jre-${harmony.version}"
filemode="755">
<include name="bin/java.exe"/>
<include name="bin/javaw.exe"/>
</zipfileset>
<zipfileset dir="${target.dir}/hdk/jdk/jre"
prefix="${archive.dir.prefix}jre-${harmony.version}">
<include name="**"/>
<exclude name="bin/java.exe"/>
<exclude name="bin/javaw.exe"/>
</zipfileset>
</zip>
<chksum dir="${target.dir}" file="${deploy.jre.zip}" />
<chksum dir="${target.dir}" file="${deploy.jre.zip}" type="sha" />
</target>
<!-- ============================================================== -->
<!-- from the classlib and vm builds, creates the hdk and jre -->
<!-- ============================================================== -->
<target name="assemble-artifacts"
depends="init,
assemble-stuff,
chmod-stuff"/>
<target name="assemble-stuff">
<!-- create the top-level hdk directory -->
<mkdir dir="${target.dir}/hdk"/>
<!-- copy the classlib/deploy tree as the hdk
filtering out the jre, as that comes from
working_vm -->
<!-- TODO: classlib files should come from classlib. So we
should filter out classlib files when copying out of
working_vm and *not* when copying out of
working_classlib. And if necessary add specific excludes
so we know exactly why it is not done in the obvious
way. -->
<copy todir="${target.dir}/hdk">
<fileset dir="working_classlib/deploy">
<exclude name="**/jre/**/*" />
<exclude name="**/jdk/include/*" />
</fileset>
</copy>
<!-- now copy the drlvm/build/deploy -->
<!-- set overwrite flag to take hythr from VM -->
<copy todir="${target.dir}/hdk" overwrite="true">
<fileset dir="working_vm/deploy">
<!-- TODO: where should these .pdb files go? -->
<exclude name="**/*.pdb" unless="copy.progdb" />
</fileset>
</copy>
<!-- now copy the working_jdktools/deploy/jdk -->
<copy todir="${target.dir}/hdk/jdk/">
<fileset dir="working_jdktools/deploy/jdk" />
</copy>
</target>
<target name="chmod-stuff" if="is.unix">
<chmod file="${target.dir}/hdk/jdk/bin/*" perm="ugo+x" />
<chmod file="${target.dir}/hdk/jdk/jre/bin/java*" perm="ugo+x" />
<chmod file="${target.dir}/hdk/jdk/jre/bin/keytool*" perm="ugo+x" />
<chmod file="${target.dir}/hdk/jdk/jre/bin/policytool*" perm="ugo+x" />
<chmod file="${target.dir}/hdk/jdk/jre/bin/unpack200*" perm="ugo+x" />
<chmod file="${target.dir}/hdk/jdk/jre/bin/pack200*" perm="ugo+x" />
</target>
<target name="assemble-jdk">
<!-- create the top-level jdk directory -->
<mkdir dir="${target.dir}/jdk"/>
<!-- now copy the drlvm/build/deploy/jre
contents into the jre in the JDK -->
<copy todir="${target.dir}/jdk/jre">
<fileset dir="working_vm/build/deploy/jdk/jre">
<exclude name="**/*.pdb" unless="copy.progdb" />
</fileset>
</copy>
<!-- now copy the drlvm/build/deploy/jre
contents into the jre in the JDK -->
<copy todir="${target.dir}/jdk/">
<fileset dir="working_jdktools/deploy/jdk">
<exclude name="**/*.pdb" unless="copy.progdb" />
</fileset>
</copy>
</target>
<!-- ============================================================== -->
<!-- copies a license and notices into the root of the hdk -->
<!-- ============================================================== -->
<target name="assemble-hdk-doc">
<copy todir="${target.dir}/hdk" overwrite="true">
<fileset dir="./">
<include name="LICENSE" />
<include name="NOTICE" />
</fileset>
</copy>
</target>
<!-- ============================================================== -->
<!-- copies a license and notices into the root of the JDK and JRE -->
<!-- ============================================================== -->
<target name="assemble-jre-doc">
<copy todir="${target.dir}/hdk/jdk/jre" overwrite="true">
<fileset dir="./">
<include name="LICENSE" />
<include name="NOTICE" />
</fileset>
</copy>
</target>
<target name="assemble-jdk-doc">
<copy todir="${target.dir}/hdk/jdk/" overwrite="true">
<fileset dir="./">
<include name="LICENSE" />
<include name="NOTICE" />
</fileset>
</copy>
</target>
<!-- ============================================================== -->
<!-- ensures dependencies are up to date, then builds classlib -->
<!-- ============================================================== -->
<propertyset id="required.props">
<propertyref name="hy.cfg" />
<propertyref name="hy.local.zlib" />
<propertyref name="use.libstdc++5" />
<propertyref name="harmony.java.version" />
</propertyset>
<target name="build-classlib" depends="auto-fetch-classlib-libs">
<ant antfile="working_classlib/build.xml" target="build" inheritAll="false" >
<propertyset refid="required.props" />
<property name="svn.info" value="${harmony.long.version}"/>
<property name="svn.revision" value="${harmony.version}"/>
<property name="keep.working" value="true" />
</ant>
<!-- hack to make sure the vm doesn't use the classlib
LICENSE/NOTICE files as they don't cover ICU4C
-->
<copy todir="working_classlib/deploy" overwrite="true">
<fileset dir=".">
<include name="LICENSE" />
<include name="NOTICE" />
</fileset>
</copy>
</target>
<target name="auto-fetch-classlib-libs" if="auto.fetch">
<ant target="fetch-classlib-libs">
<propertyset refid="required.props" />
<property name="svn.info" value="${harmony.long.version}"/>
<property name="svn.revision" value="${harmony.version}"/>
</ant>
</target>
<target name="fetch-classlib-libs">
<ant antfile="working_classlib/build.xml" target="fetch-depends" inheritall="false" >
<propertyset refid="required.props" />
<property name="svn.info" value="${harmony.long.version}"/>
<property name="svn.revision" value="${harmony.version}"/>
</ant>
</target>
<target name="clean-classlib">
<ant antfile="working_classlib/build.xml" target="clean" inheritAll="false" >
<propertyset refid="required.props" />
<property name="svn.info" value="${harmony.long.version}"/>
<property name="svn.revision" value="${harmony.version}"/>
<property name="keep.working" value="true" />
</ant>
</target>
<target name="init-classlib-hdk">
<ant antfile="working_classlib/build.xml"
target="-init-hdk" inheritAll="false" >
<property name="hy.cfg" value="${hy.cfg}"/>
<property name="svn.info" value="${harmony.long.version}"/>
<property name="svn.revision" value="${harmony.version}"/>
<property name="keep.working" value="true" />
</ant>
</target>
<!-- ============================================================== -->
<!-- ensures that dependencies are up to date and then builds a vm -->
<!-- ============================================================== -->
<target name="build-vm" depends="auto-fetch-vm-libs">
<ant antfile="working_vm/build.xml" target="build" inheritAll="false" >
<propertyset refid="required.props" />
<property name="svn.info" value="${harmony.long.version}"/>
<property name="svn.revision" value="${harmony.version}"/>
<property name="deploy.canonical.flag" value="true"/>
</ant>
</target>
<target name="auto-fetch-vm-libs" if="auto.fetch">
<ant target="fetch-vm-libs">
<propertyset refid="required.props" />
<property name="svn.info" value="${harmony.long.version}"/>
<property name="svn.revision" value="${harmony.version}"/>
</ant>
</target>
<target name="fetch-vm-libs">
<ant antfile="working_vm/build.xml" target="fetch-depends" inheritall="false" >
<propertyset refid="required.props" />
<property name="svn.info" value="${harmony.long.version}"/>
<property name="svn.revision" value="${harmony.version}"/>
</ant>
</target>
<target name="clean-vm">
<ant antfile="working_vm/build.xml" target="clean" inheritall="false" >
<propertyset refid="required.props" />
<property name="svn.info" value="${harmony.long.version}"/>
<property name="svn.revision" value="${harmony.version}"/>
<property name="deploy.canonical.flag" value="true"/>
</ant>
</target>
<!-- ============================================================== -->
<!-- fetches the common resources -->
<!-- ============================================================== -->
<target name="build-commonresources" depends="auto-fetch-commonresources"/>
<target name="auto-fetch-commonresources" if="auto.fetch">
<ant target="fetch-commonresources">
<propertyset refid="required.props" />
<property name="svn.info" value="${harmony.long.version}"/>
<property name="svn.revision" value="${harmony.version}"/>
</ant>
</target>
<target name="fetch-commonresources">
<ant antfile="common_resources/build.xml" target="fetch-depends" inheritall="false" >
<property name="hy.cfg" value="${hy.cfg}"/>
<property name="svn.info" value="${harmony.long.version}"/>
<property name="svn.revision" value="${harmony.version}"/>
</ant>
</target>
<!-- ============================================================== -->
<!-- ensures dependencies are up to date, then builds jdktools -->
<!-- ============================================================== -->
<target name="build-jdktools" depends="auto-fetch-jdktools-libs">
<ant antfile="working_jdktools/build.xml" target="build" inheritall="false" >
<property name="hy.cfg" value="${hy.cfg}"/>
<property name="svn.info" value="${harmony.long.version}"/>
<property name="svn.revision" value="${harmony.version}"/>
</ant>
</target>
<target name="auto-fetch-jdktools-libs" if="auto.fetch">
<ant target="fetch-jdktools-libs" inheritall="false" >
<property name="hy.cfg" value="${hy.cfg}"/>
</ant>
</target>
<target name="fetch-jdktools-libs">
<ant antfile="working_jdktools/build.xml" target="fetch-depends" inheritall="false" >
<property name="hy.cfg" value="${hy.cfg}"/>
</ant>
</target>
<target name="clean-jdktools">
<ant antfile="working_jdktools/build.xml" target="clean" inheritall="false" >
<property name="hy.cfg" value="${hy.cfg}"/>
<property name="svn.info" value="${harmony.long.version}"/>
<property name="svn.revision" value="${harmony.version}"/>
</ant>
</target>
<!-- ============================================================== -->
<!-- recreates distribution dir -->
<!-- ============================================================== -->
<target name="setup" depends="init, properties">
<delete dir="${target.dir}"/>
<mkdir dir="${target.dir}"/>
</target>
<!-- ============================================================== -->
<!-- hard reset - removes checked out classlib and vm tree -->
<!-- ============================================================== -->
<target name="reset"
description="removes vm and classlib dirs and resets - BE SURE YOU WANT TO DO THIS"
depends="clean">
<!-- delete the working directories and then do an svn update to reset them -->
<delete dir="working_classlib"/>
<delete dir="working_vm"/>
<exec executable="svn" dir="." failonerror="true">
<arg line="update" />
</exec>
</target>
<target name="clean"
depends="init-classlib-hdk,
clean-jdktools,
clean-classlib,
clean-vm,
clean-tests" >
<delete dir="${target.dir}" failonerror="false" />
</target>
<!-- ============================================================== -->
<!-- switches the working_vm directory to vm module (DRLVM for now) -->
<!-- ============================================================== -->
<target name="switch-svn-vm" depends="init" if="is.svn">
<exec executable="svn" dir="working_vm" failonerror="true">
<arg line="-r${svn.revision}"/>
<arg line="switch" />
<arg line="${vm.svn.url}" />
</exec>
</target>
<!-- ============================================================== -->
<!-- switches the working_classlib directory to classlib -->
<!-- ============================================================== -->
<target name="switch-svn-classlib" depends="init" if="is.svn">
<exec executable="svn" dir="working_classlib" failonerror="true">
<arg line="-r${svn.revision}"/>
<arg line="switch" />
<arg line="${classlib.svn.url}" />
</exec>
</target>
<!-- ============================================================== -->
<!-- switches the working_jdktools directory to jdktools -->
<!-- ============================================================== -->
<target name="switch-svn-jdktools" depends="init" if="is.svn">
<exec executable="svn" dir="working_jdktools" failonerror="true">
<arg line="-r${svn.revision}"/>
<arg line="switch" />
<arg line="${jdktools.svn.url}" />
</exec>
</target>
<!-- ============================================================== -->
<!-- switches the common_resources directory to common_resources -->
<!-- ============================================================== -->
<target name="switch-svn-commonresources" depends="init" if="is.svn">
<exec executable="svn" dir="common_resources" failonerror="true">
<arg line="-r${svn.revision}"/>
<arg line="switch" />
<arg line="${commonresources.svn.url}" />
</exec>
</target>
<!-- ============================================================== -->
<!-- sets up a platform -->
<!-- ============================================================== -->
<target name="init" depends="svn-prop">
<!-- Determine our operating system -->
<condition property="is.windows">
<os family="windows" />
</condition>
<condition property="is.unix">
<os family="unix" />
</condition>
<condition property="is.linux">
<os name="linux" />
</condition>
<!-- this special case makes sense -->
<condition property="harmony.os" value="windows">
<isset property="is.windows"/>
</condition>
<condition property="harmony.os" value="linux">
<os name="linux" />
</condition>
<property name="harmony.os" value="${os.name}" />
<!-- Conditions for different architectures -->
<condition property="is.x86_64">
<os arch="x86_64"/>
</condition>
<condition property="is.x86">
<or>
<os arch="x86"/>
<os arch="i386"/>
</or>
</condition>
<condition property="is.ia64">
<os arch="ia64" />
</condition>
<condition property="is.64bit">
<or>
<os arch="ia64" />
<os arch="x86_64"/>
</or>
</condition>
<condition property="is.32bit">
<or>
<os arch="x86"/>
<os arch="i386"/>
</or>
</condition>
<condition property="harmony.bits" value="32">
<isset property="is.32bit" />
</condition>
<property name="harmony.bits" value="64" />
<!-- Normalized architecture name -->
<condition property="harmony.arch" value="x86">
<isset property="is.x86" />
</condition>
<condition property="harmony.arch" value="x86_64">
<or>
<os arch="x86_64"/>
<os arch="amd64"/>
<os arch="em64t"/>
</or>
</condition>
<property name="harmony.arch" value="${os.arch}" />
<property name="harmony.deploy.suffix" value="-snapshot" />
<condition property="harmony.java.version" value="6.0" else="5.0">
<isset property="java6" />
</condition>
<property name="deploy.file.prefix"
value="apache-harmony-${harmony.java.version}-" />
<property name="archive.dir.prefix"
value="harmony-${harmony.java.version}-" />
<property name="deploy.hdk.file.prefix"
value="${deploy.file.prefix}hdk-r${harmony.version}" />
<property name="deploy.hdk.tar"
value="${deploy.hdk.file.prefix}-${harmony.os}-${harmony.arch}-${harmony.bits}${harmony.deploy.suffix}.tar.gz" />
<property name="deploy.hdk.zip"
value="${deploy.hdk.file.prefix}-${harmony.os}-${harmony.arch}-${harmony.bits}${harmony.deploy.suffix}.zip" />
<property name="deploy.jdk.file.prefix"
value="${deploy.file.prefix}jdk-r${harmony.version}" />
<property name="deploy.jdk.tar"
value="${deploy.jdk.file.prefix}-${harmony.os}-${harmony.arch}-${harmony.bits}${harmony.deploy.suffix}.tar.gz" />
<property name="deploy.jdk.zip"
value="${deploy.jdk.file.prefix}-${harmony.os}-${harmony.arch}-${harmony.bits}${harmony.deploy.suffix}.zip" />
<property name="deploy.jre.file.prefix"
value="${deploy.file.prefix}jre-r${harmony.version}" />
<property name="deploy.jre.tar"
value="${deploy.jre.file.prefix}-${harmony.os}-${harmony.arch}-${harmony.bits}${harmony.deploy.suffix}.tar.gz" />
<property name="deploy.jre.zip"
value="${deploy.jre.file.prefix}-${harmony.os}-${harmony.arch}-${harmony.bits}${harmony.deploy.suffix}.zip" />
<property name="deploy.src.file.prefix"
value="${deploy.file.prefix}src-r${harmony.version}" />
<property name="deploy.src.tar"
value="${deploy.src.file.prefix}${harmony.deploy.suffix}.tar.gz" />
<property name="deploy.src.zip"
value="${deploy.src.file.prefix}${harmony.deploy.suffix}.zip" />
<!-- copy symbol debug info to debug build on Windows -->
<condition property="copy.progdb">
<equals arg1="${hy.cfg}" arg2="debug" />
</condition>
<!-- workaround for drlvm build till it starts with a script-->
<condition property="custom.props" value="-Dhy.javac.compiler=${hy.javac.compiler}"
else="">
<isset property="hy.javac.compiler"/>
</condition>
</target>
<target name="properties" depends="init">
<echo>
Apache Harmony Federated Build
==========================================
svn rev : ${harmony.version}
operating system : ${harmony.os}
CPU architecture : ${harmony.arch}
word length : ${harmony.bits}
ant os name/arch : ${os.name}/${os.arch}
hosting Java : ${java.version} (${java.vendor})
build mode : ${hy.cfg}
output location : ${target.dir}
SVN root : ${svn.root}
</echo>
</target>
<!-- ============================================================== -->
<!-- svn-prop: gets svn revision number of the build.xml file -->
<!-- ============================================================== -->
<target name="svn-prop">
<tempfile suffix=".xml" property="svn.tmp"/>
<exec executable="svn" output="${svn.tmp}" resultproperty="svn.rc">
<arg line="info ${basedir} --non-interactive --xml" />
</exec>
<condition property="svn.info.file" value="${svn.tmp}">
<equals arg1="0" arg2="${svn.rc}"/>
</condition>
<xmlproperty file="${svn.info.file}" prefix="federated"
keeproot="no" collapseAttributes="yes"/>
<delete file="${svn.tmp}" quiet="true"/>
<condition property="is.svn">
<isset property="federated.entry.revision"/>
</condition>
<condition property="svn.revision" value="${federated.entry.revision}" else="unknown">
<isset property="is.svn"/>
</condition>
<condition property="svn.root"
value="${federated.entry.repository.root}"
else="http://svn.apache.org/repos/asf">
<isset property="is.svn"/>
</condition>
<condition property="svn.info" value="${svn.root} ${svn.revision}">
<isset property="is.svn"/>
</condition>
<tstamp>
<format property="svn.info" pattern="'Unknown revision at' dd-MMM-yyyy hh:mm aa"/>
</tstamp>
<property name="harmony.version" value="${svn.revision}" />
<property name="harmony.long.version" value="${svn.info}" />
<!-- default SVN URLs -->
<property name="classlib.svn.url"
value="${svn.root}/harmony/enhanced/classlib/tags/5.0m12a" />
<property name="vm.svn.url"
value="${svn.root}/harmony/enhanced/drlvm/tags/5.0m12a" />
<property name="jdktools.svn.url"
value="${svn.root}/harmony/enhanced/jdktools/tags/5.0m12a" />
<property name="commonresources.svn.url"
value="${svn.root}/harmony/enhanced/common_resources/tags/5.0m12a" />
</target>
<target name="bundle-src-tgz" depends="init" if="is.unix">
<tar tarfile="${target.dir}/${deploy.src.tar}" compression="gzip"
longfile="gnu" >
<tarfileset dir="${target.dir}/src" prefix="${deploy.file.prefix}src-r${harmony.version}" mode="755">
<include name="debian/rules"/>
</tarfileset>
<tarfileset dir="${target.dir}/src" prefix="${deploy.file.prefix}src-r${harmony.version}">
<include name="**"/>
<exclude name="debian/rules"/>
</tarfileset>
</tar>
<chksum dir="${target.dir}" file="${deploy.src.tar}" />
<chksum dir="${target.dir}" file="${deploy.src.tar}" type="sha" />
</target>
<target name="bundle-src-zip" depends="init" unless="is.unix">
<zip destfile="${target.dir}/${deploy.src.zip}">
<zipfileset dir="${target.dir}/src"
prefix="${deploy.file.prefix}src-r${harmony.version}"
filemode="755">
<include name="debian/rules"/>
</zipfileset>
<zipfileset dir="${target.dir}/src"
prefix="${deploy.file.prefix}src-r${harmony.version}">
<include name="**"/>
<exclude name="debian/rules"/>
</zipfileset>
</zip>
<chksum dir="${target.dir}" file="${deploy.src.zip}" />
<chksum dir="${target.dir}" file="${deploy.src.zip}" type="sha" />
</target>
<target name="copy-src" depends="init,populate-src">
<exec executable="svn">
<arg value="export" />
<arg value="." />
<arg value="${target.dir}/src" />
</exec>
<echo file="${target.dir}/src/release.properties">
harmony.version=${harmony.version}
harmony.long.version=${harmony.long.version}
harmony.deploy.suffix=${harmony.deploy.suffix}
harmony.java.version=${harmony.java.version}
</echo>
<chmod file="${target.dir}/src/debian/rules" perm="ugo+x" />
</target>
<target name="test"
depends="test-classlib,test-jdktools,process-test-output" />
<target name="clean-tests">
<delete dir="build/test_report" />
</target>
<target name="test-classlib" depends="clean-tests">
<ant antfile="working_classlib/make/build-test.xml"
target="test-modules" inheritAll="false" >
<propertyset refid="required.props" />
<property name="svn.info" value="${harmony.long.version}"/>
<property name="svn.revision" value="${harmony.version}"/>
<property name="keep.working" value="true" />
<property name="tests.output" location="build/test_report" />
<property name="test.jre.home" location="target/hdk/jdk/jre" />
</ant>
</target>
<target name="test-jdktools" depends="clean-tests">
<ant antfile="working_jdktools/make/build-test.xml"
target="test-modules" inheritAll="false" >
<propertyset refid="required.props" />
<property name="svn.info" value="${harmony.long.version}"/>
<property name="svn.revision" value="${harmony.version}"/>
<property name="keep.working" value="true" />
<property name="tests.output" location="build/test_report" />
<property name="test.jre.home" location="target/hdk/jdk/jre" />
</ant>
</target>
<target name="process-test-output">
<ant antfile="working_classlib/make/build-test.xml"
target="process-test-output" inheritAll="false" >
<propertyset refid="required.props" />
<property name="svn.info" value="${harmony.long.version}"/>
<property name="svn.revision" value="${harmony.version}"/>
<property name="keep.working" value="true" />
<property name="tests.output" location="build/test_report" />
<property name="test.jre.home" location="target/hdk/jdk/jre" />
</ant>
</target>
<!-- ============================================================== -->
<!-- produces a nice looking checksum -->
<!-- ============================================================== -->
<macrodef name="chksum">
<attribute name="dir" />
<attribute name="file" />
<attribute name="type" default="md5" />
<sequential>
<checksum property="@{file}.@{type}"
file="@{dir}/@{file}"
algorithm="@{type}" />
<echo file="@{dir}/@{file}.@{type}"
message="${@{file}.@{type}} @{file}${line.separator}" />
</sequential>
</macrodef>
</project>