1
<?xml version="1.0" encoding="UTF-8"?>
33
<project name="langtools-netbeans" default="build" basedir="../../../..">
35
<property name="langtools.properties"
36
location="make/netbeans/langtools/nbproject/private/langtools.properties"/>
47
<import file="../../../langtools/build.xml"/>
53
<target name="compile-single" depends="-get-tool-if-set,-check-langtools.jdk.home">
54
<fail unless="includes">Must set property 'includes'</fail>
55
<mkdir dir="${build.dir}/${module.name}/classes" />
56
<javac fork="true" executable="${java.home}/bin/javac"
57
srcdir="${basedir}/src/${module.name}/share/classes"
58
destdir="${build.dir}/${module.name}/classes"
59
includes="${includes}"
61
classpath="${langtools.classes}"
62
includeAntRuntime="no"
63
source="${javac.source}"
64
target="${javac.target}"
65
debug="${javac.debug}"
66
debuglevel="${javac.debuglevel}">
75
<target name="run" depends="-check-langtools.jdk.home,-build-classes,-def-run,-get-tool-and-args,-def-resolve-main-class"
76
description="run tool">
77
<echo level="info" message="Run ${langtools.tool.name} with args ${langtools.tool.args}"/>
78
<resolve-main-class tool.name="${langtools.tool.name}" />
79
<run mainclass="${langtools.main.class}" args="${langtools.tool.args}"/>
82
<target name="-def-resolve-main-class">
83
<macrodef name="resolve-main-class">
84
<attribute name="tool.name"/>
86
<condition property="langtools.main.class"
87
value="jdk.javadoc.internal.tool.Main"
88
else="${tool.@{tool.name}.main.class}">
89
<equals arg1="${langtools.tool.name}" arg2="javadoc"/>
95
<target name="-build-classes" depends="-get-tool-if-set,-build-classes-all" />
96
<target name="-build-classes-all">
97
<antcall target="build-all-classes"/>
102
<target name="run-single" depends="-check-langtools.jdk.home,-def-run">
103
<fail unless="run.classname">Must set property 'run.classname' </fail>
104
<echo level="info" message="run ${run.classname}"/>
105
<run mainclass="${run.classname}" args=""/>
113
<target name="jtreg" depends="-get-tool-if-set,-jtreg-all"
114
description="Test langtools tools"
117
<target name="-jtreg-all">
118
<echo level="info" message="Testing all tools"/>
120
<target name="langtools.jtreg"/>
121
<target name="-show-jtreg"/>
125
<target name="-show-jtreg-single-detect" if="netbeans.home" unless="jtreg.passed">
126
<dirname property="netbeans.jtreg.tests.dir.temp" file="${jtreg.report}/../work/${jtreg.tests}"/>
127
<basename property="netbeans.jtreg.tests.basename.temp" file="${jtreg.tests}" suffix=".java"/>
128
<property name="netbeans.jtreg.single.jtr" value="${netbeans.jtreg.tests.dir.temp}/${netbeans.jtreg.tests.basename.temp}.jtr"/>
129
<condition property="netbeans.jtreg.single">
130
<available file="${netbeans.jtreg.single.jtr}" />
132
<condition property="netbeans.jtreg.multiple">
134
<available file="${netbeans.jtreg.single.jtr}" />
139
<target name="-show-jtreg-single" if="netbeans.jtreg.single" depends="-show-jtreg-single-detect">
140
<nbbrowse file="${netbeans.jtreg.single.jtr}"/>
141
<fail>Some tests failed; see report for details.</fail>
144
<target name="-show-jtreg-multiple" if="netbeans.jtreg.multiple" depends="-show-jtreg-single-detect">
145
<nbbrowse url="file://${jtreg.report}/html/report.html#Results"/>
146
<fail>Some tests failed; see report for details.</fail>
149
<target name="-show-jtreg" depends="-show-jtreg-single-detect,-show-jtreg-single,-show-jtreg-multiple" />
153
<target name="debug" depends="-check-langtools.jdk.home,-def-run,-def-start-debugger,-get-tool-and-args,-build-classes,-def-resolve-main-class" if="netbeans.home">
154
<echo level="info" message="Debug ${langtools.tool.name} with args ${langtools.tool.args}"/>
156
<resolve-main-class tool.name="${langtools.tool.name}" />
157
<run mainclass="${langtools.main.class}" args="${langtools.tool.args}" jpda.jvmargs="${jpda.jvmargs}"/>
161
<target name="debug-single" depends="-check-langtools.jdk.home,-def-start-debugger,-def-run">
162
<fail unless="debug.classname">Must set property 'debug.classname'</fail>
164
<run mainclass="${debug.classname}" args="" jpda.jvmargs="${jpda.jvmargs}"/>
168
<target name="debug-jtreg" depends="-check-langtools.jdk.home,-def-start-debugger,-def-jtreg,-get-tool-if-set">
169
<fail unless="jtreg.tests">Must set property 'jtreg.tests'</fail>
171
<jtreg-tool name="debug"
172
tests="${jtreg.tests}"
173
jpda.jvmargs="${jpda.jvmargs}"/>
178
<target name="debug-fix" depends="-get-tool-if-set">
179
<fail unless="class">Must set property 'class'
181
<antcall target="compile-single">
182
<param name="includes" value="${class}.java"/>
184
<property name="build.classes.dir" value="${build.dir}/${module.name}/classes" />
186
<fileset dir="${build.classes.dir}">
187
<include name="${class}.class"/>
194
<target name="-get-tool-if-set" depends="-def-select-tool">
196
toolproperty="langtools.tool.name"
197
propertyfile="${langtools.properties}"
202
<target name="-get-tool-and-args" depends="-def-select-tool">
204
toolproperty="langtools.tool.name"
205
argsproperty="langtools.tool.args"
206
propertyfile="${langtools.properties}"
212
<target name="-def-run">
213
<macrodef name="run">
214
<attribute name="mainclass"/>
215
<attribute name="args" default=""/>
216
<attribute name="build.modules" default="${build.modules}"/>
217
<attribute name="jpda.jvmargs" default=""/>
220
<java fork="true" jvm="${langtools.jdk.home}/bin/java" classname="@{mainclass}">
221
<jvmarg line="--patch-module=java.compiler=@{build.modules}/java.compiler"/>
222
<jvmarg line="--patch-module=jdk.compiler=@{build.modules}/jdk.compiler"/>
223
<jvmarg line="--patch-module=jdk.javadoc=@{build.modules}/jdk.javadoc"/>
224
<jvmarg line="--patch-module=jdk.jdeps=@{build.modules}/jdk.jdeps"/>
225
<jvmarg line="--patch-module=jdk.jshell=@{build.modules}/jdk.jshell"/>
226
<jvmarg line="@{jpda.jvmargs}"/>
227
<arg line="@{args}"/>
234
<target name="-def-start-debugger" if="netbeans.home">
235
<macrodef name="start-debugger">
236
<attribute name="jpda.jvmargs.property" default="jpda.jvmargs"/>
238
<nbjpdastart name="${ant.project.name}" addressproperty="jpda.address" transport="dt_socket">
240
<pathelement path="${langtools.classes}"/>
244
name="@{jpda.jvmargs.property}"
245
value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"
251
<target name="-def-select-tool">
252
<property name="build.toolclasses.dir" location="${build.dir}/toolclasses"/>
253
<mkdir dir="${build.toolclasses.dir}"/>
254
<javac srcdir="${make.tools.dir}"
255
includes="anttasks/SelectTool*"
256
destdir="${build.toolclasses.dir}/"
257
classpath="${ant.core.lib}"
258
includeantruntime="false"
259
debug="${javac.debug}"
260
debuglevel="${javac.debuglevel}">
261
<compilerarg line="-Xlint"/>
263
<taskdef name="select-tool"
264
classname="anttasks.SelectToolTask"
265
classpath="${build.toolclasses.dir}/"/>
268
<target name="select-tool" depends="-def-select-tool">
269
<select-tool propertyfile="${langtools.properties}"/>