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 41KB

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