📄 common.xml
字号:
<mkdir dir="${build.test.unit.results.dir}"/> <junit showoutput="true" fork="true" failureproperty="tests.failed" errorproperty="tests.failed" filtertrace="${test.filter.trace}" tempdir="${build.test.unit.results.dir}"> <batchtest todir="${build.test.unit.results.dir}"> <fileset dir="${build.test.unit.classes.dir}"> <include name="**/*Test.class"/> </fileset> </batchtest> <classpath refid="test.unit.run.cp"/> <syspropertyset refid="test.unit.properties"/> <jvmarg value="-ea"/> <formatter type="brief" usefile="false"/> <formatter type="xml"/> </junit> <fail if="tests.failed">Some tests failed; see details above.</fail> </target> <target name="test-single" depends="init,test-init,test-build"> <fail unless="test.includes">Must set test.includes</fail> <mkdir dir="${build.test.unit.results.dir}"/> <junit showoutput="true" fork="true" failureproperty="tests.failed" errorproperty="tests.failed" filtertrace="${test.filter.trace}" tempdir="${build.test.unit.results.dir}"> <batchtest todir="${build.test.unit.results.dir}"> <fileset dir="${test.unit.src.dir}" includes="${test.includes}"/> </batchtest> <classpath refid="test.unit.run.cp"/> <syspropertyset refid="test.unit.properties"/> <!-- <assertions> does not seem to work in Ant 1.6.1? --> <jvmarg value="-ea"/> <formatter type="brief" usefile="false"/> <formatter type="xml"/> </junit> <fail if="tests.failed">Some tests failed; see details above.</fail> </target> <target name="do-debug-test-single"> <fail unless="test.class">Must set test.class</fail> <property name="test.report.file" location="${build.test.unit.results.dir}/TEST-${test.class}.xml"/> <delete file="${test.report.file}"/> <mkdir dir="${build.test.unit.results.dir}"/> <touch file="${test.report.file}" verbose="false"/> <!-- must exist, otherwise the XML formatter would fail --> <java fork="true" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner"> <jvmarg value="-Xdebug"/> <jvmarg value="-Xnoagent"/> <jvmarg value="-Djava.compiler=none"/> <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/> <jvmarg value="-ea"/> <classpath> <path refid="test.unit.run.cp"/> <pathelement location="${ant.home}/lib/ant.jar"/> <pathelement location="${ant.home}/lib/ant-junit.jar"/> </classpath> <syspropertyset refid="test.unit.properties"/> <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}"/> </java> </target> <target name="debug-test-single" depends="init,test-init,test-build,do-debug-test-single"/> <target name="debug-test-single-nb" depends="init,test-init,test-build,-jdk-presetdef-nbjpdastart" if="netbeans.home"> <fail unless="test.class">Must set test.class</fail> <nbjpdastart transport="dt_socket" addressproperty="jpda.address" name="${test.class}"> <classpath> <path refid="test.unit.run.cp"/> <!-- Permit extra sources to be searched even if they are not in the actual CP. --> <!-- Used e.g. from ant/test/unit since some tests use dynamic loading: --> <pathelement path="${test.unit.debug.cp.extra}"/> </classpath> </nbjpdastart> <antcall target="do-debug-test-single"/> </target> <target name="-pre-debug-fix" depends="init"> <fail unless="fix.class">Must set fix.class to e.g. org/netbeans/modules/foo/Bar</fail> <property name="javac.includes" value="${fix.class}.java"/> </target> <target name="debug-fix-nb" if="netbeans.home" depends="init,-pre-debug-fix,compile-single"> <nbjpdareload> <fileset includes="${fix.class}*.class" dir="${build.classes.dir}"/> </nbjpdareload> </target> <target name="debug-fix-test-nb" if="netbeans.home" depends="init,-pre-debug-fix,compile-test-single"> <nbjpdareload> <fileset includes="${fix.class}*.class" dir="${build.test.unit.classes.dir}"/> </nbjpdareload> </target> <target name="profile-test-single-nb" depends="init,test-init,test-build,-jdk-presetdef-nbprofiledirect"> <fail unless="profile.class">Must set profile.class</fail> <mkdir dir="${build.test.unit.results.dir}"/> <nbprofiledirect jvmargsproperty="profiler.jvmargs" > <classpath refid="test.unit.run.cp"/> </nbprofiledirect> <junit showoutput="true" fork="true" failureproperty="tests.failed" errorproperty="tests.failed" filtertrace="${test.filter.trace}"> <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/> <jvmarg value="${profiler.info.jvmargs.agent}"/> <jvmarg line="${profiler.info.jvmargs}"/> <test name="${profile.class}"/> <classpath refid="test.unit.run.cp"/> <syspropertyset refid="test.unit.properties"/> <!-- <assertions> does not seem to work in Ant 1.6.1? --> <jvmarg value="-ea"/> <formatter type="brief" usefile="false"/> <formatter type="xml"/> </junit> <fail if="tests.failed">Some tests failed; see details above.</fail> </target> <target name="-javadoc-init" depends="init"> <!-- #71884: default Javadoc title and header --> <property file="${manifest.mf}" prefix="mf."/> <property file="${src.dir}/${mf.OpenIDE-Module-Localizing-Bundle}" prefix="bundle."/> <condition property="javadoc.title" value="${bundle.OpenIDE-Module-Name}"> <isset property="bundle.OpenIDE-Module-Name"/> </condition> <property name="javadoc.title" value="${code.name.base.dashes}"/> <!-- fallback --> <condition property="mf.OpenIDE-Module-Specification-Version" value="${spec.version.base}"> <!-- fallback --> <isset property="spec.version.base"/> </condition> <property name="mf.OpenIDE-Module" value="${code.name.base.dashes}"/> <!-- fallback --> <property name="mf.OpenIDE-Module-Implementation-Version" value=""/> <!-- fallback --> <property name="javadoc.header" value="${mf.OpenIDE-Module} ${mf.OpenIDE-Module-Specification-Version} ${mf.OpenIDE-Module-Implementation-Version}"/> </target> <target name="arch" depends="init" description="Process an arch.xml, creating it if it does not yet exist."> <fail unless="javadoc.arch">You must define e.g. javadoc.arch=$${basedir}/arch.xml in project.properties</fail> <mkdir dir="build"/> <property name="arch.output.html" location="build/arch.html"/> <property name="arch.generate" value="true"/> <arch answers="${javadoc.arch}" output="${arch.output.html}" project="nbproject/project.xml" /> </target> <target name="-arch-nb-check"> <!-- #67438: might not yet exist, if arch file newly generated as skeleton --> <condition property="-arch-nb-run"> <and> <isset property="netbeans.home"/> <available file="${arch.output.html}"/> </and> </condition> </target> <target name="arch-nb" depends="init,arch,-arch-nb-check" if="-arch-nb-run" description="Process an arch.xml, creating it if it does not yet exist, and display the result."> <nbbrowse file="${arch.output.html}"/> </target> <target name="-testuserdir-delete-init" depends="files-init"> <property name="test.user.dir" location="build/testuserdir"/> <property name="test.user.dir.lock" location="${test.user.dir}/lock"/> <available property="app.running" file="${test.user.dir.lock}"/> </target> <target name="-testuserdir-delete-ok" depends="-testuserdir-delete-init" unless="app.running"> <delete dir="${test.user.dir}"/> </target> <target name="-testuserdir-delete-fail" depends="-testuserdir-delete-init" if="app.running"> <!-- #66799: best to warn about this condition... --> <fail>Will not delete ${test.user.dir} because ${test.user.dir.lock} still exists; kill any running process and delete lock file if necessary</fail> </target> <target name="testuserdir-delete" depends="-testuserdir-delete-ok,-testuserdir-delete-fail" description="Delete testing user directory (if the application is not running); clears any saved settings etc."/> <target name="clean" depends="files-init,testuserdir-delete,test-clean"> <delete failonerror="false" includeemptydirs="true"> <fileset dir="build"> <exclude name="testuserdir/"/> </fileset> </delete> <delete dir="${netbeans.javadoc.dir}/${code.name.base.dashes}"/> <delete file="${netbeans.javadoc.dir}/${code.name.base.dashes}.zip"/> <delete failonerror="false"> <!-- #59457: OK if cluster does not exist currently --> <fileset dir="${cluster}"> <patternset refid="module.files"/> </fileset> </delete> <delete file="${cluster}/update_tracking/${code.name.base.dashes}.xml"/> </target> <target name="fix-dependencies" depends="basic-init" > <property name="build.compiler.deprecation" value="false" /> <fixdependencies antfile="../../build.xml" buildtarget="netbeans" cleantarget="clean" failonerror="true" > <replace codenamebase="org.openide" addcompiletime="true" > <module codenamebase="org.openide.filesystems" spec="6.2"/> <module codenamebase="org.openide.util" spec="6.2"/> <module codenamebase="org.openide.util.enumerations" spec="6.2"/> <module codenamebase="org.openide.modules" spec="6.2"/> <module codenamebase="org.openide.nodes" spec="6.2"/> <module codenamebase="org.openide.explorer" spec="6.2"/> <module codenamebase="org.openide.awt" spec="6.2"/> <module codenamebase="org.openide.dialogs" spec="6.2"/> <module codenamebase="org.openide.compat" spec="6.2"/> <module codenamebase="org.openide.options" spec="6.2"/> <module codenamebase="org.openide.windows" spec="6.2"/> <module codenamebase="org.openide.text" spec="6.2"/> <module codenamebase="org.openide.actions" spec="6.2"/> <module codenamebase="org.openide.loaders" spec="5.3"/> </replace> <fileset dir="nbproject" > <include name="project.xml" /> </fileset> </fixdependencies> </target> <target name="fix-test-dependencies" depends="basic-init" description="It moves classpath for tests from project.properties to project.xml."> <fixtestdeps projectXml="nbproject/project.xml" propertiesFile="nbproject/project.properties"/> </target></project>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -