1 <!--
  2  Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
  3 
  4  Redistribution and use in source and binary forms, with or without
  5  modification, are permitted provided that the following conditions
  6  are met:
  7 
  8    - Redistributions of source code must retain the above copyright
  9      notice, this list of conditions and the following disclaimer.
 10 
 11    - Redistributions in binary form must reproduce the above copyright
 12      notice, this list of conditions and the following disclaimer in the
 13      documentation and/or other materials provided with the distribution.
 14 
 15    - Neither the name of Oracle nor the names of its
 16      contributors may be used to endorse or promote products derived
 17      from this software without specific prior written permission.
 18 
 19  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
 20  IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 21  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 22  PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 23  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 24  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 25  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 26  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 27  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 28  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 29  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 30 -->
 31 
 32 <project name="J2DBench" default="dist" basedir=".">
 33     <description>
 34         simple example build file
 35     </description>
 36   <!-- set global properties for this build -->
 37   <property name="src" location="src"/>
 38   <property name="build" location="build"/>
 39   <property name="dist"  location="dist"/>
 40   <property name="resources"  location="resources"/>
 41 
 42   <target name="init">
 43     <!-- Create the time stamp -->
 44     <tstamp/>
 45     <!-- Create the build directory structure used by compile -->
 46     <mkdir dir="${build}"/>
 47   </target>
 48 
 49   <target name="compile" depends="init"
 50         description="compile the source " >
 51     <!-- Compile the java code from ${src} into ${build} -->
 52     <javac debug="off" source="1.7" target="1.7" srcdir="${src}" destdir="${build}"/>
 53   </target>
 54 
 55   <target name="run" depends="dist"
 56     description="run J2DBench" >
 57     <java jar="${dist}/J2DBench.jar"
 58        fork="true"
 59     >
 60     </java>
 61   </target>
 62 
 63   <target name="analyze" depends="dist"
 64     description="run J2DAnalyzer" >
 65     <java jar="${dist}/J2DAnalyzer.jar"
 66        fork="true"
 67     >
 68     </java>
 69   </target>
 70 
 71   <target name="resources" depends="init"
 72         description="copy resources into build dir" >
 73     <!-- Copy the resource files from ${resources} into ${build}/ -->
 74     <mkdir dir="${dist}"/>
 75     <mkdir dir="${build}/j2dbench/tests/text/textdata"/>
 76     <copy todir="${build}/j2dbench/tests/text/textdata">
 77       <fileset dir="${resources}/textdata" />
 78     </copy>
 79     <mkdir dir="${build}/j2dbench/tests/iio/images"/>
 80     <copy todir="${build}/j2dbench/tests/iio/images">
 81       <fileset dir="${resources}/images" />
 82     </copy>
 83     <mkdir dir="${build}/j2dbench/tests/cmm/images"/>
 84     <copy todir="${build}/j2dbench/tests/cmm/images">
 85       <fileset dir="${resources}/cmm_images" />
 86     </copy>
 87   </target>
 88 
 89   <target name="dist" depends="compile, resources"
 90         description="generate the distribution" >
 91     <!-- Create the distribution directory -->
 92     <mkdir dir="${dist}"/>
 93 
 94     <!-- Put everything in ${build} into the J2DBench.jar file -->
 95     <jar jarfile="${dist}/J2DBench.jar" basedir="${build}"
 96         excludes="j2dbench/report/**" >
 97       <manifest>
 98         <attribute name="Built-By" value="${user.name}"/>
 99 	<attribute name="Main-Class" value="j2dbench.J2DBench"/>
100       </manifest>
101     </jar>
102     <jar jarfile="${dist}/J2DAnalyzer.jar" basedir="${build}"
103         includes="j2dbench/report/**" >
104       <manifest>
105         <attribute name="Built-By" value="${user.name}"/>
106 	<attribute name="Main-Class" value="j2dbench.report.J2DAnalyzer"/>
107       </manifest>
108     </jar>
109   </target>
110 
111   <target name="clean"
112         description="clean up" >
113     <!-- Delete the ${build} and ${dist} directory trees -->
114     <delete dir="${build}"/>
115     <delete dir="${dist}"/>
116   </target>
117 </project>