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

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