build-impl.xml 78 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. *** GENERATED FROM project.xml - DO NOT EDIT ***
  4. *** EDIT ../build.xml INSTEAD ***
  5. For the purpose of easier reading the script
  6. is divided into following sections:
  7. - initialization
  8. - compilation
  9. - jar
  10. - execution
  11. - debugging
  12. - javadoc
  13. - test compilation
  14. - test execution
  15. - test debugging
  16. - applet
  17. - cleanup
  18. -->
  19. <project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="javaUSB-impl">
  20. <fail message="Please build using Ant 1.8.0 or higher.">
  21. <condition>
  22. <not>
  23. <antversion atleast="1.8.0"/>
  24. </not>
  25. </condition>
  26. </fail>
  27. <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
  28. <!--
  29. ======================
  30. INITIALIZATION SECTION
  31. ======================
  32. -->
  33. <target name="-pre-init">
  34. <!-- Empty placeholder for easier customization. -->
  35. <!-- You can override this target in the ../build.xml file. -->
  36. </target>
  37. <target depends="-pre-init" name="-init-private">
  38. <property file="nbproject/private/config.properties"/>
  39. <property file="nbproject/private/configs/${config}.properties"/>
  40. <property file="nbproject/private/private.properties"/>
  41. </target>
  42. <target depends="-pre-init,-init-private" name="-init-user">
  43. <property file="${user.properties.file}"/>
  44. <!-- The two properties below are usually overridden -->
  45. <!-- by the active platform. Just a fallback. -->
  46. <property name="default.javac.source" value="1.4"/>
  47. <property name="default.javac.target" value="1.4"/>
  48. </target>
  49. <target depends="-pre-init,-init-private,-init-user" name="-init-project">
  50. <property file="nbproject/configs/${config}.properties"/>
  51. <property file="nbproject/project.properties"/>
  52. </target>
  53. <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
  54. <property name="platform.java" value="${java.home}/bin/java"/>
  55. <available file="${manifest.file}" property="manifest.available"/>
  56. <condition property="splashscreen.available">
  57. <and>
  58. <not>
  59. <equals arg1="${application.splash}" arg2="" trim="true"/>
  60. </not>
  61. <available file="${application.splash}"/>
  62. </and>
  63. </condition>
  64. <condition property="main.class.available">
  65. <and>
  66. <isset property="main.class"/>
  67. <not>
  68. <equals arg1="${main.class}" arg2="" trim="true"/>
  69. </not>
  70. </and>
  71. </condition>
  72. <condition property="profile.available">
  73. <and>
  74. <isset property="javac.profile"/>
  75. <length length="0" string="${javac.profile}" when="greater"/>
  76. <matches pattern="1\.[89](\..*)?" string="${javac.source}"/>
  77. </and>
  78. </condition>
  79. <condition property="do.archive">
  80. <or>
  81. <not>
  82. <istrue value="${jar.archive.disabled}"/>
  83. </not>
  84. <istrue value="${not.archive.disabled}"/>
  85. </or>
  86. </condition>
  87. <condition property="do.mkdist">
  88. <and>
  89. <isset property="do.archive"/>
  90. <isset property="libs.CopyLibs.classpath"/>
  91. <not>
  92. <istrue value="${mkdist.disabled}"/>
  93. </not>
  94. </and>
  95. </condition>
  96. <condition property="do.archive+manifest.available">
  97. <and>
  98. <isset property="manifest.available"/>
  99. <istrue value="${do.archive}"/>
  100. </and>
  101. </condition>
  102. <condition property="do.archive+main.class.available">
  103. <and>
  104. <isset property="main.class.available"/>
  105. <istrue value="${do.archive}"/>
  106. </and>
  107. </condition>
  108. <condition property="do.archive+splashscreen.available">
  109. <and>
  110. <isset property="splashscreen.available"/>
  111. <istrue value="${do.archive}"/>
  112. </and>
  113. </condition>
  114. <condition property="do.archive+profile.available">
  115. <and>
  116. <isset property="profile.available"/>
  117. <istrue value="${do.archive}"/>
  118. </and>
  119. </condition>
  120. <condition property="have.tests">
  121. <or>
  122. <available file="${test.src.dir}"/>
  123. </or>
  124. </condition>
  125. <condition property="have.sources">
  126. <or>
  127. <available file="${src.dir}"/>
  128. </or>
  129. </condition>
  130. <condition property="netbeans.home+have.tests">
  131. <and>
  132. <isset property="netbeans.home"/>
  133. <isset property="have.tests"/>
  134. </and>
  135. </condition>
  136. <condition property="no.javadoc.preview">
  137. <and>
  138. <isset property="javadoc.preview"/>
  139. <isfalse value="${javadoc.preview}"/>
  140. </and>
  141. </condition>
  142. <property name="run.jvmargs" value=""/>
  143. <property name="run.jvmargs.ide" value=""/>
  144. <property name="javac.compilerargs" value=""/>
  145. <property name="work.dir" value="${basedir}"/>
  146. <condition property="no.deps">
  147. <and>
  148. <istrue value="${no.dependencies}"/>
  149. </and>
  150. </condition>
  151. <property name="javac.debug" value="true"/>
  152. <property name="javadoc.preview" value="true"/>
  153. <property name="application.args" value=""/>
  154. <property name="source.encoding" value="${file.encoding}"/>
  155. <property name="runtime.encoding" value="${source.encoding}"/>
  156. <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
  157. <and>
  158. <isset property="javadoc.encoding"/>
  159. <not>
  160. <equals arg1="${javadoc.encoding}" arg2=""/>
  161. </not>
  162. </and>
  163. </condition>
  164. <property name="javadoc.encoding.used" value="${source.encoding}"/>
  165. <property name="includes" value="**"/>
  166. <property name="excludes" value=""/>
  167. <property name="do.depend" value="false"/>
  168. <condition property="do.depend.true">
  169. <istrue value="${do.depend}"/>
  170. </condition>
  171. <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
  172. <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
  173. <and>
  174. <isset property="endorsed.classpath"/>
  175. <not>
  176. <equals arg1="${endorsed.classpath}" arg2="" trim="true"/>
  177. </not>
  178. </and>
  179. </condition>
  180. <condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}">
  181. <isset property="profile.available"/>
  182. </condition>
  183. <condition else="false" property="jdkBug6558476">
  184. <and>
  185. <matches pattern="1\.[56]" string="${java.specification.version}"/>
  186. <not>
  187. <os family="unix"/>
  188. </not>
  189. </and>
  190. </condition>
  191. <condition else="false" property="javac.fork">
  192. <or>
  193. <istrue value="${jdkBug6558476}"/>
  194. <istrue value="${javac.external.vm}"/>
  195. </or>
  196. </condition>
  197. <property name="jar.index" value="false"/>
  198. <property name="jar.index.metainf" value="${jar.index}"/>
  199. <property name="copylibs.rebase" value="true"/>
  200. <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
  201. <condition property="junit.available">
  202. <or>
  203. <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
  204. <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
  205. </or>
  206. </condition>
  207. <condition property="testng.available">
  208. <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
  209. </condition>
  210. <condition property="junit+testng.available">
  211. <and>
  212. <istrue value="${junit.available}"/>
  213. <istrue value="${testng.available}"/>
  214. </and>
  215. </condition>
  216. <condition else="testng" property="testng.mode" value="mixed">
  217. <istrue value="${junit+testng.available}"/>
  218. </condition>
  219. <condition else="" property="testng.debug.mode" value="-mixed">
  220. <istrue value="${junit+testng.available}"/>
  221. </condition>
  222. <property name="java.failonerror" value="true"/>
  223. </target>
  224. <target name="-post-init">
  225. <!-- Empty placeholder for easier customization. -->
  226. <!-- You can override this target in the ../build.xml file. -->
  227. </target>
  228. <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
  229. <fail unless="src.dir">Must set src.dir</fail>
  230. <fail unless="test.src.dir">Must set test.src.dir</fail>
  231. <fail unless="build.dir">Must set build.dir</fail>
  232. <fail unless="dist.dir">Must set dist.dir</fail>
  233. <fail unless="build.classes.dir">Must set build.classes.dir</fail>
  234. <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
  235. <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
  236. <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
  237. <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
  238. <fail unless="dist.jar">Must set dist.jar</fail>
  239. </target>
  240. <target name="-init-macrodef-property">
  241. <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
  242. <attribute name="name"/>
  243. <attribute name="value"/>
  244. <sequential>
  245. <property name="@{name}" value="${@{value}}"/>
  246. </sequential>
  247. </macrodef>
  248. </target>
  249. <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
  250. <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
  251. <attribute default="${src.dir}" name="srcdir"/>
  252. <attribute default="${build.classes.dir}" name="destdir"/>
  253. <attribute default="${javac.classpath}" name="classpath"/>
  254. <attribute default="${javac.processorpath}" name="processorpath"/>
  255. <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
  256. <attribute default="${includes}" name="includes"/>
  257. <attribute default="${excludes}" name="excludes"/>
  258. <attribute default="${javac.debug}" name="debug"/>
  259. <attribute default="${empty.dir}" name="sourcepath"/>
  260. <attribute default="${empty.dir}" name="gensrcdir"/>
  261. <element name="customize" optional="true"/>
  262. <sequential>
  263. <property location="${build.dir}/empty" name="empty.dir"/>
  264. <mkdir dir="${empty.dir}"/>
  265. <mkdir dir="@{apgeneratedsrcdir}"/>
  266. <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
  267. <src>
  268. <dirset dir="@{gensrcdir}" erroronmissingdir="false">
  269. <include name="*"/>
  270. </dirset>
  271. </src>
  272. <classpath>
  273. <path path="@{classpath}"/>
  274. </classpath>
  275. <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
  276. <compilerarg line="${javac.profile.cmd.line.arg}"/>
  277. <compilerarg line="${javac.compilerargs}"/>
  278. <compilerarg value="-processorpath"/>
  279. <compilerarg path="@{processorpath}:${empty.dir}"/>
  280. <compilerarg line="${ap.processors.internal}"/>
  281. <compilerarg line="${annotation.processing.processor.options}"/>
  282. <compilerarg value="-s"/>
  283. <compilerarg path="@{apgeneratedsrcdir}"/>
  284. <compilerarg line="${ap.proc.none.internal}"/>
  285. <customize/>
  286. </javac>
  287. </sequential>
  288. </macrodef>
  289. </target>
  290. <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
  291. <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
  292. <attribute default="${src.dir}" name="srcdir"/>
  293. <attribute default="${build.classes.dir}" name="destdir"/>
  294. <attribute default="${javac.classpath}" name="classpath"/>
  295. <attribute default="${javac.processorpath}" name="processorpath"/>
  296. <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
  297. <attribute default="${includes}" name="includes"/>
  298. <attribute default="${excludes}" name="excludes"/>
  299. <attribute default="${javac.debug}" name="debug"/>
  300. <attribute default="${empty.dir}" name="sourcepath"/>
  301. <attribute default="${empty.dir}" name="gensrcdir"/>
  302. <element name="customize" optional="true"/>
  303. <sequential>
  304. <property location="${build.dir}/empty" name="empty.dir"/>
  305. <mkdir dir="${empty.dir}"/>
  306. <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
  307. <src>
  308. <dirset dir="@{gensrcdir}" erroronmissingdir="false">
  309. <include name="*"/>
  310. </dirset>
  311. </src>
  312. <classpath>
  313. <path path="@{classpath}"/>
  314. </classpath>
  315. <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
  316. <compilerarg line="${javac.profile.cmd.line.arg}"/>
  317. <compilerarg line="${javac.compilerargs}"/>
  318. <customize/>
  319. </javac>
  320. </sequential>
  321. </macrodef>
  322. </target>
  323. <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
  324. <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
  325. <attribute default="${src.dir}" name="srcdir"/>
  326. <attribute default="${build.classes.dir}" name="destdir"/>
  327. <attribute default="${javac.classpath}" name="classpath"/>
  328. <sequential>
  329. <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
  330. <classpath>
  331. <path path="@{classpath}"/>
  332. </classpath>
  333. </depend>
  334. </sequential>
  335. </macrodef>
  336. <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
  337. <attribute default="${build.classes.dir}" name="destdir"/>
  338. <sequential>
  339. <fail unless="javac.includes">Must set javac.includes</fail>
  340. <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
  341. <path>
  342. <filelist dir="@{destdir}" files="${javac.includes}"/>
  343. </path>
  344. <globmapper from="*.java" to="*.class"/>
  345. </pathconvert>
  346. <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
  347. <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
  348. <delete>
  349. <files includesfile="${javac.includesfile.binary}"/>
  350. </delete>
  351. <delete>
  352. <fileset file="${javac.includesfile.binary}"/>
  353. </delete>
  354. </sequential>
  355. </macrodef>
  356. </target>
  357. <target if="${junit.available}" name="-init-macrodef-junit-init">
  358. <condition else="false" property="nb.junit.batch" value="true">
  359. <and>
  360. <istrue value="${junit.available}"/>
  361. <not>
  362. <isset property="test.method"/>
  363. </not>
  364. </and>
  365. </condition>
  366. <condition else="false" property="nb.junit.single" value="true">
  367. <and>
  368. <istrue value="${junit.available}"/>
  369. <isset property="test.method"/>
  370. </and>
  371. </condition>
  372. </target>
  373. <target name="-init-test-properties">
  374. <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
  375. <property name="test.binarytestincludes" value=""/>
  376. <property name="test.binaryexcludes" value=""/>
  377. </target>
  378. <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
  379. <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
  380. <attribute default="${includes}" name="includes"/>
  381. <attribute default="${excludes}" name="excludes"/>
  382. <attribute default="**" name="testincludes"/>
  383. <attribute default="" name="testmethods"/>
  384. <element name="customize" optional="true"/>
  385. <sequential>
  386. <property name="junit.forkmode" value="perTest"/>
  387. <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
  388. <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
  389. <syspropertyset>
  390. <propertyref prefix="test-sys-prop."/>
  391. <mapper from="test-sys-prop.*" to="*" type="glob"/>
  392. </syspropertyset>
  393. <formatter type="brief" usefile="false"/>
  394. <formatter type="xml"/>
  395. <jvmarg value="-ea"/>
  396. <customize/>
  397. </junit>
  398. </sequential>
  399. </macrodef>
  400. </target>
  401. <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
  402. <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
  403. <attribute default="${includes}" name="includes"/>
  404. <attribute default="${excludes}" name="excludes"/>
  405. <attribute default="**" name="testincludes"/>
  406. <attribute default="" name="testmethods"/>
  407. <element name="customize" optional="true"/>
  408. <sequential>
  409. <property name="junit.forkmode" value="perTest"/>
  410. <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
  411. <batchtest todir="${build.test.results.dir}">
  412. <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
  413. <filename name="@{testincludes}"/>
  414. </fileset>
  415. <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
  416. <filename name="${test.binarytestincludes}"/>
  417. </fileset>
  418. </batchtest>
  419. <syspropertyset>
  420. <propertyref prefix="test-sys-prop."/>
  421. <mapper from="test-sys-prop.*" to="*" type="glob"/>
  422. </syspropertyset>
  423. <formatter type="brief" usefile="false"/>
  424. <formatter type="xml"/>
  425. <jvmarg value="-ea"/>
  426. <customize/>
  427. </junit>
  428. </sequential>
  429. </macrodef>
  430. </target>
  431. <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
  432. <target if="${testng.available}" name="-init-macrodef-testng">
  433. <macrodef name="testng" uri="http://www.netbeans.org/ns/j2se-project/3">
  434. <attribute default="${includes}" name="includes"/>
  435. <attribute default="${excludes}" name="excludes"/>
  436. <attribute default="**" name="testincludes"/>
  437. <attribute default="" name="testmethods"/>
  438. <element name="customize" optional="true"/>
  439. <sequential>
  440. <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
  441. <isset property="test.method"/>
  442. </condition>
  443. <union id="test.set">
  444. <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
  445. <filename name="@{testincludes}"/>
  446. </fileset>
  447. </union>
  448. <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
  449. <testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="javaUSB" testname="TestNG tests" workingDir="${work.dir}">
  450. <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
  451. <propertyset>
  452. <propertyref prefix="test-sys-prop."/>
  453. <mapper from="test-sys-prop.*" to="*" type="glob"/>
  454. </propertyset>
  455. <customize/>
  456. </testng>
  457. </sequential>
  458. </macrodef>
  459. </target>
  460. <target name="-init-macrodef-test-impl">
  461. <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
  462. <attribute default="${includes}" name="includes"/>
  463. <attribute default="${excludes}" name="excludes"/>
  464. <attribute default="**" name="testincludes"/>
  465. <attribute default="" name="testmethods"/>
  466. <element implicit="true" name="customize" optional="true"/>
  467. <sequential>
  468. <echo>No tests executed.</echo>
  469. </sequential>
  470. </macrodef>
  471. </target>
  472. <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
  473. <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
  474. <attribute default="${includes}" name="includes"/>
  475. <attribute default="${excludes}" name="excludes"/>
  476. <attribute default="**" name="testincludes"/>
  477. <attribute default="" name="testmethods"/>
  478. <element implicit="true" name="customize" optional="true"/>
  479. <sequential>
  480. <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
  481. <customize/>
  482. </j2seproject3:junit>
  483. </sequential>
  484. </macrodef>
  485. </target>
  486. <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
  487. <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
  488. <attribute default="${includes}" name="includes"/>
  489. <attribute default="${excludes}" name="excludes"/>
  490. <attribute default="**" name="testincludes"/>
  491. <attribute default="" name="testmethods"/>
  492. <element implicit="true" name="customize" optional="true"/>
  493. <sequential>
  494. <j2seproject3:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
  495. <customize/>
  496. </j2seproject3:testng>
  497. </sequential>
  498. </macrodef>
  499. </target>
  500. <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
  501. <macrodef name="test" uri="http://www.netbeans.org/ns/j2se-project/3">
  502. <attribute default="${includes}" name="includes"/>
  503. <attribute default="${excludes}" name="excludes"/>
  504. <attribute default="**" name="testincludes"/>
  505. <attribute default="" name="testmethods"/>
  506. <sequential>
  507. <j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
  508. <customize>
  509. <classpath>
  510. <path path="${run.test.classpath}"/>
  511. </classpath>
  512. <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  513. <jvmarg line="${run.jvmargs}"/>
  514. <jvmarg line="${run.jvmargs.ide}"/>
  515. </customize>
  516. </j2seproject3:test-impl>
  517. </sequential>
  518. </macrodef>
  519. </target>
  520. <target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}">
  521. <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
  522. <attribute default="${includes}" name="includes"/>
  523. <attribute default="${excludes}" name="excludes"/>
  524. <attribute default="**" name="testincludes"/>
  525. <attribute default="" name="testmethods"/>
  526. <element name="customize" optional="true"/>
  527. <sequential>
  528. <property name="junit.forkmode" value="perTest"/>
  529. <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
  530. <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
  531. <syspropertyset>
  532. <propertyref prefix="test-sys-prop."/>
  533. <mapper from="test-sys-prop.*" to="*" type="glob"/>
  534. </syspropertyset>
  535. <formatter type="brief" usefile="false"/>
  536. <formatter type="xml"/>
  537. <jvmarg value="-ea"/>
  538. <jvmarg line="${debug-args-line}"/>
  539. <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
  540. <customize/>
  541. </junit>
  542. </sequential>
  543. </macrodef>
  544. </target>
  545. <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
  546. <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
  547. <attribute default="${includes}" name="includes"/>
  548. <attribute default="${excludes}" name="excludes"/>
  549. <attribute default="**" name="testincludes"/>
  550. <attribute default="" name="testmethods"/>
  551. <element name="customize" optional="true"/>
  552. <sequential>
  553. <property name="junit.forkmode" value="perTest"/>
  554. <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
  555. <batchtest todir="${build.test.results.dir}">
  556. <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
  557. <filename name="@{testincludes}"/>
  558. </fileset>
  559. <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
  560. <filename name="${test.binarytestincludes}"/>
  561. </fileset>
  562. </batchtest>
  563. <syspropertyset>
  564. <propertyref prefix="test-sys-prop."/>
  565. <mapper from="test-sys-prop.*" to="*" type="glob"/>
  566. </syspropertyset>
  567. <formatter type="brief" usefile="false"/>
  568. <formatter type="xml"/>
  569. <jvmarg value="-ea"/>
  570. <jvmarg line="${debug-args-line}"/>
  571. <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
  572. <customize/>
  573. </junit>
  574. </sequential>
  575. </macrodef>
  576. </target>
  577. <target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
  578. <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
  579. <attribute default="${includes}" name="includes"/>
  580. <attribute default="${excludes}" name="excludes"/>
  581. <attribute default="**" name="testincludes"/>
  582. <attribute default="" name="testmethods"/>
  583. <element implicit="true" name="customize" optional="true"/>
  584. <sequential>
  585. <j2seproject3:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
  586. <customize/>
  587. </j2seproject3:junit-debug>
  588. </sequential>
  589. </macrodef>
  590. </target>
  591. <target if="${testng.available}" name="-init-macrodef-testng-debug">
  592. <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
  593. <attribute default="${main.class}" name="testClass"/>
  594. <attribute default="" name="testMethod"/>
  595. <element name="customize2" optional="true"/>
  596. <sequential>
  597. <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
  598. <isset property="test.method"/>
  599. </condition>
  600. <condition else="-suitename javaUSB -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
  601. <matches pattern=".*\.xml" string="@{testClass}"/>
  602. </condition>
  603. <delete dir="${build.test.results.dir}" quiet="true"/>
  604. <mkdir dir="${build.test.results.dir}"/>
  605. <j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}">
  606. <customize>
  607. <customize2/>
  608. <jvmarg value="-ea"/>
  609. <arg line="${testng.debug.mode}"/>
  610. <arg line="-d ${build.test.results.dir}"/>
  611. <arg line="-listener org.testng.reporters.VerboseReporter"/>
  612. <arg line="${testng.cmd.args}"/>
  613. </customize>
  614. </j2seproject3:debug>
  615. </sequential>
  616. </macrodef>
  617. </target>
  618. <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
  619. <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
  620. <attribute default="${main.class}" name="testClass"/>
  621. <attribute default="" name="testMethod"/>
  622. <element implicit="true" name="customize2" optional="true"/>
  623. <sequential>
  624. <j2seproject3:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
  625. <customize2/>
  626. </j2seproject3:testng-debug>
  627. </sequential>
  628. </macrodef>
  629. </target>
  630. <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
  631. <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
  632. <attribute default="${includes}" name="includes"/>
  633. <attribute default="${excludes}" name="excludes"/>
  634. <attribute default="**" name="testincludes"/>
  635. <attribute default="" name="testmethods"/>
  636. <attribute default="${main.class}" name="testClass"/>
  637. <attribute default="" name="testMethod"/>
  638. <sequential>
  639. <j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
  640. <customize>
  641. <classpath>
  642. <path path="${run.test.classpath}"/>
  643. </classpath>
  644. <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  645. <jvmarg line="${run.jvmargs}"/>
  646. <jvmarg line="${run.jvmargs.ide}"/>
  647. </customize>
  648. </j2seproject3:test-debug-impl>
  649. </sequential>
  650. </macrodef>
  651. </target>
  652. <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
  653. <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
  654. <attribute default="${includes}" name="includes"/>
  655. <attribute default="${excludes}" name="excludes"/>
  656. <attribute default="**" name="testincludes"/>
  657. <attribute default="" name="testmethods"/>
  658. <attribute default="${main.class}" name="testClass"/>
  659. <attribute default="" name="testMethod"/>
  660. <sequential>
  661. <j2seproject3:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
  662. <customize2>
  663. <syspropertyset>
  664. <propertyref prefix="test-sys-prop."/>
  665. <mapper from="test-sys-prop.*" to="*" type="glob"/>
  666. </syspropertyset>
  667. </customize2>
  668. </j2seproject3:testng-debug-impl>
  669. </sequential>
  670. </macrodef>
  671. </target>
  672. <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
  673. <!--
  674. pre NB7.2 profiling section; consider it deprecated
  675. -->
  676. <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
  677. <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
  678. <!-- Empty placeholder for easier customization. -->
  679. <!-- You can override this target in the ../build.xml file. -->
  680. </target>
  681. <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
  682. <!-- Empty placeholder for easier customization. -->
  683. <!-- You can override this target in the ../build.xml file. -->
  684. </target>
  685. <target if="profiler.info.jvmargs.agent" name="-profile-init-macrodef-profile">
  686. <macrodef name="resolve">
  687. <attribute name="name"/>
  688. <attribute name="value"/>
  689. <sequential>
  690. <property name="@{name}" value="${env.@{value}}"/>
  691. </sequential>
  692. </macrodef>
  693. <macrodef name="profile">
  694. <attribute default="${main.class}" name="classname"/>
  695. <element name="customize" optional="true"/>
  696. <sequential>
  697. <property environment="env"/>
  698. <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
  699. <java classname="@{classname}" dir="${profiler.info.dir}" failonerror="${java.failonerror}" fork="true" jvm="${profiler.info.jvm}">
  700. <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  701. <jvmarg value="${profiler.info.jvmargs.agent}"/>
  702. <jvmarg line="${profiler.info.jvmargs}"/>
  703. <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  704. <arg line="${application.args}"/>
  705. <classpath>
  706. <path path="${run.classpath}"/>
  707. </classpath>
  708. <syspropertyset>
  709. <propertyref prefix="run-sys-prop."/>
  710. <mapper from="run-sys-prop.*" to="*" type="glob"/>
  711. </syspropertyset>
  712. <customize/>
  713. </java>
  714. </sequential>
  715. </macrodef>
  716. </target>
  717. <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" if="profiler.info.jvmargs.agent" name="-profile-init-check">
  718. <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
  719. <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
  720. </target>
  721. <!--
  722. end of pre NB7.2 profiling section
  723. -->
  724. <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
  725. <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
  726. <attribute default="${main.class}" name="name"/>
  727. <attribute default="${debug.classpath}" name="classpath"/>
  728. <attribute default="" name="stopclassname"/>
  729. <sequential>
  730. <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
  731. <classpath>
  732. <path path="@{classpath}"/>
  733. </classpath>
  734. </nbjpdastart>
  735. </sequential>
  736. </macrodef>
  737. <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
  738. <attribute default="${build.classes.dir}" name="dir"/>
  739. <sequential>
  740. <nbjpdareload>
  741. <fileset dir="@{dir}" includes="${fix.classes}">
  742. <include name="${fix.includes}*.class"/>
  743. </fileset>
  744. </nbjpdareload>
  745. </sequential>
  746. </macrodef>
  747. </target>
  748. <target name="-init-debug-args">
  749. <property name="version-output" value="java version &quot;${ant.java.version}"/>
  750. <condition property="have-jdk-older-than-1.4">
  751. <or>
  752. <contains string="${version-output}" substring="java version &quot;1.0"/>
  753. <contains string="${version-output}" substring="java version &quot;1.1"/>
  754. <contains string="${version-output}" substring="java version &quot;1.2"/>
  755. <contains string="${version-output}" substring="java version &quot;1.3"/>
  756. </or>
  757. </condition>
  758. <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
  759. <istrue value="${have-jdk-older-than-1.4}"/>
  760. </condition>
  761. <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
  762. <os family="windows"/>
  763. </condition>
  764. <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
  765. <isset property="debug.transport"/>
  766. </condition>
  767. </target>
  768. <target depends="-init-debug-args" name="-init-macrodef-debug">
  769. <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
  770. <attribute default="${main.class}" name="classname"/>
  771. <attribute default="${debug.classpath}" name="classpath"/>
  772. <element name="customize" optional="true"/>
  773. <sequential>
  774. <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
  775. <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  776. <jvmarg line="${debug-args-line}"/>
  777. <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
  778. <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
  779. <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
  780. <jvmarg line="${run.jvmargs}"/>
  781. <jvmarg line="${run.jvmargs.ide}"/>
  782. <classpath>
  783. <path path="@{classpath}"/>
  784. </classpath>
  785. <syspropertyset>
  786. <propertyref prefix="run-sys-prop."/>
  787. <mapper from="run-sys-prop.*" to="*" type="glob"/>
  788. </syspropertyset>
  789. <customize/>
  790. </java>
  791. </sequential>
  792. </macrodef>
  793. </target>
  794. <target name="-init-macrodef-java">
  795. <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
  796. <attribute default="${main.class}" name="classname"/>
  797. <attribute default="${run.classpath}" name="classpath"/>
  798. <attribute default="jvm" name="jvm"/>
  799. <element name="customize" optional="true"/>
  800. <sequential>
  801. <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
  802. <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
  803. <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
  804. <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
  805. <jvmarg line="${run.jvmargs}"/>
  806. <jvmarg line="${run.jvmargs.ide}"/>
  807. <classpath>
  808. <path path="@{classpath}"/>
  809. </classpath>
  810. <syspropertyset>
  811. <propertyref prefix="run-sys-prop."/>
  812. <mapper from="run-sys-prop.*" to="*" type="glob"/>
  813. </syspropertyset>
  814. <customize/>
  815. </java>
  816. </sequential>
  817. </macrodef>
  818. </target>
  819. <target name="-init-macrodef-copylibs">
  820. <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
  821. <attribute default="${manifest.file}" name="manifest"/>
  822. <element name="customize" optional="true"/>
  823. <sequential>
  824. <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  825. <pathconvert property="run.classpath.without.build.classes.dir">
  826. <path path="${run.classpath}"/>
  827. <map from="${build.classes.dir.resolved}" to=""/>
  828. </pathconvert>
  829. <pathconvert pathsep=" " property="jar.classpath">
  830. <path path="${run.classpath.without.build.classes.dir}"/>
  831. <chainedmapper>
  832. <flattenmapper/>
  833. <filtermapper>
  834. <replacestring from=" " to="%20"/>
  835. </filtermapper>
  836. <globmapper from="*" to="lib/*"/>
  837. </chainedmapper>
  838. </pathconvert>
  839. <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
  840. <copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
  841. <fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
  842. <manifest>
  843. <attribute name="Class-Path" value="${jar.classpath}"/>
  844. <customize/>
  845. </manifest>
  846. </copylibs>
  847. </sequential>
  848. </macrodef>
  849. </target>
  850. <target name="-init-presetdef-jar">
  851. <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
  852. <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
  853. <j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
  854. </jar>
  855. </presetdef>
  856. </target>
  857. <target name="-init-ap-cmdline-properties">
  858. <property name="annotation.processing.enabled" value="true"/>
  859. <property name="annotation.processing.processors.list" value=""/>
  860. <property name="annotation.processing.processor.options" value=""/>
  861. <property name="annotation.processing.run.all.processors" value="true"/>
  862. <property name="javac.processorpath" value="${javac.classpath}"/>
  863. <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
  864. <condition property="ap.supported.internal" value="true">
  865. <not>
  866. <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
  867. </not>
  868. </condition>
  869. </target>
  870. <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
  871. <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
  872. <isfalse value="${annotation.processing.run.all.processors}"/>
  873. </condition>
  874. <condition else="" property="ap.proc.none.internal" value="-proc:none">
  875. <isfalse value="${annotation.processing.enabled}"/>
  876. </condition>
  877. </target>
  878. <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
  879. <property name="ap.cmd.line.internal" value=""/>
  880. </target>
  881. <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
  882. <!--
  883. ===================
  884. COMPILATION SECTION
  885. ===================
  886. -->
  887. <target name="-deps-jar-init" unless="built-jar.properties">
  888. <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
  889. <delete file="${built-jar.properties}" quiet="true"/>
  890. </target>
  891. <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
  892. <echo level="warn" message="Cycle detected: javaUSB was already built"/>
  893. </target>
  894. <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
  895. <mkdir dir="${build.dir}"/>
  896. <touch file="${built-jar.properties}" verbose="false"/>
  897. <property file="${built-jar.properties}" prefix="already.built.jar."/>
  898. <antcall target="-warn-already-built-jar"/>
  899. <propertyfile file="${built-jar.properties}">
  900. <entry key="${basedir}" value=""/>
  901. </propertyfile>
  902. </target>
  903. <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
  904. <target depends="init" name="-check-automatic-build">
  905. <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
  906. </target>
  907. <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
  908. <antcall target="clean"/>
  909. </target>
  910. <target depends="init,deps-jar" name="-pre-pre-compile">
  911. <mkdir dir="${build.classes.dir}"/>
  912. </target>
  913. <target name="-pre-compile">
  914. <!-- Empty placeholder for easier customization. -->
  915. <!-- You can override this target in the ../build.xml file. -->
  916. </target>
  917. <target if="do.depend.true" name="-compile-depend">
  918. <pathconvert property="build.generated.subdirs">
  919. <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  920. <include name="*"/>
  921. </dirset>
  922. </pathconvert>
  923. <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
  924. </target>
  925. <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
  926. <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
  927. <copy todir="${build.classes.dir}">
  928. <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  929. </copy>
  930. </target>
  931. <target if="has.persistence.xml" name="-copy-persistence-xml">
  932. <mkdir dir="${build.classes.dir}/META-INF"/>
  933. <copy todir="${build.classes.dir}/META-INF">
  934. <fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
  935. </copy>
  936. </target>
  937. <target name="-post-compile">
  938. <!-- Empty placeholder for easier customization. -->
  939. <!-- You can override this target in the ../build.xml file. -->
  940. </target>
  941. <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
  942. <target name="-pre-compile-single">
  943. <!-- Empty placeholder for easier customization. -->
  944. <!-- You can override this target in the ../build.xml file. -->
  945. </target>
  946. <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
  947. <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  948. <j2seproject3:force-recompile/>
  949. <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
  950. </target>
  951. <target name="-post-compile-single">
  952. <!-- Empty placeholder for easier customization. -->
  953. <!-- You can override this target in the ../build.xml file. -->
  954. </target>
  955. <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
  956. <!--
  957. ====================
  958. JAR BUILDING SECTION
  959. ====================
  960. -->
  961. <target depends="init" name="-pre-pre-jar">
  962. <dirname file="${dist.jar}" property="dist.jar.dir"/>
  963. <mkdir dir="${dist.jar.dir}"/>
  964. </target>
  965. <target name="-pre-jar">
  966. <!-- Empty placeholder for easier customization. -->
  967. <!-- You can override this target in the ../build.xml file. -->
  968. </target>
  969. <target depends="init" if="do.archive" name="-do-jar-create-manifest" unless="manifest.available">
  970. <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  971. <touch file="${tmp.manifest.file}" verbose="false"/>
  972. </target>
  973. <target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
  974. <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  975. <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
  976. </target>
  977. <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass">
  978. <manifest file="${tmp.manifest.file}" mode="update">
  979. <attribute name="Main-Class" value="${main.class}"/>
  980. </manifest>
  981. </target>
  982. <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile">
  983. <manifest file="${tmp.manifest.file}" mode="update">
  984. <attribute name="Profile" value="${javac.profile}"/>
  985. </manifest>
  986. </target>
  987. <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-set-splashscreen">
  988. <basename file="${application.splash}" property="splashscreen.basename"/>
  989. <mkdir dir="${build.classes.dir}/META-INF"/>
  990. <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
  991. <manifest file="${tmp.manifest.file}" mode="update">
  992. <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
  993. </manifest>
  994. </target>
  995. <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.mkdist" name="-do-jar-copylibs">
  996. <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
  997. <echo level="info">To run this application from the command line without Ant, try:</echo>
  998. <property location="${dist.jar}" name="dist.jar.resolved"/>
  999. <echo level="info">java -jar "${dist.jar.resolved}"</echo>
  1000. </target>
  1001. <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
  1002. <j2seproject1:jar manifest="${tmp.manifest.file}"/>
  1003. <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  1004. <property location="${dist.jar}" name="dist.jar.resolved"/>
  1005. <pathconvert property="run.classpath.with.dist.jar">
  1006. <path path="${run.classpath}"/>
  1007. <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
  1008. </pathconvert>
  1009. <condition else="" property="jar.usage.message" value="To run this application from the command line without Ant, try:${line.separator}${platform.java} -cp ${run.classpath.with.dist.jar} ${main.class}">
  1010. <isset property="main.class.available"/>
  1011. </condition>
  1012. <condition else="debug" property="jar.usage.level" value="info">
  1013. <isset property="main.class.available"/>
  1014. </condition>
  1015. <echo level="${jar.usage.level}" message="${jar.usage.message}"/>
  1016. </target>
  1017. <target depends="-do-jar-copylibs" if="do.archive" name="-do-jar-delete-manifest">
  1018. <delete>
  1019. <fileset file="${tmp.manifest.file}"/>
  1020. </delete>
  1021. </target>
  1022. <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-jar,-do-jar-delete-manifest" name="-do-jar-without-libraries"/>
  1023. <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-copylibs,-do-jar-delete-manifest" name="-do-jar-with-libraries"/>
  1024. <target name="-post-jar">
  1025. <!-- Empty placeholder for easier customization. -->
  1026. <!-- You can override this target in the ../build.xml file. -->
  1027. </target>
  1028. <target depends="init,compile,-pre-jar,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
  1029. <target depends="init,compile,-pre-jar,-do-jar,-post-jar" description="Build JAR." name="jar"/>
  1030. <!--
  1031. =================
  1032. EXECUTION SECTION
  1033. =================
  1034. -->
  1035. <target depends="init,compile" description="Run a main class." name="run">
  1036. <j2seproject1:java>
  1037. <customize>
  1038. <arg line="${application.args}"/>
  1039. </customize>
  1040. </j2seproject1:java>
  1041. </target>
  1042. <target name="-do-not-recompile">
  1043. <property name="javac.includes.binary" value=""/>
  1044. </target>
  1045. <target depends="init,compile-single" name="run-single">
  1046. <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  1047. <j2seproject1:java classname="${run.class}"/>
  1048. </target>
  1049. <target depends="init,compile-test-single" name="run-test-with-main">
  1050. <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  1051. <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
  1052. </target>
  1053. <!--
  1054. =================
  1055. DEBUGGING SECTION
  1056. =================
  1057. -->
  1058. <target depends="init" if="netbeans.home" name="-debug-start-debugger">
  1059. <j2seproject1:nbjpdastart name="${debug.class}"/>
  1060. </target>
  1061. <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
  1062. <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
  1063. </target>
  1064. <target depends="init,compile" name="-debug-start-debuggee">
  1065. <j2seproject3:debug>
  1066. <customize>
  1067. <arg line="${application.args}"/>
  1068. </customize>
  1069. </j2seproject3:debug>
  1070. </target>
  1071. <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
  1072. <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
  1073. <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
  1074. </target>
  1075. <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
  1076. <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
  1077. <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  1078. <j2seproject3:debug classname="${debug.class}"/>
  1079. </target>
  1080. <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
  1081. <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
  1082. <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  1083. <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
  1084. </target>
  1085. <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
  1086. <target depends="init" name="-pre-debug-fix">
  1087. <fail unless="fix.includes">Must set fix.includes</fail>
  1088. <property name="javac.includes" value="${fix.includes}.java"/>
  1089. </target>
  1090. <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
  1091. <j2seproject1:nbjpdareload/>
  1092. </target>
  1093. <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
  1094. <!--
  1095. =================
  1096. PROFILING SECTION
  1097. =================
  1098. -->
  1099. <!--
  1100. pre NB7.2 profiler integration
  1101. -->
  1102. <target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
  1103. <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  1104. <nbprofiledirect>
  1105. <classpath>
  1106. <path path="${run.classpath}"/>
  1107. </classpath>
  1108. </nbprofiledirect>
  1109. <profile/>
  1110. </target>
  1111. <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72">
  1112. <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
  1113. <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  1114. <nbprofiledirect>
  1115. <classpath>
  1116. <path path="${run.classpath}"/>
  1117. </classpath>
  1118. </nbprofiledirect>
  1119. <profile classname="${profile.class}"/>
  1120. </target>
  1121. <target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72">
  1122. <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  1123. <nbprofiledirect>
  1124. <classpath>
  1125. <path path="${run.classpath}"/>
  1126. </classpath>
  1127. </nbprofiledirect>
  1128. <profile classname="sun.applet.AppletViewer">
  1129. <customize>
  1130. <arg value="${applet.url}"/>
  1131. </customize>
  1132. </profile>
  1133. </target>
  1134. <target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
  1135. <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  1136. <nbprofiledirect>
  1137. <classpath>
  1138. <path path="${run.test.classpath}"/>
  1139. </classpath>
  1140. </nbprofiledirect>
  1141. <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
  1142. <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  1143. <jvmarg value="${profiler.info.jvmargs.agent}"/>
  1144. <jvmarg line="${profiler.info.jvmargs}"/>
  1145. <test name="${profile.class}"/>
  1146. <classpath>
  1147. <path path="${run.test.classpath}"/>
  1148. </classpath>
  1149. <syspropertyset>
  1150. <propertyref prefix="test-sys-prop."/>
  1151. <mapper from="test-sys-prop.*" to="*" type="glob"/>
  1152. </syspropertyset>
  1153. <formatter type="brief" usefile="false"/>
  1154. <formatter type="xml"/>
  1155. </junit>
  1156. </target>
  1157. <!--
  1158. end of pre NB72 profiling section
  1159. -->
  1160. <target if="netbeans.home" name="-profile-check">
  1161. <condition property="profiler.configured">
  1162. <or>
  1163. <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
  1164. <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
  1165. </or>
  1166. </condition>
  1167. </target>
  1168. <target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
  1169. <startprofiler/>
  1170. <antcall target="run"/>
  1171. </target>
  1172. <target depends="-profile-check,-profile-single-pre72" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-single" unless="profiler.info.jvmargs.agent">
  1173. <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  1174. <startprofiler/>
  1175. <antcall target="run-single"/>
  1176. </target>
  1177. <target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/>
  1178. <target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs">
  1179. <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  1180. <startprofiler/>
  1181. <antcall target="test-single"/>
  1182. </target>
  1183. <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
  1184. <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  1185. <startprofiler/>
  1186. <antcal target="run-test-with-main"/>
  1187. </target>
  1188. <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
  1189. <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  1190. <startprofiler/>
  1191. <antcall target="run-applet"/>
  1192. </target>
  1193. <!--
  1194. ===============
  1195. JAVADOC SECTION
  1196. ===============
  1197. -->
  1198. <target depends="init" if="have.sources" name="-javadoc-build">
  1199. <mkdir dir="${dist.javadoc.dir}"/>
  1200. <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
  1201. <and>
  1202. <isset property="endorsed.classpath.cmd.line.arg"/>
  1203. <not>
  1204. <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
  1205. </not>
  1206. </and>
  1207. </condition>
  1208. <condition else="" property="bug5101868workaround" value="*.java">
  1209. <matches pattern="1\.[56](\..*)?" string="${java.version}"/>
  1210. </condition>
  1211. <javadoc additionalparam="-J-Dfile.encoding=${file.encoding} ${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
  1212. <classpath>
  1213. <path path="${javac.classpath}"/>
  1214. </classpath>
  1215. <fileset dir="${src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
  1216. <filename name="**/*.java"/>
  1217. </fileset>
  1218. <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  1219. <include name="**/*.java"/>
  1220. <exclude name="*.java"/>
  1221. </fileset>
  1222. <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
  1223. </javadoc>
  1224. <copy todir="${dist.javadoc.dir}">
  1225. <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
  1226. <filename name="**/doc-files/**"/>
  1227. </fileset>
  1228. <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  1229. <include name="**/doc-files/**"/>
  1230. </fileset>
  1231. </copy>
  1232. </target>
  1233. <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
  1234. <nbbrowse file="${dist.javadoc.dir}/index.html"/>
  1235. </target>
  1236. <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
  1237. <!--
  1238. =========================
  1239. TEST COMPILATION SECTION
  1240. =========================
  1241. -->
  1242. <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
  1243. <mkdir dir="${build.test.classes.dir}"/>
  1244. </target>
  1245. <target name="-pre-compile-test">
  1246. <!-- Empty placeholder for easier customization. -->
  1247. <!-- You can override this target in the ../build.xml file. -->
  1248. </target>
  1249. <target if="do.depend.true" name="-compile-test-depend">
  1250. <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  1251. </target>
  1252. <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
  1253. <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
  1254. <copy todir="${build.test.classes.dir}">
  1255. <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  1256. </copy>
  1257. </target>
  1258. <target name="-post-compile-test">
  1259. <!-- Empty placeholder for easier customization. -->
  1260. <!-- You can override this target in the ../build.xml file. -->
  1261. </target>
  1262. <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
  1263. <target name="-pre-compile-test-single">
  1264. <!-- Empty placeholder for easier customization. -->
  1265. <!-- You can override this target in the ../build.xml file. -->
  1266. </target>
  1267. <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  1268. <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  1269. <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
  1270. <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
  1271. <copy todir="${build.test.classes.dir}">
  1272. <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  1273. </copy>
  1274. </target>
  1275. <target name="-post-compile-test-single">
  1276. <!-- Empty placeholder for easier customization. -->
  1277. <!-- You can override this target in the ../build.xml file. -->
  1278. </target>
  1279. <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
  1280. <!--
  1281. =======================
  1282. TEST EXECUTION SECTION
  1283. =======================
  1284. -->
  1285. <target depends="init" if="have.tests" name="-pre-test-run">
  1286. <mkdir dir="${build.test.results.dir}"/>
  1287. </target>
  1288. <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
  1289. <j2seproject3:test includes="${includes}" testincludes="**/*Test.java"/>
  1290. </target>
  1291. <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
  1292. <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  1293. </target>
  1294. <target depends="init" if="have.tests" name="test-report"/>
  1295. <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
  1296. <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
  1297. <target depends="init" if="have.tests" name="-pre-test-run-single">
  1298. <mkdir dir="${build.test.results.dir}"/>
  1299. </target>
  1300. <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  1301. <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  1302. <j2seproject3:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
  1303. </target>
  1304. <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
  1305. <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  1306. </target>
  1307. <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
  1308. <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
  1309. <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
  1310. <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
  1311. <j2seproject3:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
  1312. </target>
  1313. <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
  1314. <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  1315. </target>
  1316. <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
  1317. <!--
  1318. =======================
  1319. TEST DEBUGGING SECTION
  1320. =======================
  1321. -->
  1322. <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
  1323. <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  1324. <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
  1325. </target>
  1326. <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
  1327. <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  1328. <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
  1329. <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
  1330. </target>
  1331. <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
  1332. <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
  1333. </target>
  1334. <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
  1335. <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
  1336. <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
  1337. <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
  1338. </target>
  1339. <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
  1340. <!--
  1341. =========================
  1342. APPLET EXECUTION SECTION
  1343. =========================
  1344. -->
  1345. <target depends="init,compile-single" name="run-applet">
  1346. <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  1347. <j2seproject1:java classname="sun.applet.AppletViewer">
  1348. <customize>
  1349. <arg value="${applet.url}"/>
  1350. </customize>
  1351. </j2seproject1:java>
  1352. </target>
  1353. <!--
  1354. =========================
  1355. APPLET DEBUGGING SECTION
  1356. =========================
  1357. -->
  1358. <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
  1359. <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  1360. <j2seproject3:debug classname="sun.applet.AppletViewer">
  1361. <customize>
  1362. <arg value="${applet.url}"/>
  1363. </customize>
  1364. </j2seproject3:debug>
  1365. </target>
  1366. <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
  1367. <!--
  1368. ===============
  1369. CLEANUP SECTION
  1370. ===============
  1371. -->
  1372. <target name="-deps-clean-init" unless="built-clean.properties">
  1373. <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
  1374. <delete file="${built-clean.properties}" quiet="true"/>
  1375. </target>
  1376. <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
  1377. <echo level="warn" message="Cycle detected: javaUSB was already built"/>
  1378. </target>
  1379. <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
  1380. <mkdir dir="${build.dir}"/>
  1381. <touch file="${built-clean.properties}" verbose="false"/>
  1382. <property file="${built-clean.properties}" prefix="already.built.clean."/>
  1383. <antcall target="-warn-already-built-clean"/>
  1384. <propertyfile file="${built-clean.properties}">
  1385. <entry key="${basedir}" value=""/>
  1386. </propertyfile>
  1387. </target>
  1388. <target depends="init" name="-do-clean">
  1389. <delete dir="${build.dir}"/>
  1390. <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
  1391. </target>
  1392. <target name="-post-clean">
  1393. <!-- Empty placeholder for easier customization. -->
  1394. <!-- You can override this target in the ../build.xml file. -->
  1395. </target>
  1396. <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
  1397. <target name="-check-call-dep">
  1398. <property file="${call.built.properties}" prefix="already.built."/>
  1399. <condition property="should.call.dep">
  1400. <and>
  1401. <not>
  1402. <isset property="already.built.${call.subproject}"/>
  1403. </not>
  1404. <available file="${call.script}"/>
  1405. </and>
  1406. </condition>
  1407. </target>
  1408. <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
  1409. <ant antfile="${call.script}" inheritall="false" target="${call.target}">
  1410. <propertyset>
  1411. <propertyref prefix="transfer."/>
  1412. <mapper from="transfer.*" to="*" type="glob"/>
  1413. </propertyset>
  1414. </ant>
  1415. </target>
  1416. </project>