make/netbeans/common/shared.xml

changeset 201
e3930187199c
parent 200
e6dafbf35355
child 202
3b2c55b7bd01
     1.1 --- a/make/netbeans/common/shared.xml	Thu Jan 22 15:45:44 2009 -0800
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,186 +0,0 @@
     1.4 -<?xml version="1.0" encoding="UTF-8"?>
     1.5 -<!--
     1.6 - Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
     1.7 -
     1.8 - Redistribution and use in source and binary forms, with or without
     1.9 - modification, are permitted provided that the following conditions
    1.10 - are met:
    1.11 -
    1.12 -   - Redistributions of source code must retain the above copyright
    1.13 -     notice, this list of conditions and the following disclaimer.
    1.14 -
    1.15 -   - Redistributions in binary form must reproduce the above copyright
    1.16 -     notice, this list of conditions and the following disclaimer in the
    1.17 -     documentation and/or other materials provided with the distribution.
    1.18 -
    1.19 -   - Neither the name of Sun Microsystems nor the names of its
    1.20 -     contributors may be used to endorse or promote products derived
    1.21 -     from this software without specific prior written permission.
    1.22 -
    1.23 - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
    1.24 - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    1.25 - THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    1.26 - PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    1.27 - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    1.28 - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    1.29 - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    1.30 - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    1.31 - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    1.32 - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    1.33 - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    1.34 --->
    1.35 -
    1.36 -<!--
    1.37 - The file contains targets for NetBeans action that are shared across
    1.38 - all langtools projects.
    1.39 --->
    1.40 -
    1.41 -<project name="shared" default="build" basedir="../../..">
    1.42 -    <!-- 
    1.43 -       Instead of importing the main build file, we could call it when needed.
    1.44 -       That would reduce the list of Ant targets that get displayed for this
    1.45 -       file, but it also complicates the interface between the project build 
    1.46 -       file and the main build file. For example, some imported targets
    1.47 -       would have to be reclared, properties would have to be restructured,
    1.48 -       and it would be harder to run results (e.g. in properties) from nested 
    1.49 -       targets.
    1.50 -     -->
    1.51 -    <import file="../../build.xml"/> 
    1.52 -    
    1.53 -    <property name="tool.mainclass" value="com.sun.tools.${tool.name}.Main"/>
    1.54 -    <property name="tool.default.args" value="-version"/>
    1.55 -    
    1.56 -    <!-- compile a single file -->
    1.57 - 
    1.58 -    <!-- for compile-single, etc, we might want different targets for 
    1.59 -         javac and not javac, because of bootstrap issues -->
    1.60 -    <target name="compile-single" depends="build-bootstrap-javac">
    1.61 -        <fail unless="includes">Must set property 'includes'</fail>
    1.62 -        <javac fork="true" executable="${build.bootstrap.dir}/bin/javac"
    1.63 -               srcdir="${src.classes.dir}"
    1.64 -               destdir="${build.classes.dir}"
    1.65 -               includes="${includes}"
    1.66 -               sourcepath=""
    1.67 -               includeAntRuntime="no"
    1.68 -               target="${target}"
    1.69 -               debug="${javac.debug}" 
    1.70 -               debuglevel="${javac.debuglevel}"/>
    1.71 -    </target>
    1.72 -    
    1.73 -    <!-- run tool -->
    1.74 -    
    1.75 -    <target name="run" depends="build,-def-run" description="run ${tool.description}">
    1.76 -        <run/>
    1.77 -    </target>
    1.78 -    
    1.79 -    <!-- run a selected class -->
    1.80 -    
    1.81 -    <target name="run-single" depends="-def-run">
    1.82 -        <fail unless="run.classname">Must set property 'run.classname'</fail>
    1.83 -        <run name="${run.classname}" mainclass="${run.classname}" default.args=""/>
    1.84 -    </target>
    1.85 -    
    1.86 -    <!-- run jtreg tests, and display results in NetBeans -->
    1.87 -    
    1.88 -    <target name="-jtreg-nb" depends="-jtreg" if="netbeans.home" unless="jtreg.passed">
    1.89 -        <nbbrowse file="${jtreg.report}/report.html"/>
    1.90 -        <fail>Some tests failed; see report for details.</fail>
    1.91 -    </target>
    1.92 -    
    1.93 -    <!-- debug tool in NetBeans -->
    1.94 -    
    1.95 -    <target name="-debug-nb" depends="build,-def-run,-def-start-debugger" if="netbeans.home">
    1.96 -        <start-debugger/>
    1.97 -        <run jpda.jvmargs="${jpda.jvmargs}"/>
    1.98 -    </target>
    1.99 -    
   1.100 -    <!-- debug a selected class -->
   1.101 -    
   1.102 -    <target name="debug-single-nb" depends="-def-start-debugger,-def-run">
   1.103 -        <fail unless="debug.classname">Must set property 'debug.classname'</fail>
   1.104 -        <start-debugger/>
   1.105 -        <run name="${debug.classname}" mainclass="${debug.classname}" default.args=""
   1.106 -             jpda.jvmargs="${jpda.jvmargs}"/>
   1.107 -    </target>
   1.108 -    
   1.109 -    <!-- debug a jtreg test -->
   1.110 -    
   1.111 -    <target name="debug-jtreg-nb" depends="-def-start-debugger,-def-jtreg"> 
   1.112 -        <fail unless="jtreg.tests">Must set property 'jtreg.tests'</fail>
   1.113 -        <start-debugger/>
   1.114 -        <jtreg-tool name="${tool.name}" samevm="false" tests="${jtreg.tests}" 
   1.115 -                    jpda.jvmargs="${jpda.jvmargs}"/>
   1.116 -    </target>
   1.117 -    
   1.118 -    <!-- update a class being debugged -->
   1.119 -    
   1.120 -    <target name="debug-fix">
   1.121 -        <fail unless="class">Must set property 'class'</fail>
   1.122 -        <antcall target="compile-single">
   1.123 -            <param name="includes" value="${class}.java"/>
   1.124 -        </antcall>
   1.125 -        <nbjpdareload>
   1.126 -            <fileset dir="${build.classes.dir}">
   1.127 -                <include name="${class}.class"/>
   1.128 -            </fileset>
   1.129 -        </nbjpdareload>
   1.130 -    </target>
   1.131 -    
   1.132 -    
   1.133 -    <!-- create javadoc documentation -->
   1.134 -    
   1.135 -    <target name="-javadoc-nb" depends="-javadoc" if="netbeans.home">
   1.136 -        <nbbrowse file="${build.javadoc.dir}/${tool.name}/index.html"/>
   1.137 -    </target>
   1.138 -    
   1.139 -    <!-- default target for those projects that don't have public API docs;
   1.140 -         override as needed for projects with public API docs.-->
   1.141 -    <target name="-javadoc"/>
   1.142 -    
   1.143 -    <!-- macro to run a tool or selected class - used by run* and debug* tasks -->
   1.144 -    
   1.145 -    <target name="-def-run">
   1.146 -        <macrodef name="run">
   1.147 -            <attribute name="name" default="${tool.name}"/>
   1.148 -            <attribute name="mainclass" default="${tool.mainclass}"/>
   1.149 -            <attribute name="default.args" default="${tool.default.args}"/>
   1.150 -            <attribute name="jpda.jvmargs" default=""/>
   1.151 -            <sequential>
   1.152 -                <input addproperty="run.args" message="Run @{name} with options" defaultvalue="@{default.args}"/>
   1.153 -                <java fork="true" jvm="${target.java}" classname="@{mainclass}">
   1.154 -                    <bootclasspath>
   1.155 -                        <pathelement location="${build.classes.dir}"/>
   1.156 -                        <pathelement location="${target.java.home}/jre/lib/rt.jar"/>
   1.157 -                    </bootclasspath>
   1.158 -                    <jvmarg line="@{jpda.jvmargs}"/> 
   1.159 -                    <arg line="${run.args}"/>
   1.160 -                </java>
   1.161 -            </sequential>
   1.162 -        </macrodef>
   1.163 -    </target>
   1.164 -    
   1.165 -    <!-- macro to start the debugger and set a property containg the args needed by the run task -->
   1.166 -    
   1.167 -    <target name="-def-start-debugger" if="netbeans.home">
   1.168 -        <macrodef name="start-debugger">
   1.169 -            <attribute name="jpda.jvmargs.property" default="jpda.jvmargs"/>
   1.170 -            <sequential>
   1.171 -                <nbjpdastart name="${ant.project.name}" addressproperty="jpda.address" transport="dt_socket">
   1.172 -                    <bootclasspath>
   1.173 -                        <pathelement location="${build.classes.dir}"/>
   1.174 -                        <pathelement location="${target.java.home}/jre/lib/rt.jar"/>
   1.175 -                    </bootclasspath>
   1.176 -                    <sourcepath>
   1.177 -                        <pathelement location="${src.classes.dir}"/>
   1.178 -                    </sourcepath>
   1.179 -                </nbjpdastart>
   1.180 -                <property 
   1.181 -                    name="@{jpda.jvmargs.property}" 
   1.182 -                    value="-Xdebug -Xnoagent -Djava.compiler=none -Xrunjdwp:transport=dt_socket,address=${jpda.address}"
   1.183 -                />
   1.184 -            </sequential>
   1.185 -        </macrodef>
   1.186 -    </target>
   1.187 -    
   1.188 -    
   1.189 -</project>

mercurial