view build.xml @ 4047:937a1432ee79

Gradle build. Seriously, getting it right this time.
author Richard Bair <richard.bair@oracle.com>
date Mon, 24 Jun 2013 13:54:44 -0700
parents a51b43a5615d
children
line wrap: on
line source
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
 * Copyright (c) 2009, 2013, 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.
 */
--> 
<project name="JavaFX" default="dist" basedir=".">
    <description>Builds, tests, and runs the project JavaFX Runtime</description>

    <import file="../build-defs.xml"/>
    <property name="build.dir" value="${basedir}/build"/>

    <property name="rt.root.dir" location="${basedir}/../rt"/>

    <target name="init" depends="-init-defs,-init-platform-defs">
        <!-- ensure version 1.7.1 of ant -->
        <fail message="Ant version 1.7.1 or later is required to build JavaFX.">
            <condition><not><antversion atleast="1.7.1"/></not></condition>
        </fail>

        <property name="openjfx.dist.dir" value="dist${cross.name.suffix}"/>
        <property name="openjfx.dist.bin.dir" value="${openjfx.dist.dir}/${platform.nativelibs.dir.name}"/>
        <property name="openjfx.dist.lib.dir" value="${openjfx.dist.dir}/lib"/>

        <!-- only build decora-sse on Windows and Mac OS X -->
        <condition property="include.sse">
            <or>
                <istrue value="${isWindows}"/>
                <istrue value="${isMacOSX}"/>
            </or>
        </condition>
        
        <!-- Build decora-d3d and prism-d3d if on Windows -->
        <condition property="include.d3d">
            <istrue value="${isWindows}"/>
        </condition>

      <condition property="include.eglx11">
        <and>
          <istrue value="${cross.build.EGL.X11}"/>
        </and>
      </condition>

      <condition property="include.eglfb">
        <and>
          <istrue value="${cross.build.EGL.FB}"/>
        </and>
      </condition>

        <!-- Build prism-es2 and decora-ogl on all desktop platforms
             and on embedded platforms that have OpenGL ES -->
        <condition property="include.ogl">
          <or>
            <not>
              <isset property="cross.platform"/>
            </not>
            <or>
              <isset property="include.eglfb"/>
              <isset property="include.eglx11"/>
              <isset property="isIOS"/>
              <isset property="isAndroid"/>
            </or>
          </or>
        </condition>

        <condition property="sse.native.lib.file"
                   value="libdecora-sse.dylib"
                   else="decora-sse.dll">
            <istrue value="${isMacOSX}"/>
        </condition>

        <condition property="include.prism.sw">
          <and>
            <not>
              <isset property="isIOS"/>
            </not>
            <not>
              <isset property="isAndroid"/>
            </not>
          </and>
        </condition>
    </target>

    <!--
        Build targets...
      -->

    <target name="jar" depends="init">
        <ant antfile="${rt.root.dir}/javafx-common/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-logging/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/glass/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-beans/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-util-converter/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-anim/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-geom/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/pisces/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/decora-compiler/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/decora-runtime/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-sg-common/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-ui-common/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-concurrent/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-ui-quantum/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-sg-prism/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-embed-swing/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-ui-controls/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-ui-charts/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/decora-prism/build.xml" target="jar" inheritAll="false"/>
        <antcall target="jar-decora-d3d"/>
        <antcall target="jar-decora-es2"/>
        <ant antfile="${rt.root.dir}/decora-jsw/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/decora-prism-sw/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/decora-prism-ps/build.xml" target="jar" inheritAll="false"/>
        <antcall target="jar-decora-sse"/>
        <ant antfile="${rt.root.dir}/javafx-font/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/prism-util/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/prism-common/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/prism-j2d/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/prism-ps/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/prism-null/build.xml" target="jar" inheritAll="false"/>
        <antcall target="jar-prism-sw"/>
        <antcall target="jar-prism-d3d"/>
        <antcall target="jar-prism-es2-all"/>
        <ant antfile="${rt.root.dir}/javafx-beans-dt/build.xml" target="jar" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-fxml/build.xml" target="jar" inheritAll="false"/>
        <antcall target="jar-javafx-android"/>
        <antcall target="jar-javafx-embed-swt"/>
        <ant antfile="${rt.root.dir}/javafx-builders/build.xml" target="jar" inheritAll="false"/>
    </target>

    <target name="jar-decora-d3d" if="include.d3d">
        <ant antfile="${rt.root.dir}/decora-d3d/build.xml" target="jar" inheritAll="false"/>
    </target>

    <target name="jar-decora-es2" if="include.ogl">
        <ant antfile="${rt.root.dir}/decora-es2/build.xml" target="jar" inheritAll="false"/>
    </target>

    <target name="jar-decora-sse" if="include.sse">
        <ant antfile="${rt.root.dir}/decora-sse/build.xml" target="jar" inheritAll="false"/>
    </target>

    <target name="jar-prism-sw" if="include.prism.sw">
        <ant antfile="${rt.root.dir}/prism-sw/build.xml" target="jar" inheritAll="false"/>
    </target>

    <target name="jar-prism-d3d" if="include.d3d">
        <ant antfile="${rt.root.dir}/prism-d3d/build.xml" target="jar" inheritAll="false"/>
    </target>

    <target name="jar-prism-es2-all"
            depends="jar-prism-es2, jar-prism-es2-mac,
                     jar-prism-es2-ios, jar-prism-es2-eglx11,
                     jar-prism-es2-eglfb, jar-prism-es2-win,
                     jar-prism-es2-x11, build-prism-es2-native"/>

    <target name="jar-prism-es2" if="include.ogl">
        <ant antfile="${rt.root.dir}/prism-es2/build.xml" target="jar" inheritAll="false"/>
    </target>

    <target name="build-prism-es2-native" if="include.ogl">
      <ant antfile="${rt.root.dir}/prism-es2/build.xml" target="build-native" inheritAll="false"/>
    </target>

    <target name="jar-prism-es2-mac" if="isMacOSX">
        <ant antfile="${rt.root.dir}/prism-es2-mac/build.xml" target="jar" inheritAll="false"/>
    </target>

    <target name="jar-prism-es2-ios" if="isIOS">
        <ant antfile="${rt.root.dir}/prism-es2-ios/build.xml" target="jar" inheritAll="false"/>
    </target>

    <target name="jar-prism-es2-eglfb" if="include.eglfb">
        <ant antfile="${rt.root.dir}/prism-es2-eglfb/build.xml" target="jar" inheritAll="false"/>
    </target>

    <target name="jar-prism-es2-eglx11" if="include.eglx11">
        <ant antfile="${rt.root.dir}/prism-es2-eglx11/build.xml" target="jar" inheritAll="false"/>
    </target>

    <target name="jar-prism-es2-win" if="isWindows">
        <ant antfile="${rt.root.dir}/prism-es2-win/build.xml" target="jar" inheritAll="false"/>
    </target>

    <target name="jar-prism-es2-x11" if="isLinux">
        <ant antfile="${rt.root.dir}/prism-es2-x11/build.xml" target="jar" inheritAll="false"/>
    </target>

    <target name="jar-javafx-android" if="isAndroid">
        <ant antfile="${rt.root.dir}/javafx-android/build.xml" target="jar" inheritAll="false"/>
    </target>

    <target name="jar-javafx-embed-swt" if="swt.available">
        <ant antfile="${rt.root.dir}/javafx-embed-swt/build.xml" target="jar" inheritAll="false"/>
    </target>

    <!--
      Testing targets...
    -->

    <target name="test">
        <ant antfile="${rt.root.dir}/javafx-beans-dt/build.xml" target="test" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-concurrent/build.xml" target="test" inheritAll="false"/>
        <!--<ant antfile="${rt.root.dir}/javafx-designtime/build.xml" target="test" inheritAll="false"/>-->
        <ant antfile="${rt.root.dir}/javafx-ui-controls/build.xml" target="test" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-ui-charts/build.xml" target="test" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-anim/build.xml" target="test" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-beans/build.xml" target="test" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-common/build.xml" target="test" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-sg-common/build.xml" target="test" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-geom/build.xml" target="test" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-sg-prism/build.xml" target="test" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-ui-common/build.xml" target="test" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/prism-common/build.xml" target="test" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-util-converter/build.xml" target="test" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-fxml/build.xml" target="test" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-builders/build.xml" target="test" inheritAll="false"/>
    </target>

    <!--
        Clean-up targets...
      -->

    <target name="clean" depends="init">
        <delete dir="${build.dir}"/>
        <delete dir="dist"/>
        <ant antfile="${rt.root.dir}/glass/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-beans-dt/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-concurrent/build.xml" target="clean" inheritAll="false"/>
        <!--<ant antfile="${rt.root.dir}/javafx-designtime/build.xml" target="clean" inheritAll="false"/>-->
        <ant antfile="${rt.root.dir}/javafx-ui-controls/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-ui-charts/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-logging/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-anim/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-beans/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-common/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-sg-common/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-geom/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-sg-prism/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-ui-quantum/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-ui-common/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/pisces/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-util-converter/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-fxml/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/javafx-embed-swing/build.xml" target="clean" inheritAll="false"/>
        <antcall target="clean-decora-d3d"/>
        <antcall target="clean-decora-es2"/>
        <ant antfile="${rt.root.dir}/decora-jsw/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/decora-prism-sw/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/decora-prism-ps/build.xml" target="clean" inheritAll="false"/>
        <antcall target="clean-decora-sse"/>
        <ant antfile="${rt.root.dir}/javafx-font/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/prism-util/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/prism-common/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/prism-j2d/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/prism-ps/build.xml" target="clean" inheritAll="false"/>
        <ant antfile="${rt.root.dir}/prism-null/build.xml" target="clean" inheritAll="false"/>
        <antcall target="clean-prism-sw"/>
        <antcall target="clean-prism-d3d"/>
        <antcall target="clean-prism-es2-all"/>
        <antcall target="clean-javafx-android"/>
        <antcall target="clean-javafx-embed-swt"/>
        <ant antfile="${rt.root.dir}/javafx-builders/build.xml" target="clean" inheritAll="false"/>
    </target>

    <target name="clean-decora-d3d" if="include.d3d">
        <ant antfile="${rt.root.dir}/decora-d3d/build.xml" target="clean" inheritAll="false"/>
    </target>

    <target name="clean-decora-es2" if="include.ogl">
        <ant antfile="${rt.root.dir}/decora-es2/build.xml" target="clean" inheritAll="false"/>
    </target>

    <target name="clean-decora-sse" if="include.sse">
        <ant antfile="${rt.root.dir}/decora-sse/build.xml" target="clean" inheritAll="false"/>
    </target>

    <target name="clean-prism-sw" if="include.prism.sw">
        <ant antfile="${rt.root.dir}/prism-sw/build.xml" target="clean" inheritAll="false"/>
    </target>

    <target name="clean-prism-d3d" if="include.d3d">
        <ant antfile="${rt.root.dir}/prism-d3d/build.xml" target="clean" inheritAll="false"/>
    </target>

    <target name="clean-prism-es2-all"
            depends="clean-prism-es2, clean-prism-es2-mac,
                     clean-prism-es2-ios, clean-prism-es2-eglx11,
                     clean-prism-es2-eglfb, clean-prism-es2-win,
                     clean-prism-es2-x11"/>

    <target name="clean-prism-es2" if="include.ogl">
        <ant antfile="${rt.root.dir}/prism-es2/build.xml" target="clean" inheritAll="false"/>
    </target>

    <target name="clean-prism-es2-mac" if="isMacOSX">
        <ant antfile="${rt.root.dir}/prism-es2-mac/build.xml" target="clean" inheritAll="false"/>
    </target>

    <target name="clean-prism-es2-ios" if="isIOS">
        <ant antfile="${rt.root.dir}/prism-es2-ios/build.xml" target="clean" inheritAll="false"/>
    </target>

    <target name="clean-prism-es2-eglfb" if="include.eglfb">
        <ant antfile="${rt.root.dir}/prism-es2-eglfb/build.xml" target="clean" inheritAll="false"/>
    </target>

    <target name="clean-prism-es2-eglx11" if="include.eglx11">
        <ant antfile="${rt.root.dir}/prism-es2-eglx11/build.xml" target="clean" inheritAll="false"/>
    </target>

    <target name="clean-prism-es2-win" if="isWindows">
        <ant antfile="${rt.root.dir}/prism-es2-win/build.xml" target="clean" inheritAll="false"/>
    </target>

    <target name="clean-prism-es2-x11" if="isLinux">
        <ant antfile="${rt.root.dir}/prism-es2-x11/build.xml" target="clean" inheritAll="false"/>
    </target>

    <target name="clean-javafx-embed-swt" if="swt.available">
        <ant antfile="${rt.root.dir}/javafx-embed-swt/build.xml" target="clean" inheritAll="false"/>
    </target>
    
    <target name="clean-javafx-android" if="isAndroid">
        <ant antfile="${rt.root.dir}/javafx-android/build.xml" target="clean" inheritAll="false"/>
    </target>
 
    <!--
        Create an openjfxrt.jar file...
      -->

    <fileset id="openjfx.dist.jars" dir=".">
        <include name="glass/dist/lib/*.jar"/>
        <include name="*/dist/*.jar"/>
    </fileset>

    <fileset id="openjfx.dist.binaries" dir=".">
        <include name="glass/dist${cross.name.suffix}/bin/*"/>
    </fileset>
    
    <target name="dist" depends="jar">
        <echo>Creating merged openjfxrt.jar file</echo>
        <mkdir dir="${openjfx.dist.lib.dir}"/>
        <delete file="${openjfx.dist.lib.dir}/openjfxrt.jar"/>
        <jar destfile="${openjfx.dist.lib.dir}/openjfxrt.jar">
            <zipgroupfileset refid="openjfx.dist.jars"/>
        </jar>
        <echo>Copying binaries</echo>
        <mkdir dir="${openjfx.dist.bin.dir}"/>
        <delete file="${openjfx.dist.bin.dir}/*"/>
        <copy todir="${openjfx.dist.bin.dir}" flatten="true">
            <fileset refid="openjfx.dist.binaries"/>
        </copy>
    </target>
    
    <target name="default" depends="dist" />

</project>