1 <?xml version="1.0" encoding="UTF-8"?> 2 <!-- 3 Copyright (c) 1997, 2017, 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. 9 10 This code is distributed in the hope that it will be useful, but WITHOUT 11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 version 2 for more details (a copy is included in the LICENSE file that 14 accompanied this code). 15 16 You should have received a copy of the GNU General Public License version 17 2 along with this work; if not, write to the Free Software Foundation, 18 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19 20 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 21 or visit www.oracle.com if you need additional information or have any 22 questions. 23 --> 24 <project name="jemmy" default="compile" basedir="."> 25 <property name="src.dir" location="src"/> 26 <property name="test.dir" location="test"/> 27 <property name="build.dir" location="build"/> 28 <property name="build.classes.dir" location="${build.dir}/classes"/> 29 <property name="build.test.dir" location="${build.dir}/test"/> 30 <property name="dist.jar" location="${build.dir}/JemmyCore.jar"/> 31 <property name="test.list" location="${build.dir}/testlist"/> 32 <property name="test.workdir" location="${build.dir}/test_wd"/> 33 <property name="test.report" location="${build.dir}/test_report"/> 34 <target name="timestamp" unless="buildnumber"> 35 <tstamp> 36 <format property="buildnumber" pattern="yyyyMMdd"/> 37 </tstamp> 38 </target> 39 <target name="compile" depends="timestamp"> 40 <mkdir dir="${build.classes.dir}"/> 41 <javac srcdir="${src.dir}" destdir="${build.classes.dir}" debug="on" includeantruntime="false"/> 42 <copy file="${src.dir}/org/jemmy/jemmy.properties" tofile="${build.classes.dir}/org/jemmy/jemmy.properties" filtering="on"/> 43 <echo message="build=${buildnumber}" file="${build.classes.dir}/org/jemmy/jemmy.properties" append="true"/> 44 </target> 45 <target name="compile-test" depends="compile"> 46 <mkdir dir="${build.test.dir}"/> 47 <javac srcdir="${test.dir}" destdir="${build.test.dir}" debug="on" includeantruntime="false" 48 classpath="${build.classes.dir}:${jtreg.home}/lib/testng.jar"/> 49 </target> 50 <target name="find-tests" unless="tests"> 51 <fileset id="testset" dir="${test.dir}"> 52 <include name="**/*Test.java" /> 53 </fileset> 54 <pathconvert pathsep="${line.separator}" property="testlist" refid="testset"> 55 <globmapper from="${test.dir}/*" to="*"/> 56 </pathconvert> 57 <echo file="${test.list}">${testlist}</echo> 58 <property name="tests" value="@${test.list}"/> 59 </target> 60 <target name="test" depends="compile-test,find-tests"> 61 <exec executable="${jtreg.home}/bin/jtreg"> 62 <arg value="-cpa:${build.classes.dir}"/> 63 <arg value="-w:${test.workdir}"/> 64 <arg value="-r:${test.report}"/> 65 <arg value="-conc:1"/> 66 <arg value="-ovm"/> 67 <arg value="-v:default"/> 68 <arg value="-dir:test"/> 69 <arg value="${tests}"/> 70 </exec> 71 </target> 72 <target name="jar" depends="compile"> 73 <mkdir dir="${build.dir}"/> 74 <jar jarfile="${dist.jar}" basedir="${build.classes.dir}"> 75 <manifest> 76 <attribute name="Main-Class" 77 value="org.jemmy.Version"/> 78 </manifest> 79 </jar> 80 </target> 81 <target name="clean"> 82 <delete dir="${build.dir}"/> 83 </target> 84 </project> 85 86