view make/build_template.xml @ 5:898c9e02c8c9

7902099: Add JemmySWT to jemmy/v3
author shurailine
date Mon, 29 Jan 2018 10:53:15 -0800
parents core/make/build_template.xml@b3f1ec02cea7
children 7cde94b782c9
line wrap: on
line source
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (c) 1997, 2017, 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.

 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.
 -->
<project name="jemmy.v3.template">
    <basename file="${basedir}" property="jemmy.project.name"/>
    <property name="src.dir" location="${basedir}/src"/>
    <property name="test.dir" location="${basedir}/test"/>
    <property name="build.dir" location="${basedir}/build"/>
    <property name="build.classes.dir" location="${build.dir}/classes"/>
    <property name="build.test.dir" location="${build.dir}/test"/>
    <property name="dist.jar" location="${build.dir}/${jemmy.project.name}.jar"/>
    <property name="test.list" location="${build.dir}/testlist"/>
    <property name="test.workdir" location="${build.dir}/test_wd"/>
    <property name="test.report" location="${build.dir}/test_report"/>
    <target name="timestamp" unless="buildnumber">
        <tstamp>
            <format property="buildnumber" pattern="yyyyMMdd"/>
        </tstamp>
    </target>
    <target name="build-dependencies" depends="check-dependecies-impl"
            unless="dependencies.are.built">
        <antcall target="build-dependecies-impl"/>
    </target>
    <target name="compile" depends="timestamp,build-dependencies">
        <mkdir dir="${build.classes.dir}"/>
        <javac srcdir="${src.dir}" classpath="${dependencies.classpath}" destdir="${build.classes.dir}" debug="on" includeantruntime="false"/>
        <copy file="${src.dir}/${version.file}" tofile="${build.classes.dir}/${version.file}"/>
        <echo message="build=${buildnumber}" file="${build.classes.dir}/${version.file}" append="true"/>
    </target>
    <target name="compile-test" depends="compile">
        <fail message="Please specify jtreg.home" unless="jtreg.home"/>
        <mkdir dir="${build.test.dir}"/>
        <javac srcdir="${test.dir}" destdir="${build.test.dir}" debug="on" includeantruntime="false"
               classpath="${build.classes.dir}:${dependencies.classpath}:${jtreg.home}/lib/testng.jar"/>
    </target>
    <target name="find-tests" unless="tests">
        <fileset id="testset" dir="${test.dir}">
            <include name="**/*Test.java" />
        </fileset>
        <pathconvert pathsep="${line.separator}" property="testlist" refid="testset">
            <globmapper from="${test.dir}/*" to="*"/>
        </pathconvert>
        <echo file="${test.list}">${testlist}</echo>
        <property name="tests" value="@${test.list}"/>
    </target>
    <target name="test" depends="compile-test,find-tests">
        <exec executable="${jtreg.home}/bin/jtreg">
            <arg value="-cpa:${build.classes.dir}:${dependencies.classpath}"/>
            <arg value="-w:${test.workdir}"/>
            <arg value="-r:${test.report}"/>
            <arg value="-conc:1"/>
            <arg value="-ovm"/>
            <arg value="-v:default"/>
            <arg value="-dir:test"/>
            <arg value="${tests}"/>
        </exec>
    </target>
    <target name="full-test" depends="test-dependecies-impl, test"/>
    <target name="jar" depends="compile">
        <mkdir dir="${build.dir}"/>
        <jar jarfile="${dist.jar}" basedir="${build.classes.dir}">
            <manifest>
                <attribute name="Main-Class" value="${version.class}"/>
            </manifest>
        </jar>
    </target>
    <target name="clean">
        <delete dir="${build.dir}"/>
    </target>
</project>