1 <?xml version="1.0" encoding="UTF-8"?>
   2 <!--
   3 Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
   4 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5 
   6 This code is free software; you can redistribute it and/or modify it
   7 under the terms of the GNU General Public License version 2 only, as
   8 published by the Free Software Foundation. Oracle designates this
   9 particular file as subject to the "Classpath" exception as provided
  10 by Oracle in the LICENSE file that accompanied this code.
  11 
  12 This code is distributed in the hope that it will be useful, but WITHOUT
  13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  15 version 2 for more details (a copy is included in the LICENSE file that
  16 accompanied this code).
  17 
  18 You should have received a copy of the GNU General Public License version
  19 2 along with this work; if not, write to the Free Software Foundation,
  20 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  21 
  22 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  23 or visit www.oracle.com if you need additional information or have any
  24 questions.
  25 -->
  26 <project name="JemmyFX" default="default" basedir=".">
  27     <description>Builds, tests, and runs the project JemmyJC.</description>
  28     <import file="nbproject/build-impl.xml"/>
  29 
  30     <property name="jemmy.lib.dir" location="../jemmy_core"/>
  31     <property name="test.includes" value="**/*Sample.java"/>
  32     <property name="javac.includes" value="${test.includes}"/>
  33     <property name="docks.dir" location="docks"/>
  34     <target name="jar-full" depends="jar">
  35         <property name="jar.name" location="${basedir}/dist/JemmyJCFull.jar"/>
  36         <jar destfile="${jar.name}" filesetmanifest="merge">
  37             <zipgroupfileset file="${reference.JemmyCore.jar}"/>
  38             <zipgroupfileset file="${reference.JemmyAWTInput.jar}"/>
  39             <zipgroupfileset file="${reference.GlassImage.jar}"/>
  40             <zipgroupfileset file="${reference.GlassRobot.jar}"/>
  41             <zipgroupfileset file="${dist.jar}"/>
  42         </jar>
  43     </target>
  44     <target name="yes-profile" if="jemmy.fx.profile">
  45         <property file="${jemmy.fx.profile}"/>
  46     </target>
  47     <target name="no-profile" unless="jemmy.fx.profile">
  48         <property name="profile.includes" value="**"/>
  49         <property name="profile.excludes" value=""/>
  50     </target>
  51     <target name="read-profile" depends="no-profile,yes-profile"/>
  52     <target name="disable-libs">
  53         <property name="no.need.to.find.java.fx" value="yes"/>
  54         <property name="no.need.to.copy.jemmy.libs" value="yes"/>
  55     </target>
  56     <target name="-post-clean">
  57         <delete dir="${docks.dir}" failonerror="false"/>
  58         <delete dir="${basedir}/target"/>
  59     </target>
  60     <target name="-pre-init" unless="no.need.to.find.java.fx">
  61         <ant antfile="../../../detect_javafx-nb.xml" inheritall="true">
  62             <property name="basedir" location="${basedir}/../../.."/>
  63             <property name="property.file" value="${basedir}/nbproject/private/private.properties"/>
  64         </ant>
  65     </target>
  66     <target name="-post-init">
  67         <ant antfile="build.xml" target="get-jemmy-core" inheritall="false" inheritrefs="false" dir=".."/>
  68     </target>
  69     <target name="-pre-compile">
  70         <delete file="${basedir}/build/classes/org/jemmy/fx/jemmy.properties" failonerror="false"/>
  71         <mkdir dir="${docks.dir}"/>
  72     </target>
  73     <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend, read-profile" if="have.sources" name="-do-compile">
  74         <echo message="Compiling  ${profile.includes} but not ${profile.excludes}"/>
  75         <mkdir dir="${src.docks.dir}"/>
  76         <condition property="__addExports1" value="" else="--add-exports javafx.graphics/com.sun.javafx.tk=ALL-UNNAMED --add-exports javafx.controls/com.sun.javafx.scene.control.skin=ALL-UNNAMED">
  77             <isset property="noAddExports" />
  78         </condition>
  79         <javac sourcepath="" srcdir="${src.dir}" destdir="${build.classes.dir}" classpath="${javac.classpath}" includes="${profile.includes}" excludes="${profile.excludes}">
  80             <compilerarg value="-processor"/>
  81             <compilerarg value="org.jemmy.support.Proccessor"/>
  82             <compilerarg value="-Aactions=docks,dump"/>
  83             <compilerarg value="-s"/>
  84             <compilerarg value="${basedir}/${src.docks.dir}"/>
  85             <compilerarg line="${__addExports1}"/>
  86         </javac>
  87         <copy todir="${build.classes.dir}">
  88             <fileset dir="${src.docks.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  89             <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  90         </copy>
  91     </target>
  92     <target name="-post-compile">
  93         <javac srcdir="${docks.dir}" destdir="${build.classes.dir}" classpath="${javac.classpath}"/>
  94         <echo message="Copying prop file"/>
  95         <copy file="src/org/jemmy/fx/jemmy.properties" tofile="${basedir}/build/classes/org/jemmy/fx/jemmy.properties"/>
  96         <tstamp/>
  97         <echo message="build=${DSTAMP}${TSTAMP}" file="${basedir}/build/classes/org/jemmy/fx/jemmy.properties" append="true"/>
  98     </target>
  99     <target depends="test-single" name="test"/>
 100     <target name="warn-no-core-sources" unless="jemmy.core.source">
 101         <echo>
 102 No Jemmy core sources!
 103 Sources are available from jemmy.java.net.
 104 Specify the location by jemmy.core.source variable.
 105         </echo>
 106     </target>
 107     <target name="inform-core-sources" if="jemmy.core.source">
 108         <echo>
 109 Taking JemmyCore sources from ${jemmy.core.source}/core/JemmyCore.
 110         </echo>
 111     </target>
 112     <target name="maven" depends="jar">
 113         <ant antfile="build.xml" dir="${project.GlassRobot}" target="maven"/>
 114         <property file="${project.GlassRobot}/src/org/jemmy/input/glass/jemmy.properties" prefix="robot"/>
 115         <ant antfile="build.xml" dir="${project.GlassImage}" target="maven"/>
 116         <property file="${project.GlassImage}/src/org/jemmy/image/jemmy.properties" prefix="image"/>
 117         <property file="${basedir}/src/org/jemmy/fx/jemmy.properties" prefix="fx"/>
 118         <copy file="pom-tmpl.xml" tofile="pom.xml" overwrite="true">
 119             <filterchain>
 120                 <replacetokens>
 121                     <token key="GlassRobot.version" value="${robot.javafx.version}.${robot.version.minor}.${robot.version.mini}"/>
 122                     <token key="GlassImage.version" value="${image.javafx.version}.${image.version.minor}.${image.version.mini}"/>
 123                     <token key="JemmyFX.version" value="${fx.javafx.version}.${fx.version.minor}.${fx.version.mini}"/>
 124                 </replacetokens>
 125             </filterchain>
 126         </copy>
 127         <exec command="mvn">
 128             <arg value="-e"/>
 129             <arg value="install"/>
 130         </exec>
 131     </target>
 132     <target name="javadoc" depends="init, compile, -post-compile, warn-no-core-sources, inform-core-sources">
 133         <echo message="${jemmy.core.source}"/>
 134         <path id="javadoc.source.path.ref">
 135             <pathelement path="${src.dir}"/>
 136             <pathelement path="${docks.dir}"/>
 137             <pathelement path="${jemmy.core.source}/core/JemmyCore/src"/>
 138         </path>
 139         <property name="javadoc.src.path" refid="javadoc.source.path.ref"/>
 140         <property name="javadoc.classpath" value="${javac.classpath}"/>
 141         <javadoc charset="UTF-8" destdir="${dist.javadoc.dir}" access="public">
 142             <classpath>
 143                 <path path="${javadoc.classpath}"/>
 144             </classpath>
 145             <sourcepath>
 146                 <path path="${javadoc.src.path}"/>
 147             </sourcepath>
 148         </javadoc>
 149         <copydir src="${test.samples.dir}" dest="${dist.javadoc.dir}"/>
 150         <zip basedir="${dist.javadoc.dir}" file="${dist.dir}/JemmyFX.zip"/>
 151     </target>
 152 </project>