53 |
53 |
54 <target name="build" depends="-get-tool-if-set,-build-tool,-build-all" |
54 <target name="build" depends="-get-tool-if-set,-build-tool,-build-all" |
55 description="Build one or all langtools tools" |
55 description="Build one or all langtools tools" |
56 /> |
56 /> |
57 |
57 |
58 <condition property="bootstrap" value="bootstrap-" else=""> |
58 <condition property="use_bootstrap" value="bootstrap-" else=""> |
59 <isset property="langtools.tool.bootstrap"/> |
59 <isset property="langtools.tool.bootstrap"/> |
60 </condition> |
60 </condition> |
61 |
61 <condition property="with_bootclasspath" value="${build.bootstrap.dir}/classes" else="${build.classes.dir}"> |
62 <condition property="bcp" value="${build.bootstrap.dir}/classes" else="${build.classes.dir}"> |
|
63 <isset property="langtools.tool.bootstrap"/> |
62 <isset property="langtools.tool.bootstrap"/> |
64 </condition> |
63 </condition> |
65 |
64 |
66 <target name="-build-tool" if="langtools.tool.name"> |
65 <target name="-build-tool" if="langtools.tool.name"> |
67 <echo level="info" message="Building ${bootstrap}${langtools.tool.name}"/> |
66 <echo level="info" message="Building ${use_bootstrap}${langtools.tool.name}"/> |
68 <echo level="verbose" message="(Unset langtools.tool.name to build all tools)"/> |
67 <echo level="verbose" message="(Unset langtools.tool.name to build all tools)"/> |
69 <antcall target="build-${bootstrap}${langtools.tool.name}"/> |
68 <antcall target="build-${use_bootstrap}${langtools.tool.name}"/> |
70 </target> |
69 </target> |
71 |
70 |
72 <target name="-build-all" unless="langtools.tool.name"> |
71 <target name="-build-all" unless="langtools.tool.name"> |
73 <echo level="info" message="Building all tools"/> |
72 <echo level="info" message="Building all tools"/> |
74 <echo level="verbose" message="(Set langtools.tool.name to build a single tool)"/> |
73 <echo level="verbose" message="(Set langtools.tool.name to build a single tool)"/> |
95 the user. |
94 the user. |
96 --> |
95 --> |
97 |
96 |
98 <target name="run" depends="-check-target.java.home,build,-def-run,-get-tool-and-args" |
97 <target name="run" depends="-check-target.java.home,build,-def-run,-get-tool-and-args" |
99 description="run tool"> |
98 description="run tool"> |
100 <echo level="info" message="${bcp}"/> |
99 <echo level="info" message="${with_bootclasspath}"/> |
101 <echo level="info" message="Run ${bootstrap}${langtools.tool.name} with args ${langtools.tool.args}"/> |
100 <echo level="info" message="Run ${use_bootstrap}${langtools.tool.name} with args ${langtools.tool.args}"/> |
102 <run bcp="${bcp}" mainclass="com.sun.tools.${langtools.tool.name}.Main" args="${langtools.tool.args}"/> |
101 <run bcp="${with_bootclasspath}" mainclass="com.sun.tools.${langtools.tool.name}.Main" args="${langtools.tool.args}"/> |
103 </target> |
102 </target> |
104 |
103 |
105 <!-- Run a selected class. (action: run.single; shift-F6) --> |
104 <!-- Run a selected class. (action: run.single; shift-F6) --> |
106 |
105 |
107 <target name="run-single" depends="-check-target.java.home,-def-run"> |
106 <target name="run-single" depends="-check-target.java.home,-def-run"> |
143 </target> |
142 </target> |
144 |
143 |
145 <!-- Debug tool in NetBeans. --> |
144 <!-- Debug tool in NetBeans. --> |
146 |
145 |
147 <target name="debug" depends="-check-target.java.home,-def-run,-def-start-debugger,-get-tool-and-args,build" if="netbeans.home"> |
146 <target name="debug" depends="-check-target.java.home,-def-run,-def-start-debugger,-get-tool-and-args,build" if="netbeans.home"> |
148 <echo level="info" message="Debug ${boostrap}${langtools.tool.name} with args ${langtools.tool.args}"/> |
147 <echo level="info" message="Debug ${use_bootstrap}${langtools.tool.name} with args ${langtools.tool.args}"/> |
149 <start-debugger/> |
148 <start-debugger/> |
150 <run bcp="${bcp}" mainclass="com.sun.tools.${langtools.tool.name}.Main" args="${langtools.tool.args}" jpda.jvmargs="${jpda.jvmargs}"/> |
149 <run bcp="${with_bootclasspath}" mainclass="com.sun.tools.${langtools.tool.name}.Main" args="${langtools.tool.args}" jpda.jvmargs="${jpda.jvmargs}"/> |
151 </target> |
150 </target> |
152 |
151 |
153 <!-- Debug a selected class . --> |
152 <!-- Debug a selected class . --> |
154 <target name="debug-single" depends="-check-target.java.home,-def-start-debugger,-def-run"> |
153 <target name="debug-single" depends="-check-target.java.home,-def-start-debugger,-def-run"> |
155 <fail unless="debug.classname">Must set property 'debug.classname'</fail> |
154 <fail unless="debug.classname">Must set property 'debug.classname'</fail> |
235 <!-- Macro to run a tool or selected class - used by run* and debug* tasks --> |
234 <!-- Macro to run a tool or selected class - used by run* and debug* tasks --> |
236 <target name="-def-run"> |
235 <target name="-def-run"> |
237 <macrodef name="run"> |
236 <macrodef name="run"> |
238 <attribute name="mainclass"/> |
237 <attribute name="mainclass"/> |
239 <attribute name="args" default=""/> |
238 <attribute name="args" default=""/> |
240 <attribute name="bcp" default="${build.classes.dir}"/> |
239 <attribute name="bcp" default="${with_bootclasspath}"/> |
241 <attribute name="jpda.jvmargs" default=""/> |
240 <attribute name="jpda.jvmargs" default=""/> |
242 |
241 |
243 <sequential> |
242 <sequential> |
244 <java fork="true" jvm="${target.java}" classname="@{mainclass}"> |
243 <java fork="true" jvm="${target.java}" classname="@{mainclass}"> |
245 <jvmarg line="-Xbootclasspath/p:${bcp}"/> |
244 <jvmarg line="-Xbootclasspath/p:@{bcp}"/> |
246 <jvmarg line="@{jpda.jvmargs}"/> |
245 <jvmarg line="@{jpda.jvmargs}"/> |
247 <arg line="@{args}"/> |
246 <arg line="@{args}"/> |
248 </java> |
247 </java> |
249 </sequential> |
248 </sequential> |
250 </macrodef> |
249 </macrodef> |