view build-src/build-sdk-rt.xml @ 4:5a537ec76c6e

RT-18421: Build files in openjfx/2.1/master have the wrong copyright Reviewed by: jgiles
author kcr
date Fri, 13 Jan 2012 15:52:47 -0800
parents 8d968b638b49
children
line wrap: on
line source
<?xml version="1.0" encoding="UTF-8"?>
<project name="build-sdk-rt" basedir=".">

<!--
/*
 * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Oracle designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Oracle in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */
-->

    <description>

        Defines targets to build a runtime for the SDK. The runtime combines
        various runtime and SDK jars into a single jar and copies all native
        libraries to a single location for ease of use in IDEs.

        *** Sub-repositories should NOT import this file. ***

        This file is imported by the build.xml file only.

    </description>

    <fileset dir="${jfx.sdk.lib.dir}" id="jfxrt.jars.id">
        <include name="**/*.jar"/>
        <exclude name="**/shared/*.jar"/>
        <exclude name="**/${jfx.sdk.dev.jar.name}"/>
    </fileset>

    <fileset dir="${jfx.sdk.lib.dir}" id="jfxrt.properties.id">
        <include name="**/*.properties"/>
    </fileset>

    <fileset dir="${jfx.sdk.lib.dir}" id="jfxrt.nativelibs.id">
        <include name="**/*.dll"/>
        <include name="**/*.jnilib"/>
        <include name="**/*.dylib"/>
        <include name="**/*.so"/>
        <include name="**/*.txt"/>
    </fileset>

    <condition property="is.jfxrt.respin.needed">
        <or>
            <!-- Always rebuild jfxrt for now, since the date check is
                 incomplete and will cause sdk/rt to fail to be updated -->
            <istrue value="true"/>
            <not>
                <available file="${jfx.sdk.rt.jar}"/>
            </not>
            <not>
                <uptodate targetfile="${jfx.sdk.rt.jar}">
                    <srcfiles refid="jfxrt.jars.id"/>
                </uptodate>
            </not>
            <not>
                <uptodate targetfile="${jfx.sdk.rt.jar}">
                    <srcfiles refid="jfxrt.properties.id"/>
                </uptodate>
            </not>
            <not>
                <uptodate targetfile="${jfx.sdk.rt.jar}">
                    <srcfiles refid="jfxrt.nativelibs.id"/>
                </uptodate>
            </not>
        </or>
    </condition>

    <target name="sdk-rt" if="is.jfxrt.respin.needed">
    	<!-- fail fast on Windows if some process has the jar or one of the DLLs open -->
        <delete dir="${jfx.sdk.rt.dir}"/>
        <mkdir dir="${jfx.sdk.rt.lib.dir}"/>
        <mkdir dir="${jfx.sdk.rt.bin.dir}"/>

        <jar destfile="${jfx.sdk.rt.jar}" duplicate="preserve" compress="false" index="true">
            <zipgroupfileset refid="jfxrt.jars.id"/>
            <fileset refid="jfxrt.properties.id"/>
        </jar>

        <copy todir="${jfx.sdk.rt.bin.dir}" flatten="true">
            <fileset refid="jfxrt.nativelibs.id"/>
        </copy>
    </target>

    <target name="sdk-rt-clean">
        <delete dir="${jfx.sdk.rt.dir}"/>
    </target>

    <target name="sdk-dev">
        <pathconvert property="jfx.sdk.dev.jar.contents" refid="jfxrt.jars.id" pathsep=" " dirsep="/">
            <!-- remove directory from each entry in fileset -->
            <regexpmapper from=".*[/\\](.*\.jar)" to="\1"/>
        </pathconvert>
        <jar destfile="${jfx.sdk.dev.jar}" compress="false">
                <manifest>
                        <attribute name="Class-Path" value="${jfx.sdk.dev.jar.contents}"/>
                </manifest>
        </jar>
    </target>

    <target name="sdk-dev-clean">
        <delete file="${jfx.sdk.dev.jar}"/>
    </target>

</project>