You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build-impl.xml 39KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  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. - junit compilation
  14. - junit execution
  15. - junit debugging
  16. - applet
  17. - cleanup
  18. -->
  19. <project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2" 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="DMDirc-impl">
  20. <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
  21. <!--
  22. ======================
  23. INITIALIZATION SECTION
  24. ======================
  25. -->
  26. <path id="all.libs">
  27. <fileset dir="modules/plugins/lib" includes="*.jar"/>
  28. <fileset dir="lib" includes="*.jar"/>
  29. </path>
  30. <property name="test_profile_dir" value="./test_profile"/>
  31. <target name="-pre-init">
  32. <!-- Empty placeholder for easier customization. -->
  33. <!-- You can override this target in the ../build.xml file. -->
  34. </target>
  35. <target depends="-pre-init" name="-init-private">
  36. <property file="nbproject/private/config.properties"/>
  37. <property file="nbproject/private/configs/${config}.properties"/>
  38. <property file="nbproject/private/private.properties"/>
  39. </target>
  40. <target depends="-pre-init,-init-private" name="-init-user">
  41. <property file="${user.properties.file}"/>
  42. <!-- The two properties below are usually overridden -->
  43. <!-- by the active platform. Just a fallback. -->
  44. <property name="default.javac.source" value="1.4"/>
  45. <property name="default.javac.target" value="1.4"/>
  46. </target>
  47. <target depends="-pre-init,-init-private,-init-user" name="-init-project">
  48. <property file="nbproject/configs/${config}.properties"/>
  49. <property file="nbproject/project.properties"/>
  50. </target>
  51. <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
  52. <available file="${manifest.file}" property="manifest.available"/>
  53. <condition property="manifest.available+main.class">
  54. <and>
  55. <isset property="manifest.available"/>
  56. <isset property="main.class"/>
  57. <not>
  58. <equals arg1="${main.class}" arg2="" trim="true"/>
  59. </not>
  60. </and>
  61. </condition>
  62. <condition property="have.tests">
  63. <and>
  64. <available file="${main.test.dir}"/>
  65. <available file="${parser.test.dir}"/>
  66. <available file="${plugins.test.dir}"/>
  67. <available file="${util.test.dir}"/>
  68. </and>
  69. </condition>
  70. <condition property="have.sources">
  71. <and>
  72. <available file="${main.src.dir}"/>
  73. <available file="${parser.src.dir}"/>
  74. <available file="${plugins.src.dir}"/>
  75. <available file="${util.src.dir}"/>
  76. </and>
  77. </condition>
  78. <condition property="netbeans.home+have.tests">
  79. <and>
  80. <isset property="netbeans.home"/>
  81. <isset property="have.tests"/>
  82. </and>
  83. </condition>
  84. <condition property="no.javadoc.preview">
  85. <and>
  86. <isset property="javadoc.preview"/>
  87. <isfalse value="${javadoc.preview}"/>
  88. </and>
  89. </condition>
  90. <property name="run.jvmargs" value=""/>
  91. <property name="javac.compilerargs" value=""/>
  92. <property name="work.dir" value="${basedir}"/>
  93. <condition property="no.deps">
  94. <and>
  95. <istrue value="${no.dependencies}"/>
  96. </and>
  97. </condition>
  98. <property name="javac.debug" value="true"/>
  99. <property name="javadoc.preview" value="true"/>
  100. <property name="application.args" value=""/>
  101. <property name="source.encoding" value="${file.encoding}"/>
  102. <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
  103. <and>
  104. <isset property="javadoc.encoding"/>
  105. <not>
  106. <equals arg1="${javadoc.encoding}" arg2=""/>
  107. </not>
  108. </and>
  109. </condition>
  110. <property name="javadoc.encoding.used" value="${source.encoding}"/>
  111. <property name="includes" value="**"/>
  112. <property name="excludes" value=""/>
  113. <property name="do.depend" value="true"/>
  114. <condition property="do.depend.true">
  115. <istrue value="${do.depend}"/>
  116. </condition>
  117. <fail unless="have.sources">Not all sources are available, have you run `git submodule init` and `git submodule update`</fail>
  118. </target>
  119. <target name="-post-init">
  120. <!-- Empty placeholder for easier customization. -->
  121. <!-- You can override this target in the ../build.xml file. -->
  122. </target>
  123. <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
  124. <fail unless="main.src.dir">Must set main.src.dir</fail>
  125. <fail unless="main.test.dir">Must set main.test.dir</fail>
  126. <fail unless="parser.src.dir">Must set parser.src.dir</fail>
  127. <fail unless="parser.test.dir">Must set parser.test.dir</fail>
  128. <fail unless="plugins.src.dir">Must set plugins.src.dir</fail>
  129. <fail unless="plugins.test.dir">Must set plugins.test.dir</fail>
  130. <fail unless="util.src.dir">Must set util.src.dir</fail>
  131. <fail unless="util.test.dir">Must set util.test.dir</fail>
  132. <fail unless="build.dir">Must set build.dir</fail>
  133. <fail unless="dist.dir">Must set dist.dir</fail>
  134. <fail unless="build.classes.dir">Must set build.classes.dir</fail>
  135. <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
  136. <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
  137. <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
  138. <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
  139. <fail unless="dist.jar">Must set dist.jar</fail>
  140. </target>
  141. <target name="-init-macrodef-property">
  142. <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
  143. <attribute name="name"/>
  144. <attribute name="value"/>
  145. <sequential>
  146. <property name="@{name}" value="${@{value}}"/>
  147. </sequential>
  148. </macrodef>
  149. </target>
  150. <target name="-init-macrodef-javac">
  151. <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
  152. <attribute default="${util.src.dir}:${parser.src.dir}:${main.src.dir}" name="srcdir"/>
  153. <attribute default="${build.classes.dir}" name="destdir"/>
  154. <attribute default="${javac.classpath}" name="classpath"/>
  155. <attribute default="${includes}" name="includes"/>
  156. <attribute default="${excludes}" name="excludes"/>
  157. <attribute default="${javac.debug}" name="debug"/>
  158. <attribute default="" name="javac.compilerargs.jaxws"/>
  159. <attribute default="" name="sourcepath"/>
  160. <element name="customize" optional="true"/>
  161. <sequential>
  162. <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}">
  163. <classpath refid="all.libs"/>
  164. <classpath>
  165. <path path="@{classpath}"/>
  166. </classpath>
  167. <compilerarg line="${javac.compilerargs} @{javac.compilerargs.jaxws}"/>
  168. <customize/>
  169. </javac>
  170. </sequential>
  171. </macrodef>
  172. <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
  173. <attribute default="${util.src.dir}:${parser.src.dir}:${main.src.dir}" name="srcdir"/>
  174. <attribute default="${build.classes.dir}" name="destdir"/>
  175. <attribute default="${javac.classpath}" name="classpath"/>
  176. <sequential>
  177. <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
  178. <classpath>
  179. <path path="@{classpath}"/>
  180. </classpath>
  181. <classpath refid="all.libs"/>
  182. </depend>
  183. </sequential>
  184. </macrodef>
  185. <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
  186. <attribute default="${build.classes.dir}" name="destdir"/>
  187. <sequential>
  188. <fail unless="javac.includes">Must set javac.includes</fail>
  189. <pathconvert pathsep="," property="javac.includes.binary">
  190. <path>
  191. <filelist dir="@{destdir}" files="${javac.includes}"/>
  192. </path>
  193. <globmapper from="*.java" to="*.class"/>
  194. </pathconvert>
  195. <delete>
  196. <files includes="${javac.includes.binary}"/>
  197. </delete>
  198. </sequential>
  199. </macrodef>
  200. </target>
  201. <target name="-init-macrodef-junit" depends="-init-macrodef-junit-clover,-init-macrodef-junit-noclover"/>
  202. <target name="-init-macrodef-junit-clover" if="clover.installed">
  203. <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
  204. <attribute default="${includes}" name="includes"/>
  205. <attribute default="${excludes}" name="excludes"/>
  206. <attribute default="**" name="testincludes"/>
  207. <sequential>
  208. <delete dir="${test_profile_dir}"/>
  209. <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" timeout="120000">
  210. <classpath>
  211. <pathelement path="${clover.jar}"/>
  212. </classpath>
  213. <env key="DMDIRC_HOME" value="${test_profile_dir}"/>
  214. <classpath refid="all.libs"/>
  215. <batchtest todir="${build.test.results.dir}">
  216. <clover-optimized-testset>
  217. <fileset dir="${main.test.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
  218. <filename name="@{testincludes}"/>
  219. </fileset>
  220. <fileset dir="${parser.test.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
  221. <filename name="@{testincludes}"/>
  222. </fileset>
  223. <fileset dir="${plugins.test.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
  224. <filename name="@{testincludes}"/>
  225. </fileset>
  226. <fileset dir="${util.test.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
  227. <filename name="@{testincludes}"/>
  228. </fileset>
  229. </clover-optimized-testset>
  230. <fileset dir="${main.test.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
  231. <filename name="**/DummyTest*"/>
  232. </fileset>
  233. </batchtest>
  234. <classpath>
  235. <path path="${run.test.classpath}"/>
  236. </classpath>
  237. <syspropertyset>
  238. <propertyref prefix="test-sys-prop."/>
  239. <mapper from="test-sys-prop.*" to="*" type="glob"/>
  240. </syspropertyset>
  241. <formatter type="brief" usefile="false"/>
  242. <formatter type="xml"/>
  243. <jvmarg line="${run.jvmargs}"/>
  244. </junit>
  245. <delete dir="${test_profile_dir}"/>
  246. </sequential>
  247. </macrodef>
  248. </target>
  249. <target name="-init-macrodef-junit-noclover" unless="clover.installed">
  250. <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
  251. <attribute default="${includes}" name="includes"/>
  252. <attribute default="${excludes}" name="excludes"/>
  253. <attribute default="**" name="testincludes"/>
  254. <sequential>
  255. <delete dir="${test_profile_dir}"/>
  256. <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" timeout="120000">
  257. <classpath refid="all.libs"/>
  258. <env key="DMDIRC_HOME" value="${test_profile_dir}"/>
  259. <batchtest todir="${build.test.results.dir}">
  260. <fileset dir="${main.test.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
  261. <filename name="@{testincludes}"/>
  262. </fileset>
  263. <fileset dir="${parser.test.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
  264. <filename name="@{testincludes}"/>
  265. </fileset>
  266. <fileset dir="${plugins.test.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
  267. <filename name="@{testincludes}"/>
  268. </fileset>
  269. <fileset dir="${util.test.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
  270. <filename name="@{testincludes}"/>
  271. </fileset>
  272. </batchtest>
  273. <classpath>
  274. <path path="${run.test.classpath}"/>
  275. </classpath>
  276. <syspropertyset>
  277. <propertyref prefix="test-sys-prop."/>
  278. <mapper from="test-sys-prop.*" to="*" type="glob"/>
  279. </syspropertyset>
  280. <formatter type="brief" usefile="false"/>
  281. <formatter type="xml"/>
  282. <jvmarg line="${run.jvmargs}"/>
  283. </junit>
  284. <delete dir="${test_profile_dir}"/>
  285. </sequential>
  286. </macrodef>
  287. </target>
  288. <target name="-init-macrodef-nbjpda">
  289. <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
  290. <attribute default="${main.class}" name="name"/>
  291. <attribute default="${debug.classpath}" name="classpath"/>
  292. <attribute default="" name="stopclassname"/>
  293. <sequential>
  294. <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="dt_socket">
  295. <classpath>
  296. <path path="@{classpath}"/>
  297. <path refid="all.libs"/>
  298. </classpath>
  299. </nbjpdastart>
  300. </sequential>
  301. </macrodef>
  302. <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
  303. <attribute default="${build.classes.dir}" name="dir"/>
  304. <sequential>
  305. <nbjpdareload>
  306. <fileset dir="@{dir}" includes="${fix.includes}*.class"/>
  307. </nbjpdareload>
  308. </sequential>
  309. </macrodef>
  310. </target>
  311. <target name="-init-debug-args">
  312. <property name="version-output" value="java version &quot;${ant.java.version}"/>
  313. <condition property="have-jdk-older-than-1.4">
  314. <or>
  315. <contains string="${version-output}" substring="java version &quot;1.0"/>
  316. <contains string="${version-output}" substring="java version &quot;1.1"/>
  317. <contains string="${version-output}" substring="java version &quot;1.2"/>
  318. <contains string="${version-output}" substring="java version &quot;1.3"/>
  319. </or>
  320. </condition>
  321. <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
  322. <istrue value="${have-jdk-older-than-1.4}"/>
  323. </condition>
  324. </target>
  325. <target depends="-init-debug-args" name="-init-macrodef-debug">
  326. <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
  327. <attribute default="${main.class}" name="classname"/>
  328. <attribute default="${debug.classpath}" name="classpath"/>
  329. <element name="customize" optional="true"/>
  330. <sequential>
  331. <java classname="@{classname}" dir="${work.dir}" fork="true">
  332. <classpath refid="all.libs"/>
  333. <jvmarg line="${debug-args-line}"/>
  334. <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
  335. <jvmarg line="${run.jvmargs}"/>
  336. <classpath>
  337. <path path="@{classpath}"/>
  338. </classpath>
  339. <syspropertyset>
  340. <propertyref prefix="run-sys-prop."/>
  341. <mapper from="run-sys-prop.*" to="*" type="glob"/>
  342. </syspropertyset>
  343. <customize/>
  344. </java>
  345. </sequential>
  346. </macrodef>
  347. </target>
  348. <target name="-init-macrodef-java">
  349. <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
  350. <attribute default="${main.class}" name="classname"/>
  351. <element name="customize" optional="true"/>
  352. <sequential>
  353. <java classname="@{classname}" dir="${work.dir}" fork="true">
  354. <classpath refid="all.libs"/>
  355. <jvmarg line="${run.jvmargs}"/>
  356. <classpath>
  357. <path path="${run.classpath}"/>
  358. </classpath>
  359. <syspropertyset>
  360. <propertyref prefix="run-sys-prop."/>
  361. <mapper from="run-sys-prop.*" to="*" type="glob"/>
  362. </syspropertyset>
  363. <customize/>
  364. </java>
  365. </sequential>
  366. </macrodef>
  367. </target>
  368. <target name="-init-presetdef-jar">
  369. <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
  370. <jar compress="${jar.compress}" jarfile="${dist.jar}">
  371. <j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.jar.excludes}"/>
  372. </jar>
  373. </presetdef>
  374. </target>
  375. <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar" name="init"/>
  376. <!--
  377. ===================
  378. COMPILATION SECTION
  379. ===================
  380. -->
  381. <target depends="init" name="deps-jar" unless="no.deps"/>
  382. <target depends="init,deps-jar" name="-pre-pre-compile">
  383. <mkdir dir="${build.classes.dir}"/>
  384. </target>
  385. <target name="-pre-compile">
  386. <!-- Empty placeholder for easier customization. -->
  387. <!-- You can override this target in the ../build.xml file. -->
  388. </target>
  389. <target if="do.depend.true" name="-compile-depend">
  390. <j2seproject3:depend/>
  391. </target>
  392. <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
  393. <j2seproject3:javac/>
  394. <copy todir="${build.classes.dir}">
  395. <fileset dir="${main.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  396. <fileset dir="${parser.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  397. <fileset dir="${util.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  398. </copy>
  399. </target>
  400. <target name="-post-compile">
  401. <!-- Empty placeholder for easier customization. -->
  402. <!-- You can override this target in the ../build.xml file. -->
  403. </target>
  404. <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
  405. <target name="-pre-compile-single">
  406. <!-- Empty placeholder for easier customization. -->
  407. <!-- You can override this target in the ../build.xml file. -->
  408. </target>
  409. <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
  410. <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  411. <j2seproject3:force-recompile/>
  412. <j2seproject3:javac excludes="" includes="${javac.includes}" sourcepath="${main.src.dir}:${parser.src.dir}:${plugins.src.dir}:${util.src.dir}"/>
  413. </target>
  414. <target name="-post-compile-single">
  415. <!-- Empty placeholder for easier customization. -->
  416. <!-- You can override this target in the ../build.xml file. -->
  417. </target>
  418. <target depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
  419. <!--
  420. ====================
  421. JAR BUILDING SECTION
  422. ====================
  423. -->
  424. <target depends="init" name="-pre-pre-jar">
  425. <dirname file="${dist.jar}" property="dist.jar.dir"/>
  426. <mkdir dir="${dist.jar.dir}"/>
  427. </target>
  428. <target name="-pre-jar">
  429. <!-- Empty placeholder for easier customization. -->
  430. <!-- You can override this target in the ../build.xml file. -->
  431. </target>
  432. <target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available">
  433. <j2seproject1:jar/>
  434. </target>
  435. <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
  436. <j2seproject1:jar manifest="${manifest.file}"/>
  437. </target>
  438. <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
  439. <j2seproject1:jar manifest="${manifest.file}">
  440. <j2seproject1:manifest>
  441. <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
  442. </j2seproject1:manifest>
  443. </j2seproject1:jar>
  444. </target>
  445. <target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries">
  446. <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  447. <pathconvert property="run.classpath.without.build.classes.dir">
  448. <path path="${run.classpath}"/>
  449. <map from="${build.classes.dir.resolved}" to=""/>
  450. </pathconvert>
  451. <pathconvert pathsep=" " property="jar.classpath">
  452. <path path="${run.classpath.without.build.classes.dir}"/>
  453. <chainedmapper>
  454. <flattenmapper/>
  455. <globmapper from="*" to="lib/*"/>
  456. </chainedmapper>
  457. </pathconvert>
  458. <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
  459. <copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
  460. <fileset dir="${build.classes.dir}" excludes="${dist.jar.excludes}" />
  461. <manifest>
  462. <attribute name="Main-Class" value="${main.class}"/>
  463. <attribute name="Class-Path" value="${jar.classpath}"/>
  464. </manifest>
  465. </copylibs>
  466. </target>
  467. <target name="-post-jar">
  468. <!-- Empty placeholder for easier customization. -->
  469. <!-- You can override this target in the ../build.xml file. -->
  470. </target>
  471. <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
  472. <!--
  473. =================
  474. EXECUTION SECTION
  475. =================
  476. -->
  477. <target depends="init,compile" description="Run a main class." name="run">
  478. <j2seproject1:java>
  479. <customize>
  480. <arg line="${application.args}"/>
  481. </customize>
  482. </j2seproject1:java>
  483. </target>
  484. <target name="-do-not-recompile">
  485. <property name="javac.includes.binary" value=""/>
  486. </target>
  487. <target depends="init,-do-not-recompile,compile-single" name="run-single">
  488. <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  489. <j2seproject1:java classname="${run.class}"/>
  490. </target>
  491. <!--
  492. =================
  493. DEBUGGING SECTION
  494. =================
  495. -->
  496. <target depends="init" if="netbeans.home" name="-debug-start-debugger">
  497. <j2seproject1:nbjpdastart name="${debug.class}"/>
  498. </target>
  499. <target depends="init,compile" name="-debug-start-debuggee">
  500. <j2seproject3:debug>
  501. <customize>
  502. <arg line="${application.args}"/>
  503. </customize>
  504. </j2seproject3:debug>
  505. </target>
  506. <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
  507. <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
  508. <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
  509. </target>
  510. <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
  511. <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
  512. <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  513. <j2seproject3:debug classname="${debug.class}"/>
  514. </target>
  515. <target depends="init,-do-not-recompile,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
  516. <target depends="init" name="-pre-debug-fix">
  517. <fail unless="fix.includes">Must set fix.includes</fail>
  518. <property name="javac.includes" value="${fix.includes}.java"/>
  519. </target>
  520. <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
  521. <j2seproject1:nbjpdareload/>
  522. </target>
  523. <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
  524. <!--
  525. ===============
  526. JAVADOC SECTION
  527. ===============
  528. -->
  529. <target depends="init" name="-javadoc-build">
  530. <mkdir dir="${dist.javadoc.dir}"/>
  531. <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="${javadoc.encoding.used}" destdir="${dist.javadoc.dir}" docencoding="${javadoc.encoding.used}" 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}">
  532. <classpath>
  533. <path path="${javac.classpath}"/>
  534. </classpath>
  535. <classpath refid="all.libs"/>
  536. <fileset dir="${main.src.dir}" excludes="${excludes}" includes="${includes}">
  537. <filename name="**/*.java"/>
  538. </fileset>
  539. <fileset dir="${parser.src.dir}" excludes="${excludes}" includes="${includes}">
  540. <filename name="**/*.java"/>
  541. </fileset>
  542. <fileset dir="${plugins.src.dir}" excludes="${excludes}" includes="${includes}">
  543. <filename name="**/*.java"/>
  544. </fileset>
  545. <fileset dir="${util.src.dir}" excludes="${excludes}" includes="${includes}">
  546. <filename name="**/*.java"/>
  547. </fileset>
  548. </javadoc>
  549. </target>
  550. <target name="move-javadoc-check">
  551. <condition property="move.javadoc">
  552. <isset property="javadoc.moveto"/>
  553. </condition>
  554. </target>
  555. <target name="move-javadoc" depends="move-javadoc-check" if="move.javadoc">
  556. <delete dir="${javadoc.moveto}"/>
  557. <move file="${dist.javadoc.dir}" tofile="${javadoc.moveto}"/>
  558. </target>
  559. <target depends="init,-doccheck-check" name="-doccheck-build" if="doccheck.run">
  560. <mkdir dir="${doccheck.dir}"/>
  561. <javadoc additionalparam="-doclet com.sun.tools.doclets.doccheck.DocCheck -docletpath ${doccheck.path} -skipPkg net.miginfocom.*" author="${javadoc.author}" destdir="${doccheck.dir}" failonerror="true" private="${javadoc.private}" source="${javac.source}" sourcepath="${main.src.dir}:${parser.src.dir}:${plugins.src.dir}:${util.src.dir}" useexternalfile="true" version="${javadoc.version}">
  562. <classpath>
  563. <path path="${javac.classpath}"/>
  564. </classpath>
  565. <classpath refid="all.libs"/>
  566. </javadoc>
  567. </target>
  568. <target name="-doccheck-check">
  569. <condition property="doccheck.run">
  570. <and>
  571. <isset property="doccheck.path"/>
  572. <isset property="doccheck.dir"/>
  573. <available file="${doccheck.path}"/>
  574. </and>
  575. </condition>
  576. </target>
  577. <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
  578. <nbbrowse file="${dist.javadoc.dir}/index.html"/>
  579. </target>
  580. <target depends="init,-javadoc-build,-javadoc-browse,move-javadoc,-doccheck-build" description="Build Javadoc." name="javadoc"/>
  581. <target depends="-doccheck-build" description="Build Javadoc error report (doccheck)." name="doccheck"/>
  582. <!--
  583. =========================
  584. JUNIT COMPILATION SECTION
  585. =========================
  586. -->
  587. <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
  588. <mkdir dir="${build.test.classes.dir}"/>
  589. </target>
  590. <target name="-pre-compile-test">
  591. <!-- Empty placeholder for easier customization. -->
  592. <!-- You can override this target in the ../build.xml file. -->
  593. </target>
  594. <target if="do.depend.true" name="-compile-test-depend">
  595. <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${main.test.dir}:${parser.test.dir}:${plugins.test.dir}:${util.test.dir}"/>
  596. </target>
  597. <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
  598. <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${main.test.dir}:${parser.test.dir}:${plugins.test.dir}:${util.test.dir}"/>
  599. <copy todir="${build.test.classes.dir}">
  600. <fileset dir="${main.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  601. <fileset dir="${parser.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  602. <fileset dir="${plugins.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  603. <fileset dir="${util.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  604. </copy>
  605. </target>
  606. <target name="-post-compile-test">
  607. <!-- Empty placeholder for easier customization. -->
  608. <!-- You can override this target in the ../build.xml file. -->
  609. </target>
  610. <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
  611. <target name="-pre-compile-test-single">
  612. <!-- Empty placeholder for easier customization. -->
  613. <!-- You can override this target in the ../build.xml file. -->
  614. </target>
  615. <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  616. <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  617. <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
  618. <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" sourcepath="${main.test.dir}:${parser.test.dir}:${plugins.test.dir}:${util.test.dir}" srcdir="${main.test.dir}:${parser.test.dir}:${plugins.test.dir}:${util.test.dir}"/>
  619. <copy todir="${build.test.classes.dir}">
  620. <fileset dir="${main.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  621. <fileset dir="${parser.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  622. <fileset dir="${plugins.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  623. <fileset dir="${util.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  624. </copy>
  625. </target>
  626. <target name="-post-compile-test-single">
  627. <!-- Empty placeholder for easier customization. -->
  628. <!-- You can override this target in the ../build.xml file. -->
  629. </target>
  630. <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
  631. <!--
  632. =======================
  633. JUNIT EXECUTION SECTION
  634. =======================
  635. -->
  636. <target depends="init" if="have.tests" name="-pre-test-run">
  637. <mkdir dir="${build.test.results.dir}"/>
  638. </target>
  639. <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
  640. <j2seproject3:junit testincludes="**/*Test.java"/>
  641. </target>
  642. <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
  643. <fail if="tests.failed">Some tests failed; see details above.</fail>
  644. </target>
  645. <target depends="init" if="have.tests" name="test-report"/>
  646. <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
  647. <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
  648. <target depends="init" if="have.tests" name="-pre-test-run-single">
  649. <mkdir dir="${build.test.results.dir}"/>
  650. </target>
  651. <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  652. <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  653. <j2seproject3:junit excludes="" includes="${test.includes}"/>
  654. </target>
  655. <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
  656. <fail if="tests.failed">Some tests failed; see details above.</fail>
  657. </target>
  658. <target depends="init,-do-not-recompile,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
  659. <!--
  660. =======================
  661. JUNIT DEBUGGING SECTION
  662. =======================
  663. -->
  664. <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
  665. <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  666. <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
  667. <delete file="${test.report.file}"/>
  668. <mkdir dir="${build.test.results.dir}"/>
  669. <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}">
  670. <customize>
  671. <syspropertyset>
  672. <propertyref prefix="test-sys-prop."/>
  673. <mapper from="test-sys-prop.*" to="*" type="glob"/>
  674. </syspropertyset>
  675. <arg value="${test.class}"/>
  676. <arg value="showoutput=true"/>
  677. <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
  678. <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
  679. </customize>
  680. </j2seproject3:debug>
  681. </target>
  682. <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
  683. <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
  684. </target>
  685. <target depends="init,-do-not-recompile,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
  686. <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
  687. <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
  688. </target>
  689. <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
  690. <!--
  691. =========================
  692. APPLET EXECUTION SECTION
  693. =========================
  694. -->
  695. <target depends="init,compile-single" name="run-applet">
  696. <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  697. <j2seproject1:java classname="sun.applet.AppletViewer">
  698. <customize>
  699. <arg value="${applet.url}"/>
  700. </customize>
  701. </j2seproject1:java>
  702. </target>
  703. <!--
  704. =========================
  705. APPLET DEBUGGING SECTION
  706. =========================
  707. -->
  708. <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
  709. <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  710. <j2seproject3:debug classname="sun.applet.AppletViewer">
  711. <customize>
  712. <arg value="${applet.url}"/>
  713. </customize>
  714. </j2seproject3:debug>
  715. </target>
  716. <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
  717. <!--
  718. ===============
  719. CLEANUP SECTION
  720. ===============
  721. -->
  722. <target depends="init" name="deps-clean" unless="no.deps"/>
  723. <target depends="init" name="-do-clean">
  724. <delete dir="${build.dir}"/>
  725. <delete dir="${dist.dir}"/>
  726. </target>
  727. <target name="-post-clean">
  728. <!-- Empty placeholder for easier customization. -->
  729. <!-- You can override this target in the ../build.xml file. -->
  730. </target>
  731. <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
  732. </project>