jdk/src/share/sample/jmx/jmx-scandir/build.xml
author ohair
Tue, 25 May 2010 15:58:33 -0700
changeset 5506 202f599c92aa
parent 2 90ce3da70b43
permissions -rw-r--r--
6943119: Rebrand source copyright notices Reviewed-by: darcy, weijun
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
<!--
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     4
 Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 Redistribution and use in source and binary forms, with or without
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 modification, are permitted provided that the following conditions
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 are met:
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
   - Redistributions of source code must retain the above copyright
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
     notice, this list of conditions and the following disclaimer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
   - Redistributions in binary form must reproduce the above copyright
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
     notice, this list of conditions and the following disclaimer in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
     documentation and/or other materials provided with the distribution.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    17
   - Neither the name of Oracle nor the names of its
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
     contributors may be used to endorse or promote products derived
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
     from this software without specific prior written permission.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
-->
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
<!-- 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
  This is ant (http://ant.apache.org) build script to build the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
  "jmx-scandir" sample. Either this build.xml can be used standalone 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
  with "ant" tool or can be opened as a project with NetBeans IDE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
  (http://www.netbeans.org).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
-->
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
<project name="jmx-scandir" default="jar" basedir=".">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    <import file="nbproject/jdk.xml"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    <target name="-prop-init">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
        <property file="user.build.properties"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
        <property file="build.properties"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    <target name="-init" depends="-prop-init,-jdk-init"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    <target name="compile" depends="-init" description="Compile main sources.">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
        <mkdir dir="${classes.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        <javac srcdir="${src.dir}" destdir="${classes.dir}" debug="${debug}" deprecation="${deprecation}">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
            <classpath path="${cp}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
        </javac>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
        <copy todir="${classes.dir}">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
            <fileset dir="${src.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
        </copy>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    <target name="jar" depends="compile" description="Build JAR file for main sources.">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
        <mkdir dir="${dist.dir}" />
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        <jar jarfile="${jar}" compress="true">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
            <manifest>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
                <attribute name="Main-Class" value="${main.agent.class}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
            </manifest>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
            <fileset dir="${classes.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        </jar>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    <target name="run-client" depends="compile" description="Run client.">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
        <fail unless="main.client.class">Must set property 'main.client.class' (e.g. in build.properties)</fail>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        <java classname="${main.client.class}" fork="true" failonerror="true">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
            <classpath path="${run.cp}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
            <jvmarg line="${client.jvmargs}" />
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
            <arg line="${client.args}" />
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
        </java>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    <target name="run-agent" depends="compile" description="Run agent.">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
        <fail unless="main.agent.class">Must set property 'main.agent.class' (e.g. in build.properties)</fail>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        <java classname="${main.agent.class}" fork="true" failonerror="true">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
            <classpath path="${run.cp}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
            <jvmarg line="${agent.jvmargs}" />
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
        </java>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    <target name="run" depends="run-agent" description="Run agent." />
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    <target name="run-single" depends="-init,compile">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        <java classname="${run.class}" fork="true" failonerror="true">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
            <classpath path="${run.cp}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        </java>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    <target name="javadoc" depends="-init" description="Build Javadoc.">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        <mkdir dir="${javadoc.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        <javadoc destdir="${javadoc.dir}">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
            <classpath path="${cp}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
            <sourcepath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
                <pathelement location="${src.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
            </sourcepath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
            <fileset dir="${src.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        </javadoc>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    <target name="clean" depends="-init" description="Clean build products.">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        <delete dir="${build.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        <delete file="${jar}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        <delete dir="${dist.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    <target name="profile">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        <ant antfile="nbproject/netbeans-targets.xml" target="profile"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    <!-- JUnit targets -->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    <target name="compile-test" depends="-init,compile">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        <fail unless="libs.junit.classpath">Must set libs.junit.classpath variable to the JUnit classpath in the build.properties file.</fail>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        <mkdir dir="${build.test.classes.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        <javac srcdir="${test.src.dir}" destdir="${build.test.classes.dir}" debug="${debug}" classpath="${javac.test.classpath}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        <copy todir="${build.test.classes.dir}">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
            <fileset dir="${test.src.dir}" excludes="**/*.java"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        </copy>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    <target name="-do-test-run" depends="-init,compile-test">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        <mkdir dir="${build.test.results.dir}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        <junit showoutput="true" fork="true" dir="${basedir}" failureproperty="tests.failed" errorproperty="tests.failed">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
            <batchtest todir="${build.test.results.dir}">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
                <fileset dir="${test.src.dir}" includes="**/*Test.java"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
            </batchtest>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
            <classpath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
                <path path="${run.test.classpath}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
            </classpath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
            <syspropertyset>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
                <propertyref prefix="test-sys-prop."/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
                <mapper type="glob" from="test-sys-prop.*" to="*"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
            </syspropertyset>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
            <formatter type="brief" usefile="false"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
            <formatter type="xml"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
            <jvmarg line="${run.jvmargs}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        </junit>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        <fail if="tests.failed">Some tests failed; see details above.</fail>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    <target name="test" depends="-init,compile-test,-do-test-run" description="Run unit tests."/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    <target name="-do-test-run-single" depends="-init,compile-test">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        <junit showoutput="true" fork="true" dir="${basedir}" failureproperty="tests.failed" errorproperty="tests.failed">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
            <batchtest todir="${build.test.results.dir}">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
                <fileset dir="${test.src.dir}" includes="${test.includes}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
            </batchtest>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
            <classpath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
                <path path="${run.test.classpath}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
            </classpath>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
            <syspropertyset>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
                <propertyref prefix="test-sys-prop."/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
                <mapper type="glob" from="test-sys-prop.*" to="*"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
            </syspropertyset>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
            <formatter type="brief" usefile="false"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
            <formatter type="xml"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
            <jvmarg line="${run.jvmargs}"/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        </junit>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        <fail if="tests.failed">Some tests failed; see details above.</fail>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    </target>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    <target name="test-single" depends="-init,compile-test,-do-test-run-single" description="Run single unit test."/>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
</project>