<!--
$RCSfile: build.xml,v $


Copyright (c) 2005 Sun Microsystems, Inc. All  Rights Reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met: 

- Redistribution of source code must retain the above copyright 
  notice, this  list of conditions and the following disclaimer.

- Redistribution in binary form must reproduce the above copyright
  notice, this list of conditions and the following disclaimer in 
  the documentation and/or other materials provided with the
  distribution.

Neither the name of Sun Microsystems, Inc. or the names of 
contributors may be used to endorse or promote products derived 
from this software without specific prior written permission.

This software is provided "AS IS," without a warranty of any 
kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND 
WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL 
NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF 
USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR 
ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. 

You acknowledge that this software is not designed or intended for 
use in the design, construction, operation or maintenance of any 
nuclear facility. 

$Revision: 1.10 $
$Date: 2007-08-27 21:43:29 $
$State: Exp $
-->
<project name="jai_imageio" default="jar" basedir=".">
  <description>
    This project builds Java Advanced Imaging Image I/O Tools.

    The build requires that Java Advanced Imaging (JAI) either be installed
    in the J2SDK used for the build or that jai_core.jar be on the CLASSPATH.

    Normally the target platform will be determined automatically from the
    system on which the build is being run. This may be overridden by setting
    the "BUILD_TARGET" property to the desired target platform using the ant
    "-D" command line option. The supported BUILD_TARGET property values and
    their respective target platforms are:

      linux-amd64	64-bit Linux-AMD64
      linux-i586	32-bit Linux-x86
      solaris-amd64     64-bit Solaris-AMD64
      solaris-i586	32-bit Solaris-x86
      solaris-sparc	32-bit Solaris-SPARC
      solaris-sparcv9	64-bit Solaris-SPARC
      windows-i586	32-bit Windows-x86

    It is legal to specify a target as only Java classes and not
    platform-specific native objects are built by this project.

    If the build and target operating system are both Solaris, the build
    target is determined automatically, and a 64-bit JVM is being used for the
    build, then 64-bit mode should be selected by including "-d64" in the
    list of values passed to the JVM in the "ANT_OPTS" environment variable.

    A build of JAI Image I/O Tools is one of the following four types:
    daily build, stable build, beta build (or release candidate) and fcs
    build. Daily builds are named as (dr refers to developer's release) 

    jai-imageio-{version}-pre-dr-bNN-{os}-{arch}-DD_MMM_YYYY.zip

    Stable builds are named as

    jai-imageio-{version}-dr-bNN-{os}-{arch}.zip

    Beta builds are named as either

    jai-imageio-{version}-betaN-{os}-{arch}-.zip

    or

    jai-imageio-{version}-rcN-{os}-{arch}-.zip

    FCS builds are simply

    jai-imageio-{version}-{os}-{arch}-.zip 

    The default is to do a daily build. This may be overriden by setting
    the BUILD_TYPE property on the command line to do a different kind
    of build:
  
      BUILD_TYPE=daily   Do a daily build (default)
      BUILD_TYPE=stable  Do a stable build : -bNN
      BUILD_TYPE=beta    Do a beta or RC production build : -betaN or -rcN
      BUILD_TYPE=fcs     Do an FCS production build : [no suffix]
  
    For example:
  
      ant -DBUILD_TYPE=stable ...

    The "CLIB_DIR" property may be used via the ant "-D" command line
    option to specify the directory containing clibwrapper_jiio.jar;
    the default value is src/share/jclib4jai.

    Class files are compiled into build/${platform}/debug/classes or
    build/${platform}/opt/classes.

    Jar files are created in build/${platform}/debug/lib/ext or
    build/${platform}/opt/lib/ext.

    Native libraries are copied to build/${platform}/debug/bin or
    build/${platform}/opt/bin on Windows and
    build/${platform}/debug/lib/${arch} or
    build/${platform}/opt/lib/${arch} on all other platforms.

    Javadoc is created in build/${platform}/javadocs/docs-jcp,
    build/${platform}/javadocs/docs-private, or
    build/${platform}/javadocs/docs-public depending on the access type.

    The distribution lib bundle is created in dist/${platform}/lib.

    The distribution javadoc bundle is created in dist/${platform}/javadocs.

    Creating the distribution bundles requires specification of the
    BUILD_TYPE property, with the value being either "beta" or
    "fcs". For example,

      ant -DBUILD_TYPE=beta dist

      OR

      ant -DBUILD_TYPE=fcs dist
  </description>

  <!-- Import properties from file. -->
  <property file="build.properties"/>

  <!-- Javadoc properties -->
  <property name="packageListJ2SE" value="build-tools/packageLists/j2se"/>
  <property name="docurlj2se" value="http://java.sun.com/j2se/1.5.0/docs/api"/>
  <property name="docurljai" value="http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs"/>
  <property name="packageListJAI" value="build-tools/packageLists/jai"/>

  <!-- Other global properties -->
  <property name="src"     value="src/share/classes"/>
  <property name="build"   value="build"/>
  <property name="dist"    value="dist"/>
  <property name="textdir" value="."/>

  <!-- Sets a single property if a target is specified. -->
  <target name="selectPlatform" if="BUILD_TARGET">
    <condition property="isLinuxOnAMD64">
        <equals arg1="${BUILD_TARGET}" arg2="linux-amd64" trim="true"/>
    </condition>

    <condition property="isLinuxOnX86">
        <equals arg1="${BUILD_TARGET}" arg2="linux-i586" trim="true"/>
    </condition>

    <condition property="isSolarisOnAMD64">
        <equals arg1="${BUILD_TARGET}" arg2="solaris-amd64" trim="true"/>
    </condition>   

    <condition property="isSolarisOnSparc">
        <equals arg1="${BUILD_TARGET}" arg2="solaris-sparc" trim="true"/>
    </condition>   

    <condition property="isSolarisOnSparcV9">
        <equals arg1="${BUILD_TARGET}" arg2="solaris-sparcv9" trim="true"/>
    </condition>   

    <condition property="isSolarisOnX86">
        <equals arg1="${BUILD_TARGET}" arg2="solaris-i586" trim="true"/>
    </condition>   

    <condition property="isWindowsOnX86">
        <equals arg1="${BUILD_TARGET}" arg2="windows-i586" trim="true"/>
    </condition>
  </target>

  <!-- Sets a single property depending on the type of current platform. -->
  <target name="determinePlatform" unless="BUILD_TARGET">
    <condition property="isLinuxOnAMD64">
      <os name="linux" arch="amd64"/>
    </condition>

    <condition property="isLinuxOnX86">
      <os name="linux" arch="i386"/>
    </condition>

    <condition property="isSolarisOnAMD64">
      <os name="SunOS" arch="amd64"/>
    </condition>   

    <condition property="isSolarisOnSparcV9">
      <os name="SunOS" arch="sparcv9"/>
    </condition>   

    <condition property="isSolarisOnSparc">
      <os name="SunOS" arch="sparc"/>
    </condition>   

    <condition property="isSolarisOnX86">
        <os name="SunOS" arch="x86"/>
    </condition>   

    <condition property="isWindowsOnX86">
	<os family="windows" arch="x86"/>
    </condition>
  </target>

  <!-- Set various properties as a function of platform type. -->

  <target name="setupLinuxAMD64" if="isLinuxOnAMD64">
    <property name="ostype" value="linux"/>
    <property name="platform" value="linux-amd64"/>
    <property name="arch" value="amd64"/>
    <property name="clibarch" value="linux/amd64"/>
    <property name="jrenativesubdir" value="lib/${arch}"/>
  </target>

  <target name="setupLinuxX86" if="isLinuxOnX86">
    <property name="ostype" value="linux"/>
    <property name="platform" value="linux-i586"/>
    <property name="arch" value="i386"/>
    <property name="clibarch" value="linux/i386"/>
    <property name="jrenativesubdir" value="lib/${arch}"/>
  </target>

  <target name="setupSolarisAMD64" if="isSolarisOnAMD64">
    <property name="ostype" value="solaris"/>
    <property name="platform" value="solaris-amd64"/>
    <property name="arch" value="amd64"/>
    <property name="clibarch" value="solaris/amd64"/>
    <property name="jrenativesubdir" value="lib/${arch}"/>
  </target>

  <target name="setupSolarisSparc" if="isSolarisOnSparc">	
    <property name="ostype" value="solaris"/>
    <property name="platform" value="solaris-sparc"/>
    <property name="arch" value="sparc"/>
    <property name="clibarch" value="solaris/sparc"/>
    <property name="jrenativesubdir" value="lib/${arch}"/>
  </target>

  <target name="setupSolarisSparcV9" if="isSolarisOnSparcV9">	
    <property name="ostype" value="solaris"/>
    <property name="platform" value="solaris-sparcv9"/>
    <property name="arch" value="sparcv9"/>
    <property name="clibarch" value="solaris/sparcv9"/>
    <property name="jrenativesubdir" value="lib/${arch}"/>
  </target>

  <target name="setupSolarisX86" if="isSolarisOnX86">
    <property name="ostype" value="solaris"/>
    <property name="platform" value="solaris-i586"/>
    <property name="arch" value="i386"/>
    <property name="clibarch" value="solaris/i386"/>
    <property name="jrenativesubdir" value="lib/${arch}"/>
  </target>

  <target name="setupWindows" if="isWindowsOnX86">	
    <property name="ostype" value="windows"/>
    <property name="platform" value="windows-i586"/>
    <property name="arch" value="i386"/>
    <property name="clibarch" value="windows/i386"/>
    <property name="jrenativesubdir" value="bin"/>
  </target>

  <target name="setupBuildType" depends="initBuildType, setupBuildFcs, setupBuildBeta, setupBuildStable, setupBuildDaily, checkBuildType">
    <echo message="BUILD_TYPE = ${BUILD_TYPE}"/>
  </target>

  <target name="initBuildType">
    <!-- Default value is "daily", overridden on command line -->
    <property name="BUILD_TYPE" value="daily"/>
    <property name="buildType_${BUILD_TYPE}" value="true"/>
  </target>

  <!-- Set properties for FCS build -->
  <target name="setupBuildFcs" if="buildType_fcs">
    <property name="buildTypeSet" value="true"/>

    <property name="version_build" value="b${version_buildnum}"/>
    <property name="version_suffix" value=""/>

    <property name="version" value="${version_base}"/>
    <property name="version_file" value="${version_base_file}-lib"/>
    <property name="doc_file" value="${version_base_file}-doc"/>
    <property name="buildtime" value=""/>
  </target>

  <!-- Set properties for BETA build -->
  <target name="setupBuildBeta" if="buildType_beta">
    <property name="buildTypeSet" value="true"/>

    <property name="version_build" value="b${version_buildnum}"/>
    <property name="version_suffix" value="${version_betastr}"/>

    <property name="version" value="${version_base}-${version_suffix}"/>
    <property name="version_file" value="${version_base_file}-${version_suffix}-lib"/>
    <property name="doc_file" value="${version_base_file}-${version_suffix}-doc"/>
    <property name="buildtime" value=""/>
  </target>

  <!-- Set properties for STABLE build -->
  <target name="setupBuildStable" if="buildType_stable">
    <property name="buildTypeSet" value="true"/>

    <property name="version_build" value="b${version_buildnum}"/>
    <property name="version_suffix" value="dr-${version_build}"/>

    <property name="version" value="${version_base}-${version_suffix}"/>
    <property name="version_file" value="${version_base_file}-${version_suffix}-lib"/>
    <property name="doc_file" value="${version_base_file}-${version_suffix}-doc"/>
    <property name="buildtime" value=""/>
  </target>

  <!-- Set properties for DAILY build -->
  <target name="setupBuildDaily" if="buildType_daily">
    <property name="buildTypeSet" value="true"/>

    <property name="version_build" value="b${version_buildnum}"/>
    <property name="version_suffix" value="pre-dr-${version_build}"/>

    <tstamp>
      <!-- Set build time property -->
      <format property="btime" pattern="dd_MMM_yyyy"/>
    </tstamp>    

    <property name="version" value="${version_base}-${version_suffix}"/>
    <property name="version_file" value="${version_base_file}-${version_suffix}-lib"/>
    <property name="doc_file" value="${version_base_file}-${version_suffix}-doc"/>
    <property name="buildtime" value="-${btime}"/>
  </target>

  <!-- Check buildType -->
  <target name="checkBuildType" unless="buildTypeSet">
    <fail message="Unknown BUILD_TYPE = ${BUILD_TYPE}"/>
  </target>

  <!-- Set properties as a function of the type of platform. -->
  <target name="setupPlatform"
	  depends="setupBuildType,
		   determinePlatform,
		   selectPlatform,
		   setupLinuxAMD64,
		   setupLinuxX86,
		   setupSolarisAMD64,
		   setupSolarisSparc,
		   setupSolarisSparcV9,
		   setupSolarisX86,
		   setupWindows">
    <fail message="Unable to determine the target platform!"
	  unless="platform"/>
  </target>

  <!-- Sets "clib" property to "CLIB_DIR" property. -->
  <target name="clib-env" if="CLIB_DIR">
    <property name="clib" value="${CLIB_DIR}"/>
  </target>

  <!-- Sets "clib" property to default value. -->
  <target name="clib-def" unless="CLIB_DIR">
    <property name="clib" value="src/share/jclib4jai"/>
  </target>

  <!-- Sets "clib" property. -->
  <target name="clib-property" depends="clib-env,clib-def"/>

  <!-- Sets the platform-dependent properties, the "clib" property,
       and the time stamps. -->
  <target name="init" depends="setupPlatform,clib-property">
    <!-- Create the time stamp -->
    <tstamp>
      <!-- Set time stamp properties -->
      <format property="datestamp" pattern="yyyy.MM.dd"/>
      <format property="timestamp" pattern="yyyy-MM-dd HH:mm:ss.SZ"/>
      <format property="filestamp" pattern="yyyy_MM_dd_HH_mm_ss"/>
      <format property="btime" pattern="dd_MMM_yyyy"/>
    </tstamp>
  </target>

  <target name="echo" depends="setupPlatform,clib-property"
	  description="Prints the values of pertinent properties.">
    <echo message="os.arch         = ${os.arch}"/>
    <echo message="os.name         = ${os.name}"/>	
    <echo message="ant.home        = ${ant.home}"/>
    <echo message="java.home       = ${java.home}"/>
    <echo message="user.name       = ${user.name}"/>
    <echo message="user.home       = ${user.home}"/>

    <echo message=""/>

    <echo message="platform        = ${platform}"/>
    <echo message="ostype          = ${ostype}"/>
    <echo message="arch            = ${arch}"/>
    <echo message="clibarch        = ${clibarch}"/>
    <echo message="jrenativesubdir = ${jrenativesubdir}"/>

    <echo message=""/>

    <echo message="src             = ${src}"/>
    <echo message="clib            = ${clib}"/>
    <echo message="textdir         = ${textdir}"/>
    <echo message="packageListJ2SE = ${packageListJ2SE}"/>
    <echo message="docurlj2se      = ${docurlj2se}"/>
    <echo message="packageListJAI  = ${packageListJAI}"/>
    <echo message="docurljai       = ${docurljai}"/>
    <echo message="build           = ${build}"/>
    <echo message="dist            = ${dist}"/>

    <echo message=""/>

    <echo message="BUILD_TYPE      = ${BUILD_TYPE}"/>
    <echo message="version_build   = ${version_build}"/>
    <echo message="version_suffix  = ${version_suffix}"/>

    <echo message="version         = ${version}"/>
    <echo message="version_file    = ${version_file}"/>
    <echo message="doc_file        = ${doc_file}"/>
  </target>

  <!-- Sets compilation mode dependent properties to debug values and
       invokes the target named "${targetname}". -->
  <target name="do-debug" depends="init">
    <property name="debugsetting" value="true"/>
    <property name="debugoroptsubdir" value="debug"/>
    <property name="builddir"
	      value="${build}/${platform}/${debugoroptsubdir}"/>
    <property name="classdir"
	      value="${builddir}/classes"/>
    <property name="jardir"
	      value="${builddir}/lib/ext"/>
    <property name="libdir"
	      value="${builddir}/${jrenativesubdir}"/>

    <antcall target="${targetname}"/>
  </target>

  <!-- Sets compilation mode dependent properties to non-debug values and
       invokes the target named "${targetname}". -->
  <target name="do-opt" depends="init">
    <property name="debugsetting" value="off"/>
    <property name="debugoroptsubdir" value="opt"/>
    <property name="builddir"
	      value="${build}/${platform}/${debugoroptsubdir}"/>
    <property name="classdir"
	      value="${builddir}/classes"/>
    <property name="jardir"
	      value="${builddir}/lib/ext"/>
    <property name="libdir"
	      value="${builddir}/${jrenativesubdir}"/>

    <antcall target="${targetname}"/>
  </target>

  <!-- Invokes "do-debug" target with target "${targetname}". -->
  <target name="debugcall">
    <antcall target="do-debug">
      <param name="targetname" value="${targetname}"/>
    </antcall>
  </target>

  <!-- Invokes "do-opt" target with target "${targetname}". -->
  <target name="optcall">
    <antcall target="do-opt">
      <param name="targetname" value="${targetname}"/>
    </antcall>
  </target>

  <!-- Copies codecLib debug mode files. -->
  <target name="clib-debug">
    <antcall target="debugcall">
      <param name="targetname" value="clib"/>
    </antcall>
  </target>

  <!-- Copies codecLib non-debug mode files. -->
  <target name="clib-opt">
    <antcall target="optcall">
      <param name="targetname" value="clib"/>
    </antcall>
  </target>

  <!-- Copies codecLib files. -->
  <target name="clib">
    <!-- Copy the codecLib jar file -->
    <copy file="${clib}/clibwrapper_jiio.jar" todir="${jardir}"/>

    <!-- Copy the codecLib native libraries -->
    <copy todir="${libdir}">
        <fileset dir="${clib}/${clibarch}" includes="**"/>
    </copy>
  </target>

  <target name="compilation" depends="init">
    <!-- Create the class file directory -->
    <mkdir dir="${classdir}"/>

    <!-- Copy the text files -->
    <copy todir="${builddir}">
      <fileset dir="${textdir}"
	       includes="COPYRIGHT.txt,
			 LICENSE.txt,
			 LICENSE-codecLibJIIO.txt"/>
    </copy>

    <!-- Compile the java code from ${src} into ${classdir} -->
    <javac sourcepath="" srcdir="${src}"
           destdir="${classdir}"
           classpath="${clib}/clibwrapper_jiio.jar"
           debug="${debugsetting}"
           debuglevel="lines,source"
           deprecation="off"
           source="1.4"
	   target="1.4">
      <exclude name="**/com/sun/media/jai/test/*.java"/>
    </javac>

    <!-- Copy the I18N property files while retaining package location -->
    <copy todir="${classdir}">
        <fileset dir="${src}" includes="**/properties"/>
    </copy>
  </target>

  <target name="compile-debug" depends="init,clib-debug"
	  description="Builds all classes with debug compilation.">
    <antcall target="debugcall">
      <param name="targetname" value="compilation"/>
    </antcall>
  </target>

  <target name="compile-opt" depends="init,clib-opt"
	  description="Builds all classes with non-debug compilation.">
    <antcall target="optcall">
      <param name="targetname" value="compilation"/>
    </antcall>
  </target>

  <target name="compile" depends="compile-debug,compile-opt"
	  description="Executes targets compile-debug and compile-opt."/>

  <!-- Generic manifest file. -->
  <target name="manifest">
    <!-- Create the Manifest file -->
    <manifest file="${builddir}/Manifest">
      <attribute name="Specification-Title"
                 value="Java Advanced Imaging Image I/O Tools"/>
      <attribute name="Specification-Version"
                 value="${version}"/>
      <attribute name="Specification-Vendor"
                 value="Sun Microsystems, Inc."/>
      <attribute name="Implementation-Title"
                 value="com.sun.media.imageio"/>
      <attribute name="Implementation-Version"
                 value="${version}"/> 
      <attribute name="Implementation-Vendor"
                 value="Sun Microsystems, Inc."/>
      <attribute name="Extension-Name"
                 value="com.sun.media.imageio"/>
      <attribute name="Sealed" value="true"/>
    </manifest>
  </target>

  <!-- Create jai_imageio.jar. -->
  <target name="jar-core" depends="compile,manifest">
    <jar jarfile="${jardir}/jai_imageio.jar"
         manifest="${builddir}/Manifest" update="yes">
	<fileset dir="${classdir}"/>
	<metainf dir="src/share" prefix="META-INF" includes="services/*"/>
    </jar>
  </target>

  <target name="jar-debug" depends="compile-debug"
	  description="Creates jar files from debug compiled class files.">
    <antcall target="debugcall">
      <param name="targetname" value="jar-core"/>
    </antcall>
  </target>

  <target name="jar-opt" depends="compile-opt"
	  description="Creates jar files from non-debug compiled class files.">
    <antcall target="optcall">
      <param name="targetname" value="jar-core"/>
    </antcall>
  </target>

  <target name="jar" depends="jar-debug,jar-opt"
	  description="Executes targets jar-debug and jar-opt."/>

  <!-- Generic doc target. Requires "docacccess" and "docsubdir"
       properties to be set. -->
  <target name="builddoc" depends="init">
    <property name="docbuilddir"
	      value="${build}/${platform}/javadocs/${docsubdir}"/>

    <!-- Create the build directory structure used by builddoc -->
    <mkdir dir="${docbuilddir}"/>

    <!-- Copy the license file -->
    <copy file="${textdir}/LICENSE.txt"
	  todir="${docbuilddir}"/>

    <!-- Copy the license file -->
    <copy file="${textdir}/COPYRIGHT.txt"
	  todir="${docbuilddir}"/>

    <!-- Compile the javadoc from ${src} into ${docbuilddir} -->
    <!-- NOTE: Cannot just list packages which exist in J2SE or in
	 linked packages like JAI because the javadoc will be built
	 by Ant for those packages. Instead in those cases the source
	 files must be listed explicitly below. -->
    <javadoc sourcepath="${src}"
	     access="${docaccess}"
	     packagenames="com.sun.media.imageio.*,
                           com.sun.media.jai.operator.*"
	     maxmemory="128m"
             destdir="${docbuilddir}"
             windowtitle="Java Advanced Imaging Image I/O Tools ${version}"
             overview="${src}/overview.html">
      <link offline="true"
	    href="${docurlj2se}"
	    packagelistLoc="${packageListJ2SE}"/>
      <link offline="true"
	    href="${docurljai}"
	    packagelistLoc="${packageListJAI}"/>
    </javadoc>
  </target>

  <target name="docs-jcp"
	  description="Builds javadoc with JCP (protected) access.">
    <antcall target="builddoc">
      <param name="docaccess" value="protected"/>
      <param name="docsubdir" value="docs-jcp"/>
    </antcall>
  </target>

  <target name="docs-private"
	  description="Builds javadoc with private access.">
    <antcall target="builddoc">
      <param name="docaccess" value="private"/>
      <param name="docsubdir" value="docs-private"/>
    </antcall>
  </target>

  <target name="docs-public"
	  description="Builds javadoc with public access.">
    <antcall target="builddoc">
      <param name="docaccess" value="public"/>
      <param name="docsubdir" value="docs-public"/>
    </antcall>
  </target>

  <target name="docs" depends="docs-jcp,docs-private,docs-public"
	  description="Builds javadoc for all access types."/>

  <target name="dist" depends="release,docs-jcp"
	  description="Creates the lib and javadoc distribution zip files.">
    <property name="distdir" value="${dist}/${platform}"/>

    <mkdir dir="${distdir}/javadocs"/>
    
    <!-- Create a Zip doc bundle -->
    <zip destfile="${distdir}/javadocs/jai-imageio-${doc_file}${buildtime}.zip"
	 basedir="${build}/${platform}/javadocs/docs-jcp"
	 includes="**"
	 filesonly="true"/>
  </target>

  <target name="release" depends="init,jar-debug"
	  description="Package distribution for release">
    <property name="distdir" value="${dist}/${platform}"/>

    <mkdir dir="${distdir}"/>
    <mkdir dir="${distdir}/lib"/>
    
    <!-- Create the lib Zip archive -->
    <zip destfile="${distdir}/lib/jai-imageio-${version_file}-${platform}${buildtime}.zip"
	 filesonly="true">
      <fileset file="${build}/${platform}/debug/COPYRIGHT.txt"/>
      <fileset file="${build}/${platform}/debug/LICENSE.txt"/>
      <fileset file="${build}/${platform}/debug/LICENSE-codecLibJIIO.txt"/>
      <fileset dir="${build}/${platform}/debug"
	       includes="lib/**,bin/**"/>
    </zip>
  </target>

  <target name="all" depends="jar-opt,dist"
	  description="Executes targets jar-opt and dist."/>

  <target name="clean" depends="init"
	  description="Deletes entities created by all targets on current platform.">
    <delete dir="${build}/${platform}"/>
    <delete dir="${dist}/${platform}"/>
  </target>

  <target name="clean-all"
	  description="Deletes entities created by all targets on all platforms.">
    <delete dir="${build}"/>
    <delete dir="${dist}"/>
  </target>

  <target name="clean-dist"
	  description="Deletes distribution subdirectory.">
    <delete dir="${dist}"/>
  </target>
</project>
