<target depends="-init-debug-args" name="-init-macrodef-debug"> <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3"> <attribute default="${main.class}" name="classname"/> <attribute default="${debug.classpath}" name="classpath"/> <element name="customize" optional="true"/> <element name="classpath-prepend" optional="true"/> <sequential> <java classname="@{classname}" dir="${work.dir}" fork="true"> <jvmarg line="${debug-args-line}"/> <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/> <jvmarg line="${run.jvmargs}"/> <classpath> <classpath-prepend/> <path path="@{classpath}"/> </classpath> <syspropertyset> <propertyref prefix="run-sys-prop."/> <mapper from="run-sys-prop.*" to="*" type="glob"/> </syspropertyset> <customize/> </java> </sequential> </macrodef> </target> <target name="-check-can-debug-tests" depends="init,compile-test" if="have.tests"> <condition property="debug.test.method"> <isset property="test.method"/> </condition> <condition property="debug.test.class"> <not> <isset property="test.method"/> </not> </condition> </target> <target name="-debug-start-debuggee-test-method" depends="-check-can-debug-tests" if="debug.test.method"> <fail unless="test.class">Must also set test.class if test.method is specified</fail> <fail message="Execution of a single test method is not supported by this version of Ant."> <condition> <not> <available classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultParser"> <classpath> <fileset dir="${ant.home}" includes="patches/*.jar"/> <path path="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar"/> </classpath> </available> </not> </condition> </fail> <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/> <delete file="${test.report.file}"/> <mkdir dir="${build.test.results.dir}"/> <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}"> <classpath-prepend> <fileset dir="${ant.home}" includes="patches/*.jar"/> </classpath-prepend> <customize> <syspropertyset> <propertyref prefix="test-sys-prop."/> <mapper from="test-sys-prop.*" to="*" type="glob"/> </syspropertyset> <arg value="${test.class}"/> <arg value="methods=${test.method}"/> <arg value="showoutput=true"/> <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/> <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/> </customize> </j2seproject3:debug> </target> <target name="-debug-start-debuggee-test-class" depends="-check-can-debug-tests" if="debug.test.class"> <fail unless="test.class">Must select one file in the IDE or set test.class</fail> <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/> <delete file="${test.report.file}"/> <mkdir dir="${build.test.results.dir}"/> <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}"> <customize> <syspropertyset> <propertyref prefix="test-sys-prop."/> <mapper from="test-sys-prop.*" to="*" type="glob"/> </syspropertyset> <arg value="${test.class}"/> <arg value="showoutput=true"/> <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/> <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/> </customize> </j2seproject3:debug> </target> <target name="-debug-start-debuggee-test" depends="-debug-start-debuggee-test-method,-debug-start-debuggee-test-class"/>