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.v3.template"> 25 <basename file="${basedir}" property="jemmy.project.name"/> 26 <property name="src.dir" location="${basedir}/src"/> 27 <property name="test.dir" location="${basedir}/test"/> 28 <property name="build.dir" location="${basedir}/build"/> 29 <property name="build.classes.dir" location="${build.dir}/classes"/> 30 <property name="build.test.dir" location="${build.dir}/test"/> 31 <property name="dist.jar" location="${build.dir}/${jemmy.project.name}.jar"/> 32 <property name="test.list" location="${build.dir}/testlist"/> 33 <property name="test.workdir" location="${build.dir}/test_wd"/> 34 <property name="test.report" location="${build.dir}/test_report"/> 35 <target name="timestamp" unless="buildnumber"> 36 <tstamp> 37 <format property="buildnumber" pattern="yyyyMMdd"/> 38 </tstamp> 39 </target> 40 <target name="build-dependencies" depends="check-dependecies-impl" 41 unless="dependencies.are.built"> 42 <antcall target="build-dependecies-impl"/> 43 </target> 44 <target name="compile" depends="timestamp,build-dependencies"> 45 <mkdir dir="${build.classes.dir}"/> 46 <javac srcdir="${src.dir}" classpath="${dependencies.classpath}" destdir="${build.classes.dir}" debug="on" includeantruntime="false"/> 47 <copy file="${src.dir}/${version.file}" tofile="${build.classes.dir}/${version.file}"/> 48 <replaceregexp file="${build.classes.dir}/${version.file}" match="\$\{buildnumber\}" replace="${buildnumber}" byline="true"/> 49 </target> 50 <target name="compile-test" depends="compile"> 51 <fail message="Please specify jtreg.home" unless="jtreg.home"/> 52 <mkdir dir="${build.test.dir}"/> 53 <javac srcdir="${test.dir}" destdir="${build.test.dir}" debug="on" includeantruntime="false" 54 classpath="${build.classes.dir}:${dependencies.classpath}:${jtreg.home}/lib/testng.jar"/> 55 </target> 56 <target name="find-tests" unless="tests"> 57 <fileset id="testset" dir="${test.dir}"> 58 <include name="**/*Test.java" /> 59 </fileset> 60 <pathconvert pathsep="${line.separator}" property="testlist" refid="testset"> 61 <globmapper from="${test.dir}/*" to="*"/> 62 </pathconvert> 63 <echo file="${test.list}">${testlist}</echo> 64 <property name="tests" value="@${test.list}"/> 65 </target> 66 <target name="test" depends="compile-test,find-tests"> 67 <exec executable="${jtreg.home}/bin/jtreg"> 68 <arg value="-cpa:${build.classes.dir}:${dependencies.classpath}"/> 69 <arg value="-w:${test.workdir}"/> 70 <arg value="-r:${test.report}"/> 71 <arg value="-conc:1"/> 72 <arg value="-ovm"/> 73 <arg value="-v:default"/> 74 <arg value="-dir:test"/> 75 <arg value="${tests}"/> 76 </exec> 77 </target> 78 <target name="full-test" depends="test-dependecies-impl, test"/> 79 <target name="jar" depends="compile"> 80 <mkdir dir="${build.dir}"/> 81 <jar jarfile="${dist.jar}" basedir="${build.classes.dir}"> 82 <manifest> 83 <attribute name="Main-Class" value="${version.class}"/> 84 </manifest> 85 </jar> 86 </target> 87 <target name="clean"> 88 <delete dir="${build.dir}"/> 89 </target> 90 </project> 91 92