1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926
|
<!--
$RCSfile: build.xml,v $
Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
$Revision: 1.10 $
$Date: 2007-08-27 21:31:23 $
$State: Exp $
-->
<project name="jai" default="jar" basedir=".">
<description>
This project builds Java Advanced Imaging.
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 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-{version}-pre-dr-bNN-{os}-{arch}-DD_MMM_YYYY.zip
Stable builds are named as
jai-{version}-dr-bNN-{os}-{arch}.zip
Beta builds are named as either
jai-{version}-betaN-{os}-{arch}-.zip
or
jai-{version}-rcN-{os}-{arch}-.zip
FCS builds are simply
jai-{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 "MLIB_DIR" property may be used via the ant "-D" command line
option to specify the directory containing mlibwrapper_jai.jar;
the default value is src/share/mediaLib.
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="packageListLoc" value="build-tools"/>
<property name="docurl" value="http://java.sun.com/j2se/1.4.2/docs/api"/>
<!-- Other global properties -->
<property name="src" value="src/share/classes"/>
<property name="build" value="build"/>
<property name="dist" value="dist"/>
<property name="textdir" value="."/>
<property name="docname" value="jai-${verspecfile}-doc"/>
<!-- 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="mlibarch" 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="mlibarch" 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="mlibarch" 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="mlibarch" 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="mlibarch" 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="mlibarch" 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="mlibarch" 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="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="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="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="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 "mlib" property to "MLIB_DIR" environment variable. -->
<target name="mlib-env" if="MLIB_DIR">
<property name="mlib" value="${MLIB_DIR}"/>
</target>
<!-- Sets "mlib" property to default value. -->
<target name="mlib-def" unless="MLIB_DIR">
<property name="mlib" value="src/share/mediaLib"/>
</target>
<!-- Sets "mlib" property. -->
<target name="mlib-property" depends="mlib-env,mlib-def"/>
<!-- Sets the platform-dependent properties, the "mlib" property,
and the time stamps. -->
<target name="init" depends="setupPlatform,mlib-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,mlib-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="mlibarch = ${mlibarch}"/>
<echo message="jrenativesubdir = ${jrenativesubdir}"/>
<echo message=""/>
<echo message="verspec = ${verspec}"/>
<echo message="verspecfile = ${verspecfile}"/>
<echo message=""/>
<echo message="src = ${src}"/>
<echo message="mlib = ${mlib}"/>
<echo message="textdir = ${textdir}"/>
<echo message="packageListLoc = ${packageListLoc}"/>
<echo message="docurl = ${docurl}"/>
<echo message="build = ${build}"/>
<echo message="dist = ${dist}"/>
<echo message="docname = ${docname}"/>
<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}"/>
</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>
<!-- Determines whether the codec-util target needs to run. -->
<target name="check-codec-util" depends="init" unless="codec_util_built">
<property name="core" value="${src}/javax/media/jai"/>
<property name="core_util" value="${src}/com/sun/media/jai/util"/>
<property name="codec_util"
value="${src}/com/sun/media/jai/codecimpl/util"/>
<condition property="build_codec_util">
<or>
<not>
<available file="${codec_util}"/>
</not>
<uptodate srcfile="${codec_util}/com.sun.media.jai.codecimpl.util.properties"
targetfile="${core}/javax.media.jai.properties"/>
<uptodate srcfile="${codec_util}/com.sun.media.jai.codecimpl.util.properties"
targetfile="${core_util}/com.sun.media.jai.util.properties"/>
<uptodate srcfile="${codec_util}/ComponentSampleModelJAI.java"
targetfile="${core}/ComponentSampleModelJAI.java"/>
<uptodate srcfile="${codec_util}/DataBufferDouble.java"
targetfile="${core}/DataBufferDouble.java"/>
<uptodate srcfile="${codec_util}/DataBufferFloat.java"
targetfile="${core}/DataBufferFloat.java"/>
<uptodate srcfile="${codec_util}/FloatDoubleColorModel.java"
targetfile="${core}/FloatDoubleColorModel.java"/>
<uptodate srcfile="${codec_util}/JaiI18N.java"
targetfile="${core}/JaiI18N.java"/>
<uptodate srcfile="${codec_util}/RasterFactory.java"
targetfile="${core}/RasterFactory.java"/>
<uptodate srcfile="${codec_util}/ImagingException.java"
targetfile="${core}/util/ImagingException.java"/>
<uptodate srcfile="${codec_util}/DataBufferUtils.java"
targetfile="${core_util}/DataBufferUtils.java"/>
<uptodate srcfile="${codec_util}/PropertyUtil.java"
targetfile="${core_util}/PropertyUtil.java"/>
</or>
</condition>
</target>
<!-- Creates some source files from jai-core so that
jai_codec.jar is independent of jai_core.jar. -->
<target name="codec-util" depends="check-codec-util"
if="build_codec_util" unless="codec_util_built">
<!-- Create the codec util directory -->
<delete dir="${codec_util}"/>
<mkdir dir="${codec_util}"/>
<!-- Properties file -->
<concat destfile="${codec_util}/com.sun.media.jai.codecimpl.util.properties">
<fileset dir="${core}"
includes="javax.media.jai.properties"/>
<fileset dir="${core_util}"
includes="com.sun.media.jai.util.properties"/>
</concat>
<!-- Copy core classes to codec utils -->
<copy todir="${codec_util}">
<fileset dir="${core}"
includes="ComponentSampleModelJAI.java,
DataBufferDouble.java,
DataBufferFloat.java,
FloatDoubleColorModel.java,
JaiI18N.java,
RasterFactory.java"
/>
</copy>
<copy todir="${codec_util}" file="${core}/util/ImagingException.java"/>
<!-- Replace core strings in codec utils -->
<replaceregexp file="${codec_util}/JaiI18N.java"
byline="true"
match="util\.PropertyUtil"
replace="codecimpl.util.PropertyUtil"/>
<replaceregexp file="${codec_util}/JaiI18N.java"
byline="true"
match="javax.media.jai"
replace="com.sun.media.jai.codecimpl.util"/>
<replaceregexp file="${codec_util}/ImagingException.java"
byline="true"
match="javax.media.jai.util"
replace="com.sun.media.jai.codecimpl.util"/>
<replaceregexp byline="true"
match="javax\.media\.jai"
replace="com.sun.media.jai.codecimpl.util">
<fileset dir="${codec_util}"
includes="ComponentSampleModelJAI.java,
DataBufferDouble.java,
DataBufferFloat.java,
FloatDoubleColorModel.java,
RasterFactory.java"
/>
</replaceregexp>
<replaceregexp byline="true"
match="import\ com\.sun\.media\.jai\.util\.DataBufferUtils\;"
replace="">
<fileset dir="${codec_util}"
includes="ComponentSampleModelJAI.java,
DataBufferDouble.java,
DataBufferFloat.java,
FloatDoubleColorModel.java,
RasterFactory.java"
/>
</replaceregexp>
<!-- Copy core util classes to codec utils -->
<copy todir="${codec_util}">
<fileset dir="${core_util}"
includes="DataBufferUtils.java,
PropertyUtil.java"
/>
</copy>
<!-- Modify some strings to be appropriate for the codec util package -->
<replaceregexp file="${codec_util}/PropertyUtil.java"
byline="true"
match="javax\/media\/jai"
replace="com\/sun\/media\/jai\/codec"/>
<replaceregexp file="${codec_util}/PropertyUtil.java"
byline="true"
match="javax\.media\.jai"
replace="com.sun.media.jai.codecimpl.util"/>
<replaceregexp byline="true"
match="com\.sun\.media\.jai\.util"
replace="com\.sun\.media\.jai\.codecimpl\.util">
<fileset dir="${codec_util}"
includes="DataBufferUtils.java,
PropertyUtil.java"
/>
</replaceregexp>
<!-- Set property so target doesn't execuate again within this ant run. -->
<property name="codec_util_built" value="true"/>
</target>
<!-- Copies mediaLib debug mode files. -->
<target name="mlib-debug">
<antcall target="debugcall">
<param name="targetname" value="mlib"/>
</antcall>
</target>
<!-- Copies mediaLib non-debug mode files. -->
<target name="mlib-opt">
<antcall target="optcall">
<param name="targetname" value="mlib"/>
</antcall>
</target>
<!-- Copies mediaLib files. -->
<target name="mlib">
<!-- Copy the mediaLib jar file -->
<copy file="${mlib}/mlibwrapper_jai.jar" todir="${jardir}"/>
<!-- Copy the mediaLib native libraries -->
<copy todir="${libdir}">
<fileset dir="${mlib}/${mlibarch}"
includes="**"
excludes="cpu,cpu/**"/> <!-- Exclude old "cpu" subdir -->
</copy>
</target>
<target name="compilation" depends="codec-util">
<!-- Create the class file directory -->
<mkdir dir="${classdir}"/>
<!-- Copy the text files -->
<copy todir="${builddir}">
<fileset dir="${textdir}"
includes="COPYRIGHT.txt,
LICENSE.txt,
LICENSE-JRL.txt,
LICENSE-JDL.txt,
LICENSE-mediaLibJAI.txt"/>
</copy>
<!-- Create the buildVersion file in build directory? -->
<echo message="${timestamp}" file="${builddir}/buildVersion"/>
<!-- Compile the java code from ${src} into ${classdir} -->
<javac sourcepath="" srcdir="${src}"
destdir="${classdir}"
classpath="${mlib}/mlibwrapper_jai.jar"
debug="${debugsetting}"
debuglevel="lines,source"
deprecation="on"
source="1.3"
target="1.3">
<exclude name="**/com/sun/media/jai/test/*.java"/>
</javac>
<!-- Generate RMIImageImpl stub -->
<rmic base="${classdir}"
classname="com.sun.media.jai.rmi.RMIImageImpl"
classpath="${classdir}"/>
<!-- Generate JAIRMIImageServer stub -->
<rmic base="${classdir}"
classname="com.sun.media.jai.rmi.JAIRMIImageServer"
classpath="${classdir}"/>
</target>
<target name="compile-debug" depends="codec-util,mlib-debug"
description="Builds all classes with debug compilation.">
<antcall target="debugcall">
<param name="targetname" value="compilation"/>
</antcall>
</target>
<target name="compile-opt" depends="codec-util,mlib-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."/>
<!-- Creates core manifest file. -->
<target name="manifest-core">
<!-- Create the core Manifest file -->
<manifest file="${builddir}/Manifest-core">
<attribute name="Specification-Title"
value="Java Advanced Imaging"/>
<attribute name="Specification-Version"
value="${verspec}"/>
<attribute name="Specification-Vendor"
value="Sun Microsystems, Inc."/>
<attribute name="Implementation-Title"
value="javax.media.jai"/>
<attribute name="Implementation-Version"
value="${version}"/>
<attribute name="Implementation-Vendor"
value="Sun Microsystems, Inc."/>
<attribute name="Extension-Name"
value="javax.media.jai"/>
<attribute name="Sealed" value="true"/>
</manifest>
</target>
<!-- Create jai_core.jar. -->
<target name="jar-core" depends="compile,manifest-core">
<property name="javax" value="${src}/javax/media/jai"/>
<property name="com" value="${src}/com/sun/media/jai"/>
<property name="codec" value="${src}/com/sun/media/jai/codec"/>
<property name="codecimpl" value="${src}/com/sun/media/jai/codecimpl"/>
<!-- Copy the buildVersion file -->
<copy todir="${classdir}/javax/media/jai"
file="${builddir}/buildVersion"/>
<!-- Copy the registry file -->
<copy tofile="${builddir}/javax.media.jai.registryFile.jai"
file="${javax}/registryFile.jai"/>
<!-- Copy the core I18N message files -->
<copy todir="${classdir}/javax/media/jai" flatten="true">
<fileset dir="${javax}">
<include name="**/*.properties"/>
</fileset>
<fileset dir="${com}">
<include name="**/*.properties"/>
<exclude name="**/codec/**/*.properties"/>
<exclude name="**/codecimpl/**/*.properties"/>
</fileset>
</copy>
<!-- Create jai_core.jar -->
<jar jarfile="${jardir}/jai_core.jar"
manifest="${builddir}/Manifest-core" update="yes" filesonly="true">
<fileset dir="${classdir}">
<exclude name="**/codec/**"/>
<exclude name="**/codecimpl/**"/>
</fileset>
<metainf dir="${builddir}" prefix="META-INF"
includes="javax.media.jai.registryFile.jai"/>
</jar>
</target>
<!-- Creates the codec manifest file. -->
<target name="manifest-codec">
<!-- Create the codec Manifest file -->
<manifest file="${builddir}/Manifest-codec">
<attribute name="Specification-Title"
value="Java Advanced Imaging Codecs"/>
<attribute name="Specification-Version"
value="${verspec}"/>
<attribute name="Specification-Vendor"
value="Sun Microsystems, Inc."/>
<attribute name="Implementation-Title"
value="com.sun.media.jai.codec"/>
<attribute name="Implementation-Version"
value="${version}"/>
<attribute name="Implementation-Vendor"
value="Sun Microsystems, Inc."/>
<attribute name="Extension-Name"
value="com.sun.media.jai.codec"/>
<attribute name="Sealed" value="true"/>
</manifest>
</target>
<!-- Create jai_codec.jar. -->
<target name="jar-codec" depends="compile,manifest-codec">
<property name="codec" value="${src}/com/sun/media/jai/codec"/>
<property name="codecimpl" value="${src}/com/sun/media/jai/codecimpl"/>
<!-- Copy the buildVersion file -->
<copy todir="${classdir}/com/sun/media/jai/codec"
file="${builddir}/buildVersion"/>
<!-- Copy the codec I18N message files -->
<copy todir="${classdir}/com/sun/media/jai/codec" flatten="true">
<fileset dir="${codec}">
<include name="**/*.properties"/>
</fileset>
<fileset dir="${codecimpl}">
<include name="**/*.properties"/>
</fileset>
</copy>
<!-- Create lib directory -->
<mkdir dir="${jardir}"/>
<!-- Create jai_codec.jar -->
<jar jarfile="${jardir}/jai_codec.jar"
manifest="${builddir}/Manifest-codec" update="yes" filesonly="true">
<fileset dir="${classdir}">
<include name="**/codec/**"/>
<include name="**/codecimpl/**"/>
</fileset>
</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-codec"/>
</antcall>
<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-codec"/>
</antcall>
<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-jaispec.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 explicitely below. -->
<javadoc sourcepath="${src}"
access="${docaccess}"
packagenames="javax.media.jai.*,
com.sun.media.jai.codec,
com.sun.media.jai.remote,
com.sun.media.jai.widget"
maxmemory="128m"
destdir="${docbuilddir}"
windowtitle="Java Advanced Imaging ${version}">
<link offline="true"
href="${docurl}"
packagelistLoc="${packageListLoc}"/>
<!-- NOTE: An extra "linkoffline" might be needed if JAI is added
or the package-list file will need to be amended. -->
<!-- http://java.sun.com/j2se/1.4.2/docs/api/package-list -->
</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/${docname}-${platform}-${btime}.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-${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-JRL.txt"/>
<fileset file="${build}/${platform}/debug/LICENSE-JDL.txt"/>
<fileset file="${build}/${platform}/debug/LICENSE-mediaLibJAI.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 the ${build} and ${dist} directory trees
and the "codec-util" source files. -->
<delete dir="${build}/${platform}"/>
<delete dir="${dist}/${platform}"/>
<delete dir="${src}/com/sun/media/jai/codecimpl/util"/>
</target>
<target name="clean-all"
description="Deletes entities created by all targets on all platforms.">
<!-- Delete the ${build} and ${dist} directory trees
and the "codec-util" source files. -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
<delete dir="${src}/com/sun/media/jai/codecimpl/util"/>
</target>
<target name="clean-dist"
description="Deletes distribution subdirectory.">
<!-- Delete the ${build} and ${dist} directory trees
and the "codec-util" source files. -->
<delete dir="${dist}"/>
</target>
</project>
|