view build-src/build-perf.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="PerfTasks" basedir="."
         xmlns:fx="javafx:com.sun.javafx.tools.ant">

<!--
/*
 * Copyright (c) 2011, 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>
        Build tasks related to performance testing
    </description>
    <import file="../build-defs.xml"/>

    <taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
             uri="javafx:com.sun.javafx.tools.ant"
             classpath="${jfx.sdk.anttask.jar}"/>

    <condition property="isWindows">
        <os family="windows"/>
    </condition>

    <!-- do not support web deployment on platforms other than windows -->
    <target name="create-startup2-files" if="isWindows">
       <antcall target="-do-startup2-files"/>
    </target>

    <!-- Target to create .html & .jnlp files for apps used by startup2
         This target requires some props to be set: applet.width, applet.height,
         applet.name, applet.jar, applet.mainclass -->
    <target name="-do-startup2-files" depends="init" >
        <!-- There seems to be a problem with passing an Application reference
             between targets.  If changes are made to AppRefID, be sure to also
             mirror the changes in the rebuild-jar target. -->
        <fx:application id="AppRefID"
                        name="${applet.name}"
                        mainClass="${applet.mainclass}">
            <htmlParam name="sun_perflog_fx_launchtime" escape="false"
                       value="launchTime+''" />
        </fx:application>

        <!-- Note: this target only runs if startup.rebuildjar is set -->
        <antcall target="rebuild-jar">
                 <reference refId="AppRefID" />
        </antcall>

        <fx:deploy
            embedJNLP="true"
            includeDT="true"
            placeholderId="place"
            width="${applet.width}" height="${applet.height}"
            outdir="${basedir}/${dist.dir}"
            outfile="${applet.mainclass}">
            <info title="${applet.mainclass}" vendor="${application.vendor}"/>
            
            <template file="${jfx.root.dir}/build-src/startup2_template.html"
                    tofile="${basedir}/${dist.dir}/${applet.mainclass}.html"/>
                    
            <fx:application refId="AppRefID"/>
            <platform javafx="2.0+">
               <property name="jnlp.fx.perf" value="false"/>
            </platform>

            <fx:resources>
                <fx:fileset dir="${basedir}/${dist.dir}"
                            includes="${applet.jar}"/>
            </fx:resources>
        </fx:deploy>

        <!-- replace startup2 tags in generated .html -->
        <replace file="${basedir}/${dist.dir}/${applet.mainclass}.html"
                 token="@@MainClassName@@" value="${applet.mainclass}"/>
    </target>

    <target name="rebuild-jar" if="startup.rebuildjar" >
        <!-- fx:application copied from the create-startup2-files target.
             This can be removed if passing an application ref id via antcall
             gets fixed -->             
        <fx:application id="AppRefID"
                        name="${applet.name}"
                        mainClass="${applet.mainclass}">
            <htmlParam name="sun_perflog_fx_launchtime" escape="false" value="launchTime+''" />
        </fx:application>

        <delete file="${dist.jar}" />
        
        <fx:jar destfile="${dist.jar}">
            <fx:application refId="AppRefID"/>
            <fileset dir="${build.classes.dir}"/>
            <manifest>
              <attribute name="Implementation-Vendor" value="${application.vendor}"/>
              <attribute name="Implementation-Title" value="${application.title}"/>
              <attribute name="Implementation-Version" value="1.0"/>
            </manifest>
        </fx:jar>        
    </target>
</project>