您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

build-impl.xml 41KB

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