You need to sign in or sign up before continuing.
build.xml 4.2 KB
Newer Older
D
duke 已提交
1
<!--
2
 Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
D
duke 已提交
3 4 5 6 7 8 9 10 11 12 13 14

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:

   - Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.

   - Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in the
     documentation and/or other materials provided with the distribution.

15
   - Neither the name of Oracle nor the names of its
D
duke 已提交
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
     contributors may be used to endorse or promote products derived
     from this software without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->

<project name="J2DBench" default="dist" basedir=".">
    <description>
        simple example build file
    </description>
  <!-- set global properties for this build -->
  <property name="src" location="src"/>
  <property name="build" location="build"/>
  <property name="dist"  location="dist"/>
  <property name="resources"  location="resources"/>

  <target name="init">
    <!-- Create the time stamp -->
    <tstamp/>
    <!-- Create the build directory structure used by compile -->
    <mkdir dir="${build}"/>
  </target>

  <target name="compile" depends="init"
        description="compile the source " >
    <!-- Compile the java code from ${src} into ${build} -->
52
    <javac debug="flase" source="1.5" target="1.5" srcdir="${src}" destdir="${build}"/>
D
duke 已提交
53 54
  </target>

55
  <target name="run" depends="dist"
D
duke 已提交
56 57 58 59 60 61 62
    description="run J2DBench" >
    <java jar="${dist}/J2DBench.jar"
       fork="true"
    >
    </java>
  </target>

63
  <target name="analyze" depends="dist"
D
duke 已提交
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
    description="run J2DAnalyzer" >
    <java jar="${dist}/J2DAnalyzer.jar"
       fork="true"
    >
    </java>
  </target>

  <target name="resources" depends="init"
        description="copy resources into build dir" >
    <!-- Copy the resource files from ${resources} into ${build}/ -->
    <mkdir dir="${dist}"/>
    <mkdir dir="${build}/j2dbench/tests/text/textdata"/>
    <copy todir="${build}/j2dbench/tests/text/textdata">
      <fileset dir="${resources}/textdata" />
    </copy>
    <mkdir dir="${build}/j2dbench/tests/iio/images"/>
    <copy todir="${build}/j2dbench/tests/iio/images">
      <fileset dir="${resources}/images" />
    </copy>
83 84 85 86
    <mkdir dir="${build}/j2dbench/tests/cmm/images"/>
    <copy todir="${build}/j2dbench/tests/cmm/images">
      <fileset dir="${resources}/cmm_images" />
    </copy>
D
duke 已提交
87 88 89 90 91 92 93 94
  </target>

  <target name="dist" depends="compile, resources"
        description="generate the distribution" >
    <!-- Create the distribution directory -->
    <mkdir dir="${dist}"/>

    <!-- Put everything in ${build} into the J2DBench.jar file -->
95
    <jar jarfile="${dist}/J2DBench.jar" basedir="${build}"
D
duke 已提交
96 97 98 99 100 101
        excludes="j2dbench/report/**" >
      <manifest>
        <attribute name="Built-By" value="${user.name}"/>
	<attribute name="Main-Class" value="j2dbench.J2DBench"/>
      </manifest>
    </jar>
102
    <jar jarfile="${dist}/J2DAnalyzer.jar" basedir="${build}"
D
duke 已提交
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
        includes="j2dbench/report/**" >
      <manifest>
        <attribute name="Built-By" value="${user.name}"/>
	<attribute name="Main-Class" value="j2dbench.report.J2DAnalyzer"/>
      </manifest>
    </jar>
  </target>

  <target name="clean"
        description="clean up" >
    <!-- Delete the ${build} and ${dist} directory trees -->
    <delete dir="${build}"/>
    <delete dir="${dist}"/>
  </target>
</project>