1 <?xml version="1.0" encoding="UTF-8"?>
   2 
   3 <!--
   4   Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
   5   DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   6 
   7   This code is free software; you can redistribute it and/or modify it
   8   under the terms of the GNU General Public License version 2 only, as
   9   published by the Free Software Foundation.  Oracle designates this
  10   particular file as subject to the "Classpath" exception as provided
  11   by Oracle in the LICENSE file that accompanied this code.
  12 
  13   This code is distributed in the hope that it will be useful, but WITHOUT
  14   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  16   version 2 for more details (a copy is included in the LICENSE file that
  17   accompanied this code).
  18 
  19   You should have received a copy of the GNU General Public License version
  20   2 along with this work; if not, write to the Free Software Foundation,
  21   Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  22 
  23   Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  24   or visit www.oracle.com if you need additional information or have any
  25   questions.
  26 -->
  27 <project name="SimpleMethodsANCFilter" default="dist" basedir=".">
  28   <!-- set global properties for this build -->
  29   <property name="src" location="src"/>
  30   <property name="test" location="test"/>
  31   <property name="build" location="build"/>
  32   <property name="classes" location="${build}/classes"/>
  33   <property name="test.classes" location="${build}/tests"/>
  34   <property name="test.jar" location="${build}/tests.jar"/>
  35   <property name="jar" location="${build}/SimpleMethods.jar"/>
  36   <property name="test.results" location="${build}/test_results"/>
  37   <property name="jcov.jar" location="../../JCOV_BUILD/jcov_3.0/jcov.jar"/>
  38 
  39   <target name="compile">
  40     <available file="${jcov.jar}" property="jcov-jar-exists"/>
  41     <fail unless="jcov-jar-exists" message="There is no ${jcov.jar}"/>
  42     <mkdir dir="${classes}"/>
  43     <javac srcdir="${src}" classpath="${jcov.jar}" destdir="${classes}"/>
  44   </target>
  45 
  46   <target name="jar" depends="compile">
  47     <mkdir dir="${dist}"/>
  48     <jar jarfile="${jar}" basedir="${classes}"/>
  49   </target>
  50 
  51   <target name="clean">
  52     <delete dir="${build}"/>
  53   </target>
  54 
  55   <target name="compile-test">
  56     <fail unless="testng.jar" message="Please specify testng.jar"/>
  57     <mkdir dir="${test.classes}"/>
  58     <javac srcdir="${test}" classpath="${classes}:${jcov.jar}:${testng.jar}" destdir="${test.classes}"/>
  59   </target>
  60 
  61   <target name="test" depends="compile,compile-test">
  62     <taskdef resource="testngtasks" classpath="${testng.jar}"/>
  63     <mkdir dir="${test.results}"/>
  64     <jar jarfile="${test.jar}" basedir="${test.classes}"/>
  65     <propertyset id="test.bytecode">
  66       <propertyref name="test.classes"/>
  67       <propertyref name="test.jar"/>
  68     </propertyset>
  69     <testng classpath="${classes}:${jcov.jar}:${test.classes}" outputDir="${test.results}">
  70       <classfileset dir="${test.classes}" includes="**/*.class"/>
  71       <propertyset refid="test.bytecode"/>
  72     </testng>
  73   </target>
  74 </project>