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

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