view build-src/build-environment.xml @ 3:8d968b638b49

Added build scripts that are needed for building UI controls. Actually they are probably not ALL needed, but they don't hurt. We need to clean these things all up as part of the open sourcing process, since the mechanism by which we download and install the necessary libs are probably going to be different than what we have been doing up to this point.
author rbair
date Tue, 06 Dec 2011 09:28:31 -0800
parents
children 5a537ec76c6e
line wrap: on
line source
<?xml version="1.0" encoding="UTF-8"?>
<project name="build-environment" basedir=".">

<!--
/*
 * Copyright 2009 Sun Microsystems, Inc.  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.
 *
 * 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 * CA 95054 USA or visit www.sun.com if you need additional information or
 * have any questions.
 */
-->

    <description>

        Checks and prints the environment variables for JavaFX project.
        Where necessary, environment variable settings or system file
        locations may be placed into properties here.

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

        This file is imported by the build-defs.xml file.

    </description>

    <property environment="env"/>

    <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
    <!-- Checks the environment variables. -->

    <macrodef name="find-default-dir">
        <attribute name="property"/>
        <attribute name="evalue"/>
        <attribute name="dvalue"/>
        <sequential>
            <condition property="@{property}" value="@{evalue}">
                <available file="@{evalue}" type="dir"/>
            </condition>
            <condition property="@{property}" value="@{dvalue}">
                <available file="@{dvalue}" type="dir"/>
            </condition>
        </sequential>
    </macrodef>

    <macrodef name="find-default-val">
        <attribute name="property"/>
        <attribute name="var"/>
        <attribute name="dvalue"/>
        <sequential>
            <condition property="@{property}" value="${env.@{var}}" else="@{dvalue}">
                <isset property="env.@{var}"/>
            </condition>
        </sequential>
    </macrodef>

    <tstamp>
        <format property="jfx.built.today"
                pattern="yyyy/MM/dd HH:mm:ss"/>
    </tstamp>

    <find-default-dir property="dxsdk.path"
                  evalue="${env.DXSDK_DIR}"
                  dvalue="C:/DXSDK"/>
    
    <find-default-dir property="qtsdk.path"
                  evalue="${env.QTSDK_DIR}"
                  dvalue="C:/QTSDK"/>

    <find-default-dir property="wmsdk.path"
                  evalue="${env.WMSDK_DIR}"
                  dvalue="C:/WMSDK/WMFSDK95"/>

    <find-default-dir property="systemroot.path"
                  evalue="${env.SystemRoot}"
                  dvalue="C:/WINDOWS"/>

    <condition property="hudson.current.build.url"
               value="${env.HUDSON_URL}">
        <isset property="env.HUDSON_URL"/>
    </condition>

    <find-default-val property="hudson.current.job.name"
                  var="JOB_NAME"
                  dvalue="not_hudson/label=${platform}"/>

    <find-default-val property="hudson.current.build.number"
                  var="BUILD_NUMBER"
                  dvalue="0000"/>

    <find-default-val property="hudson.current.build.id"
                  var="BUILD_ID"
                  dvalue="${jfx.built.today} (non-hudson build)"/>

    <!-- The job.name looks like "somename/label=linux-i586" so extract the "somename" -->
    <dirname property="hudson.current.job.name.tmp" file="${hudson.current.job.name}"/>
    <basename property="hudson.current.job.basename" file="${hudson.current.job.name.tmp}"/>

    <find-default-val property="jfx.promoted.build.number"
                  var="NEXT_PROMOTED_BUILD_NUMBER"
                  dvalue="00"/>

    <property name="jfx.build.number"
              value="${hudson.current.build.number}"/>
    <property name="jfx.build.id"
              value="${hudson.current.build.id}"/>
    <property name="jfx.job.name"
              value="${hudson.current.job.name}"/>
    
    <property name="jfx.timestamp.product"
              value="Product: ${jfx.product.name}-${jfx.release.version}${jfx.release.milestone}"/>
    <property name="jfx.timestamp.platform"
              value="Platform: ${platform}"/>
    <property name="jfx.timestamp.build.number"
              value="Build-Number: ${jfx.build.number}"/>
    <property name="jfx.timestamp.build.id"
              value="Build-ID: ${jfx.build.id}"/>
    <property name="jfx.timestamp.string"
              value="${jfx.timestamp.product}${line.separator}${jfx.timestamp.platform}${line.separator}${jfx.timestamp.build.number}${line.separator}${jfx.timestamp.build.id}"/>

    <!-- Get the hudson properties. -->

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

    <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
    <!-- Macrodefs -->

    <!-- Print out an environment variable value -->
    <macrodef name="print-env">
        <attribute name="name"/>
        <sequential>
            <condition property="env.@{name}.value"
                       value="${env.@{name}}" 
                       else="">
                <isset property="env.@{name}"/>
            </condition>
            <echo level="info"
		  message="    @{name}=${env.@{name}.value}"/>
        </sequential>
    </macrodef>

    <target name="-check-windows" if="isWindows">
        <echo level="info"
	      message="Windows Environment Variable Settings:"/>
        <echo level="info"
	      message="--------------------------------------"/>
        <print-env name="JAVA_HOME"/>
        <print-env name="PATH"/>
        <print-env name="VS71COMNTOOLS"/>
    </target>

    <target name="-check-macosx" if="isMacOSX">
        <echo level="info"
	      message="MacOSX Environment Variable Settings:"/>
        <echo level="info"
	      message="-------------------------------------"/>
        <print-env name="JAVA_HOME"/>
        <print-env name="PATH"/>
        <print-env name="LD_LIBRARY_PATH"/>
        <print-env name="LD_LIBRARY_PATH32"/>
        <print-env name="LD_LIBRARY_PATH64"/>
    </target>

    <target name="-check-solaris" if="isSolaris">
        <echo level="info"
	      message="Solaris Environment Variable Settings:"/>
        <echo level="info"
	      message="-------------------------------------"/>
        <print-env name="JAVA_HOME"/>
        <print-env name="PATH"/>
        <print-env name="LD_LIBRARY_PATH"/>
        <print-env name="LD_LIBRARY_PATH32"/>
        <print-env name="LD_LIBRARY_PATH64"/>
    </target>

    <target name="-check-linux" if="isLinux">
        <echo level="info"
	      message="Linux Environment Variable Settings:"/>
        <echo level="info"
	      message="-----------------------------------"/>
        <print-env name="JAVA_HOME"/>
        <print-env name="PATH"/>
        <print-env name="LD_LIBRARY_PATH"/>
        <print-env name="LD_LIBRARY_PATH32"/>
        <print-env name="LD_LIBRARY_PATH64"/>
    </target>
    
    <property name="jfx.ant.version.needed" value="1.7.1"/>
    
    <target name="-check-ant">
        <fail message="You need at least ant version ${jfx.ant.version.needed}">
            <condition>
                <not>
                    <antversion atleast="${jfx.ant.version.needed}"/>
                </not>
            </condition>
        </fail>
    </target>

    <target name="check-environment"
            depends="-check-ant, 
                     -check-windows,
                     -check-macosx,
                     -check-solaris,
                     -check-linux">
    </target>

    <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

</project>