Source

main-silver / jemmy / build.xml

Full commit
<?xml version="1.0" encoding="UTF-8"?>
<!--
                Sun Public License Notice

The contents of this file are subject to the Sun Public License
Version 1.0 (the "License"). You may not use this file except in
compliance with the License. A copy of the License is available at
http://www.sun.com/

The Original Code is NetBeans. The Initial Developer of the Original
Code is Sun Microsystems, Inc. Portions Copyright 1997-2004 Sun
Microsystems, Inc. All Rights Reserved.
-->
<project name="jemmy" default="compile" basedir=".">
  <import file="nbproject/build-impl.xml"/>
  <!-- Properties not defined in this or above scripts are set in nbproject/project.properties -->
  <!-- Package name used in targets api and test -->
  <property name="package" value="org.netbeans.jemmy"/>
  <!-- Excludes according to java.version -->
  <property name="java.version.excludes" value="util/${ant.java.version}.excludes"/>
    
  <target name="java">
    <echo message="Using ${java.vm.version} java"/>
  </target>

  <target name="timestamp" unless="buildnumber">
    <tstamp>
        <format property="buildnumber" pattern="yyyyMMdd"/>
    </tstamp>
  </target>

  <target name="compile" depends="init,java,timestamp">
    <filter token="BUILD_NUMBER" value="${buildnumber}"/>
    <mkdir dir="${build.classes.dir}"/>
    <javac srcdir="${src.dir}" destdir="${build.classes.dir}" excludesfile="${java.version.excludes}" debug="on" source="1.4"/>
    <copy file="${src.dir}/org/netbeans/jemmy/debug.timeouts" todir="${build.classes.dir}/org/netbeans/jemmy"/>
    <copy file="${src.dir}/org/netbeans/jemmy/version_info" tofile="${build.classes.dir}/org/netbeans/jemmy/version_info" filtering="on"/>
  </target>

  <target name="jar" depends="compile">
    <mkdir dir="${dist.dir}"/>
    <jar jarfile="${dist.jar}" basedir="${build.classes.dir}" manifest="${build.classes.dir}/org/netbeans/jemmy/version_info"/>
  </target>

  <target name="check-api-uptodate">
    <uptodate property="api-uptodate" targetfile="${dist.javadoc.dir}/index.html">
      <srcfiles dir="${src.dir}">
        <include name="**/*.java"/>
      </srcfiles>
    </uptodate>
  </target>

  <target name="api" depends="init,check-api-uptodate" unless="api-uptodate">
    <mkdir dir="${dist.javadoc.dir}"/>
    <javadoc packagenames="${package},${package}.util,${package}.explorer,${package}.operators,${package}.demo,${package}.drivers,${package}.drivers.buttons,${package}.drivers.input,${package}.drivers.lists,${package}.drivers.scrolling,${package}.drivers.tables,${package}.drivers.text,${package}.drivers.trees,${package}.image" 
             sourcepath="${src.dir}" destdir="${dist.javadoc.dir}" Protected="yes" Windowtitle="Jemmy API"/>
    <zip zipfile="${dist.javadoc.zip}" basedir="${dist.javadoc.dir}"/>
  </target>

  <!-- Only shortcut to be available in project menu in IDE -->
  <target name="javadoc" depends="api"/>
  
  <target name="jarsrc" depends="jar">
    <jar jarfile="${dist.jar}" basedir="${src.dir}" update="yes"/>
  </target>

  <target name="jarapi" depends="jar,api">
    <jar jarfile="${dist.jar}" basedir="${dist.javadoc.dir}" update="yes"/>
  </target>

  <target name="jarall" depends="jarapi,jarsrc">
  </target>

  <target name="zip" depends="compile">
    <zip zipfile="${dist.zip}" basedir="${build.classes.dir}"/>
  </target>

  <target name="zipsrc" depends="zip">
    <zip zipfile="${dist.zip}" basedir="${src.dir}" update="yes"/>
  </target>

  <target name="zipapi" depends="api,zip">
    <zip zipfile="${dist.zip}" basedir="${dist.javadoc.dir}" update="yes"/>
  </target>

  <target name="zipall" depends="zipapi,zipsrc">
  </target>

  <!-- Test jemmy - if run from IDE it closes IDE. That's why it is called only
       when netbeans.home is not defined.
       -->
  <target name="test" depends="compiletest" unless="netbeans.home">
    <taskdef name="suite" classname="${package}.testing.TestSuite">
      <classpath>
        <pathelement location="${build.test.classes.dir}"/>
        <pathelement location="${build.classes.dir}"/>
        <pathelement path="${java.class.path}"/>
      </classpath>
    </taskdef>
    <property name="testlist" value="testsuite/testlist"/>
    <property name="testdatalocation" value="testsuite/src/org/netbeans/jemmy/testing"/>
    <property name="testresources" value="testsuite/gui_resource"/>
    <property name="testtimeouts" value="testsuite/jemmy.timeouts"/>
    <property name="testresultdir" value="testsuite/run"/>
    <property name="testrundir" value="run"/>
    <property name="robot" value="off"/>
    <property name="shortcut" value="off"/>
    <property name="dispatch" value="off"/>
    <suite testlist="${testlist}" 
           testslocation="${testdatalocation}" 
           resources="${testresources}" 
           timeouts="${testtimeouts}" 
           resultdir="${testresultdir}" 
           rundir="${testrundir}" 
           robotdispatching="${robot}"
           shortcutevents="${shortcut}"
           dispatchevents="${dispatch}"/>
  </target>

  <target name="compiletest" depends="compile">
    <mkdir dir="${build.test.classes.dir}"/>
    <javac srcdir="${test.src.dir}" destdir="${build.test.classes.dir}" 
    excludes="**/JUnit*.java" excludesfile="${java.version.excludes}" debug="on" source="1.4">
      <classpath>
        <pathelement location="${build.classes.dir}"/>
        <pathelement path="${java.class.path}"/>
      </classpath>
    </javac>
  </target>
</project>