view build-defs.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-defs" 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 common properties and macros for JavaFX project.

        Sub-repositories should import this file into their build.xml file.

        This file will import all other necessary top repository build-*.xml files.
    
    </description>
   
    <!-- This file determines root of the source tree for project -->
    
    <dirname property="jfx.root.dir" file="${ant.file.build-defs}"/>
    <property name="jfx.root.build.src.dir" location="${jfx.root.dir}/build-src"/>

    <!-- Include any hg properties in case this is a source bundle build. -->

    <property file="${jfx.root.dir}/hg.properties"/>

    <!-- Get platform, or, and arch properties and targets -->
    
    <import file="${jfx.root.build.src.dir}/build-os-arch.xml"/>

    <!-- Default property values -->
    
    <property file="${jfx.root.dir}/project.properties"/>

    <!-- Local overrides -->
    
    <property file="${jfx.root.dir}/project.local.properties"/>

    <!-- Get properties defined from the environment -->

    <import file="${jfx.root.build.src.dir}/build-environment.xml"/>

    <!-- Get importer properties and targets -->

    <import file="${jfx.root.build.src.dir}/build-importer.xml"/>

    <!-- Get jars -->

    <import file="${jfx.root.build.src.dir}/build-jar-importer.xml"/>
  
    <!-- Get platform properties and targets -->
    
    <import file="${jfx.root.build.src.dir}/build-${os_name}-defs.xml"/>

    <!-- Macrodefs for generic things to be shared by everyone -->
    
    <!-- JAVAC -->
    <macrodef name="do-javac">
        <attribute name="srcdir"/>
        <attribute name="destdir" default="${build.classes.dir}"/>
        <attribute name="classpath" default="${javac.src.classpath}"/>
        <attribute name="includes" default=""/>
        <attribute name="excludes" default=""/>
        <sequential>
            <mkdir dir="@{destdir}"/>
            <echo level="debug">DO_JAVAC</echo>
            <echo level="debug">  srcdir="@{srcdir}"</echo>
            <echo level="debug">  destdir="@{destdir}"</echo>
            <echo level="debug">  debug="${javac.debug}"</echo>
            <echo level="debug">  deprecation="${javac.deprecation}"</echo>
            <echo level="debug">  source="${javac.source}"</echo>
            <echo level="debug">  target="${javac.target}"</echo>
            <echo level="debug">  includes="@{includes}"</echo>
            <echo level="debug">  excludes="@{excludes}"</echo>
            <echo level="debug">  classpath="@{classpath}"</echo>
            <javac srcdir="@{srcdir}" destdir="@{destdir}"
                   debug="${javac.debug}" deprecation="${javac.deprecation}"
                   source="${javac.source}" target="${javac.target}"
                   includeantruntime="false" includes="@{includes}"
                   excludes="@{excludes}">
                <classpath>
                    <path path="@{classpath}"/>
                </classpath>
                <compilerarg line="${javac.compilerargs}"/>
            </javac>
        </sequential>
    </macrodef>
    
    <!-- JAVA -->
    <presetdef name="do-java.preset">
        <java fork="true" dir="${run.dir}">
            <jvmarg value="-showversion"/>
            <jvmarg line="${run.jvmargs}"/>
            <classpath>
                <path path="${run.classpath}"/>
            </classpath>
        </java>
    </presetdef>
    
    <macrodef name="do-java">
        <attribute name="classname" default="${run.main.class}"/>
        <sequential>
            <echo>jvmarg line="${run.jvmargs}"</echo>
            <echo level="debug">DO_JAVA</echo>
            <echo level="debug">  classname="@{classname}"</echo>
            <do-java.preset classname="@{classname}"/>
        </sequential>
    </macrodef>
    
    <macrodef name="do-java-debug">
        <attribute name="classname" default="${run.main.class}"/>
        <sequential>
            <echo>jvmarg line="${run.jvmargs}"</echo>
            <echo level="debug">DO_JAVA-DEBUG</echo>
            <echo level="debug">  classname="@{classname}"</echo>
            <nbjpdastart addressproperty="jpda.address" name="JMC" transport="dt_socket">
                <classpath path="${run.classpath}"/>
            </nbjpdastart>
            <do-java.preset classname="@{classname}">
                <jvmarg value="-Xdebug"/>
                <jvmarg value="-Xnoagent"/>
                <jvmarg value="-Djava.compiler=none"/>
                <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
            </do-java.preset>
        </sequential>
    </macrodef>
    
    <macrodef name="do-java-test">
        <attribute name="classname"/>
        <sequential>
            <echo level="debug">DO_JAVA_TEST</echo>
            <echo level="debug">  classname="@{classname}"</echo>
            <do-java.preset classname="@{classname}" classpath="${test.run.classpath}" dir="${test.run.dir}"/>
        </sequential>
    </macrodef>
    
    <macrodef name="print-property">
        <attribute name="property"/>
        <sequential>
            <condition property="@{property}.value"
                       value="${@{property}}" else="">
                <isset property="@{property}"/>
            </condition>
            <echo>@{property} = ${@{property}.value}</echo>
        </sequential>
    </macrodef>

    <macrodef name="do-file-check">
        <attribute name="file"/>
        <sequential>
            <fail message="ERROR: File check failed, missing: @{file}">
                <condition>
                    <not>
                        <available file="@{file}"/>
                    </not>
                </condition>
            </fail>
        </sequential>
    </macrodef>

    <macrodef name="do-class-check">
        <attribute name="classname"/>
        <attribute name="classpath"/>
        <sequential>
            <fail message="ERROR: Class check failed, missing: @{classname} in @{classpath}">
                <condition>
                    <not>
                        <available classname="@{classname}" classpath="@{classpath}"/>
                    </not>
                </condition>
            </fail>
        </sequential>
    </macrodef>

    <!-- Untar macrodef (for tar.gz files) -->

    <macrodef name="do-untar-bundle">
        <attribute name="tar"/>
        <attribute name="dir"/>
        <attribute name="includes" default="**"/>
        <sequential>
            <delete dir="@{dir}.untar"/>
            <mkdir dir="@{dir}.untar"/>
            <untar src="@{tar}"
                   dest="@{dir}.untar"
                   compression="gzip">
                <patternset includes="@{includes}"/>
            </untar>
            <mkdir dir="@{dir}"/>
            <delete dir="@{dir}"/>
            <move file="@{dir}.untar" tofile="@{dir}" verbose="true"/>
            <delete dir="@{dir}.untar"/>
        </sequential>
    </macrodef>

    <macrodef name="do-untar-bzip2-bundle">
        <attribute name="tar"/>
        <attribute name="dir"/>
        <attribute name="includes" default="**"/>
        <sequential>
            <delete dir="@{dir}.untar"/>
            <mkdir dir="@{dir}.untar"/>
            <untar src="@{tar}"
                   dest="@{dir}.untar"
                   compression="bzip2">
                <patternset includes="@{includes}"/>
            </untar>
            <mkdir dir="@{dir}"/>
            <delete dir="@{dir}"/>
            <move file="@{dir}.untar" tofile="@{dir}" verbose="true"/>
            <delete dir="@{dir}.untar"/>
        </sequential>
    </macrodef>

    <!-- Unzip macrodef -->
    
    <macrodef name="do-unzip-bundle">
        <attribute name="zip"/>
        <attribute name="dir"/>
        <attribute name="includes" default="**"/>
        <sequential>
            <delete dir="@{dir}.unzip"/>
            <mkdir dir="@{dir}.unzip"/>
            <unzip src="@{zip}" dest="@{dir}.unzip">
                <patternset includes="@{includes}"/>
            </unzip>
            <mkdir dir="@{dir}"/>
            <delete dir="@{dir}"/>
            <move file="@{dir}.unzip" tofile="@{dir}" verbose="true"/>
            <delete dir="@{dir}.unzip"/>
        </sequential>
    </macrodef>

    <!-- Get a zip from a url and unzip it. -->

    <macrodef name="do-get-previous-bundle">
        <attribute name="name"/>
        <attribute name="url"/>
        <attribute name="dir"/>
        <sequential>
            <delete file="previous_@{name}.zip"/>
            <get src="@{url}" dest="previous_@{name}.zip"/>
            <do-unzip-bundle zip="previous_@{name}.zip" dir="@{dir}"/>
            <delete file="previous_@{name}.zip"/>
        </sequential>
    </macrodef>

    <!-- Target to be used by including file. -->

    <target name="-init-defs"
            depends="-init-platform">
        <echo>Property=Value</echo>
        <echo>--------------</echo>
        <property name="isAny" value="true"/>
        <print-property property="jfx.root.dir"      />
        <print-property property="jfx.sdk.dir"       />
        <print-property property="jfx.deployed.dir"  />
        <print-property property="platform.home"     />
        <print-property property="platform6u10.home" />
        <print-property property="dxsdk.path"        />
        <print-property property="qtsdk.path"        />
        <print-property property="wmsdk.path"        />
    </target>

    <target name="-init-checkstyle">
        <!-- Define the Checkstyle properties so that the <checkstyle> tag can be used -->
        <taskdef resource="checkstyletask.properties">
            <classpath>
                <pathelement location="${import.checkstyle.jar}" />
                <pathelement location="${jfx.checkstyle.jar}" />
            </classpath>
        </taskdef>
    </target>
    
    <target name="-init-findbugs">
        <property name="findbugs.home" value="${import.findbugs.home}" />
        <path id="findbugs-jar">
            <pathelement path="${findbugs.home}/lib/findbugs-ant.jar" />
        </path>
        <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="findbugs-jar" /> 
        <taskdef name="convertXmlToText"
         classname="edu.umd.cs.findbugs.anttask.ConvertXmlToTextTask"
         classpathref="findbugs-jar"/>
    </target>

    <!-- ant-contrib -->
    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
        <classpath>
            <pathelement location="${import.ant-contrib.jar}"/>
        </classpath>
    </taskdef>

</project>