build-impl.xml 80 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451
  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="Mephorce-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="Mephorce" 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 Mephorce -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.spring-framework400.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
  999. <copyfiles files="${libs.jstl.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
  1000. <copyfiles files="${libs.hibernate4-support.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
  1001. <copyfiles files="${libs.jpa2-persistence.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
  1002. <mkdir dir="${build.web.dir}/META-INF"/>
  1003. <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/>
  1004. </target>
  1005. <target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
  1006. <copyfiles files="${libs.spring-framework400.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
  1007. <copyfiles files="${libs.jstl.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
  1008. <copyfiles files="${libs.hibernate4-support.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
  1009. <copyfiles files="${libs.jpa2-persistence.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
  1010. </target>
  1011. <target depends="init" if="dist.ear.dir" name="-clean-webinf-lib">
  1012. <delete dir="${build.web.dir}/WEB-INF/lib"/>
  1013. </target>
  1014. <target depends="init,-clean-webinf-lib,compile,compile-jsps,-pre-dist,library-inclusion-in-manifest" if="do.tmp.war.package" name="do-ear-dist">
  1015. <dirname file="${dist.ear.war}" property="dist.jar.dir"/>
  1016. <mkdir dir="${dist.jar.dir}"/>
  1017. <jar compress="${jar.compress}" jarfile="${dist.ear.war}" manifest="${build.web.dir}/META-INF/MANIFEST.MF">
  1018. <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
  1019. </jar>
  1020. </target>
  1021. <target name="-post-dist">
  1022. <!-- Empty placeholder for easier customization. -->
  1023. <!-- You can override this target in the ../build.xml file. -->
  1024. </target>
  1025. <target depends="init,compile,-pre-dist,do-dist,-post-dist" description="Build distribution (WAR)." name="dist"/>
  1026. <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"/>
  1027. <!--
  1028. EXECUTION SECTION
  1029. -->
  1030. <target depends="run-deploy,run-display-browser" description="Deploy to server and show in browser." name="run"/>
  1031. <target name="-pre-run-deploy">
  1032. <!-- Empty placeholder for easier customization. -->
  1033. <!-- You can override this target in the ../build.xml file. -->
  1034. </target>
  1035. <target name="-post-run-deploy">
  1036. <!-- Empty placeholder for easier customization. -->
  1037. <!-- You can override this target in the ../build.xml file. -->
  1038. </target>
  1039. <target name="-pre-nbmodule-run-deploy">
  1040. <!-- Empty placeholder for easier customization. -->
  1041. <!-- This target can be overriden by NetBeans modules. Don't override it directly, use -pre-run-deploy task instead. -->
  1042. </target>
  1043. <target name="-post-nbmodule-run-deploy">
  1044. <!-- Empty placeholder for easier customization. -->
  1045. <!-- This target can be overriden by NetBeans modules. Don't override it directly, use -post-run-deploy task instead. -->
  1046. </target>
  1047. <target name="-run-deploy-am">
  1048. <!-- Task to deploy to the Access Manager runtime. -->
  1049. </target>
  1050. <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"/>
  1051. <target if="netbeans.home" name="-run-deploy-nb">
  1052. <nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
  1053. </target>
  1054. <target name="-init-deploy-ant" unless="netbeans.home">
  1055. <property name="deploy.ant.archive" value="${dist.war}"/>
  1056. <property name="deploy.ant.docbase.dir" value="${web.docbase.dir}"/>
  1057. <property name="deploy.ant.resource.dir" value="${resource.dir}"/>
  1058. <property name="deploy.ant.enabled" value="true"/>
  1059. </target>
  1060. <target depends="dist,-run-undeploy-nb,-init-deploy-ant,-undeploy-ant" name="run-undeploy"/>
  1061. <target if="netbeans.home" name="-run-undeploy-nb">
  1062. <fail message="Undeploy is not supported from within the IDE"/>
  1063. </target>
  1064. <target depends="init,-pre-dist,dist,-post-dist" name="verify">
  1065. <nbverify file="${dist.war}"/>
  1066. </target>
  1067. <target depends="run-deploy,-init-display-browser,-display-browser-nb-old,-display-browser-nb,-display-browser-cl" name="run-display-browser"/>
  1068. <target if="do.display.browser" name="-init-display-browser">
  1069. <condition property="do.display.browser.nb.old">
  1070. <and>
  1071. <isset property="netbeans.home"/>
  1072. <not>
  1073. <isset property="browser.context"/>
  1074. </not>
  1075. </and>
  1076. </condition>
  1077. <condition property="do.display.browser.nb">
  1078. <and>
  1079. <isset property="netbeans.home"/>
  1080. <isset property="browser.context"/>
  1081. </and>
  1082. </condition>
  1083. <condition property="do.display.browser.cl">
  1084. <isset property="deploy.ant.enabled"/>
  1085. </condition>
  1086. </target>
  1087. <target if="do.display.browser.nb.old" name="-display-browser-nb-old">
  1088. <nbbrowse url="${client.url}"/>
  1089. </target>
  1090. <target if="do.display.browser.nb" name="-display-browser-nb">
  1091. <nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/>
  1092. </target>
  1093. <target if="do.display.browser.cl" name="-get-browser" unless="browser">
  1094. <condition property="browser" value="rundll32">
  1095. <os family="windows"/>
  1096. </condition>
  1097. <condition else="" property="browser.args" value="url.dll,FileProtocolHandler">
  1098. <os family="windows"/>
  1099. </condition>
  1100. <condition property="browser" value="/usr/bin/open">
  1101. <os family="mac"/>
  1102. </condition>
  1103. <property environment="env"/>
  1104. <condition property="browser" value="${env.BROWSER}">
  1105. <isset property="env.BROWSER"/>
  1106. </condition>
  1107. <condition property="browser" value="/usr/bin/firefox">
  1108. <available file="/usr/bin/firefox"/>
  1109. </condition>
  1110. <condition property="browser" value="/usr/local/firefox/firefox">
  1111. <available file="/usr/local/firefox/firefox"/>
  1112. </condition>
  1113. <condition property="browser" value="/usr/bin/mozilla">
  1114. <available file="/usr/bin/mozilla"/>
  1115. </condition>
  1116. <condition property="browser" value="/usr/local/mozilla/mozilla">
  1117. <available file="/usr/local/mozilla/mozilla"/>
  1118. </condition>
  1119. <condition property="browser" value="/usr/sfw/lib/firefox/firefox">
  1120. <available file="/usr/sfw/lib/firefox/firefox"/>
  1121. </condition>
  1122. <condition property="browser" value="/opt/csw/bin/firefox">
  1123. <available file="/opt/csw/bin/firefox"/>
  1124. </condition>
  1125. <condition property="browser" value="/usr/sfw/lib/mozilla/mozilla">
  1126. <available file="/usr/sfw/lib/mozilla/mozilla"/>
  1127. </condition>
  1128. <condition property="browser" value="/opt/csw/bin/mozilla">
  1129. <available file="/opt/csw/bin/mozilla"/>
  1130. </condition>
  1131. </target>
  1132. <target depends="-get-browser" if="do.display.browser.cl" name="-display-browser-cl">
  1133. <fail unless="browser">
  1134. Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable.
  1135. </fail>
  1136. <property name="browse.url" value="${deploy.ant.client.url}${client.urlPart}"/>
  1137. <echo>Launching ${browse.url}</echo>
  1138. <exec executable="${browser}" spawn="true">
  1139. <arg line="${browser.args} ${browse.url}"/>
  1140. </exec>
  1141. </target>
  1142. <target depends="init,-init-cos,compile-single" name="run-main">
  1143. <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  1144. <webproject1:java classname="${run.class}"/>
  1145. </target>
  1146. <target depends="init,compile-test-single,-pre-test-run-single" name="run-test-with-main">
  1147. <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  1148. <webproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
  1149. </target>
  1150. <target depends="init" if="netbeans.home" name="-do-update-breakpoints">
  1151. <webproject1:nbjpdaappreloaded/>
  1152. </target>
  1153. <!--
  1154. DEBUGGING SECTION
  1155. -->
  1156. <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">
  1157. <nbstartserver debugmode="true"/>
  1158. <antcall target="connect-debugger"/>
  1159. <nbdeploy clientUrlPart="${client.urlPart}" debugmode="true" forceRedeploy="true"/>
  1160. <antcall target="debug-display-browser-old"/>
  1161. <antcall target="debug-display-browser"/>
  1162. <antcall target="connect-client-debugger"/>
  1163. </target>
  1164. <target if="do.debug.server" name="connect-debugger" unless="is.debugged">
  1165. <condition property="listeningcp" value="sourcepath">
  1166. <istrue value="${j2ee.compile.on.save}"/>
  1167. </condition>
  1168. <nbjpdaconnect address="${jpda.address}" host="${jpda.host}" listeningcp="${listeningcp}" name="${name}" transport="${jpda.transport}">
  1169. <classpath>
  1170. <path path="${debug.classpath}:${j2ee.platform.classpath}"/>
  1171. </classpath>
  1172. <sourcepath>
  1173. <path path="${web.docbase.dir}"/>
  1174. </sourcepath>
  1175. </nbjpdaconnect>
  1176. </target>
  1177. <target if="do.display.browser.debug.old" name="debug-display-browser-old">
  1178. <nbbrowse url="${client.url}"/>
  1179. </target>
  1180. <target if="do.display.browser.debug" name="debug-display-browser">
  1181. <nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/>
  1182. </target>
  1183. <target if="do.debug.client" name="connect-client-debugger">
  1184. <webproject1:nbjsdebugstart webUrl="${client.url}"/>
  1185. </target>
  1186. <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
  1187. <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  1188. <webproject1:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
  1189. </target>
  1190. <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
  1191. <target depends="init,compile,compile-jsps,-do-compile-single-jsp,debug" if="netbeans.home" name="debug-single"/>
  1192. <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
  1193. <webproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
  1194. </target>
  1195. <target depends="init" if="netbeans.home" name="-debug-start-debugger">
  1196. <webproject1:nbjpdastart name="${debug.class}"/>
  1197. </target>
  1198. <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
  1199. <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  1200. <webproject1:debug classname="${debug.class}"/>
  1201. </target>
  1202. <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single-main"/>
  1203. <target depends="init" name="-pre-debug-fix">
  1204. <fail unless="fix.includes">Must set fix.includes</fail>
  1205. <property name="javac.includes" value="${fix.includes}.java"/>
  1206. </target>
  1207. <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
  1208. <webproject1:nbjpdareload/>
  1209. </target>
  1210. <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
  1211. <!--
  1212. =================
  1213. PROFILING SECTION
  1214. =================
  1215. -->
  1216. <!--
  1217. pre NB7.2 profiling section; consider it deprecated
  1218. -->
  1219. <target description="Profile a J2EE project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
  1220. <condition else="start-profiled-server" property="profiler.startserver.target" value="start-profiled-server-extraargs">
  1221. <isset property="profiler.info.jvmargs.extra"/>
  1222. </condition>
  1223. <antcall target="${profiler.startserver.target}"/>
  1224. <antcall target="run"/>
  1225. <antcall target="-profile-start-loadgen"/>
  1226. </target>
  1227. <target if="profiler.info.jvmargs.agent" name="start-profiled-server">
  1228. <nbstartprofiledserver forceRestart="${profiler.j2ee.serverForceRestart}" javaPlatform="${profiler.info.javaPlatform}" startupTimeout="${profiler.j2ee.serverStartupTimeout}">
  1229. <jvmarg value="${profiler.info.jvmargs.agent}"/>
  1230. <jvmarg value="${profiler.j2ee.agentID}"/>
  1231. </nbstartprofiledserver>
  1232. </target>
  1233. <target if="profiler.info.jvmargs.agent" name="start-profiled-server-extraargs">
  1234. <nbstartprofiledserver forceRestart="${profiler.j2ee.serverForceRestart}" javaPlatform="${profiler.info.javaPlatform}" startupTimeout="${profiler.j2ee.serverStartupTimeout}">
  1235. <jvmarg value="${profiler.info.jvmargs.extra}"/>
  1236. <jvmarg value="${profiler.info.jvmargs.agent}"/>
  1237. <jvmarg value="${profiler.j2ee.agentID}"/>
  1238. </nbstartprofiledserver>
  1239. </target>
  1240. <target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
  1241. <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  1242. <nbprofiledirect>
  1243. <classpath>
  1244. <path path="${run.test.classpath}"/>
  1245. <path path="${j2ee.platform.classpath}"/>
  1246. </classpath>
  1247. </nbprofiledirect>
  1248. <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
  1249. <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  1250. <jvmarg value="${profiler.info.jvmargs.agent}"/>
  1251. <jvmarg line="${profiler.info.jvmargs}"/>
  1252. <test name="${profile.class}"/>
  1253. <classpath>
  1254. <path path="${run.test.classpath}"/>
  1255. <path path="${j2ee.platform.classpath}"/>
  1256. </classpath>
  1257. <syspropertyset>
  1258. <propertyref prefix="test-sys-prop."/>
  1259. <mapper from="test-sys-prop.*" to="*" type="glob"/>
  1260. </syspropertyset>
  1261. <formatter type="brief" usefile="false"/>
  1262. <formatter type="xml"/>
  1263. </junit>
  1264. </target>
  1265. <target if="netbeans.home" name="-profile-check">
  1266. <condition property="profiler.configured">
  1267. <or>
  1268. <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
  1269. <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
  1270. </or>
  1271. </condition>
  1272. </target>
  1273. <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">
  1274. <startprofiler/>
  1275. <nbstartserver profilemode="true"/>
  1276. <nbdeploy clientUrlPart="${client.urlPart}" forceRedeploy="true" profilemode="true"/>
  1277. <antcall target="debug-display-browser-old"/>
  1278. <antcall target="debug-display-browser"/>
  1279. <antcall target="-profile-start-loadgen"/>
  1280. </target>
  1281. <target depends="-profile-check,-profile-pre72" description="Profile a J2EE project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
  1282. <antcall target="-do-profile"/>
  1283. </target>
  1284. <target depends="-profile-test-single-pre72" name="profile-test-single"/>
  1285. <target depends="-profile-check" if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs.agent">
  1286. <startprofiler/>
  1287. <antcall target="test-single"/>
  1288. </target>
  1289. <target if="profiler.loadgen.path" name="-profile-start-loadgen">
  1290. <loadgenstart path="${profiler.loadgen.path}"/>
  1291. </target>
  1292. <!--
  1293. JAVADOC SECTION
  1294. -->
  1295. <target depends="init" if="have.sources" name="javadoc-build">
  1296. <mkdir dir="${dist.javadoc.dir}"/>
  1297. <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}">
  1298. <classpath>
  1299. <path path="${javac.classpath}:${j2ee.platform.classpath}"/>
  1300. </classpath>
  1301. <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
  1302. <filename name="**/*.java"/>
  1303. </fileset>
  1304. <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  1305. <include name="**/*.java"/>
  1306. </fileset>
  1307. </javadoc>
  1308. <copy todir="${dist.javadoc.dir}">
  1309. <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
  1310. <filename name="**/doc-files/**"/>
  1311. </fileset>
  1312. <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  1313. <include name="**/doc-files/**"/>
  1314. </fileset>
  1315. </copy>
  1316. </target>
  1317. <target depends="init,javadoc-build" if="netbeans.home" name="javadoc-browse" unless="no.javadoc.preview">
  1318. <nbbrowse file="${dist.javadoc.dir}/index.html"/>
  1319. </target>
  1320. <target depends="init,javadoc-build,javadoc-browse" description="Build Javadoc." name="javadoc"/>
  1321. <!--
  1322. TEST COMPILATION SECTION
  1323. -->
  1324. <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
  1325. <mkdir dir="${build.test.classes.dir}"/>
  1326. <property name="j2ee.platform.embeddableejb.classpath" value=""/>
  1327. </target>
  1328. <target name="-pre-compile-test">
  1329. <!-- Empty placeholder for easier customization. -->
  1330. <!-- You can override this target in the ../build.xml file. -->
  1331. </target>
  1332. <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test" if="have.tests" name="-do-compile-test">
  1333. <webproject2:javac classpath="${javac.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  1334. <copy todir="${build.test.classes.dir}">
  1335. <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  1336. </copy>
  1337. </target>
  1338. <target name="-post-compile-test">
  1339. <!-- Empty placeholder for easier customization. -->
  1340. <!-- You can override this target in the ../build.xml file. -->
  1341. </target>
  1342. <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
  1343. <target name="-pre-compile-test-single">
  1344. <!-- Empty placeholder for easier customization. -->
  1345. <!-- You can override this target in the ../build.xml file. -->
  1346. </target>
  1347. <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  1348. <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  1349. <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}"/>
  1350. <copy todir="${build.test.classes.dir}">
  1351. <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  1352. </copy>
  1353. </target>
  1354. <target name="-post-compile-test-single">
  1355. <!-- Empty placeholder for easier customization. -->
  1356. <!-- You can override this target in the ../build.xml file. -->
  1357. </target>
  1358. <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
  1359. <!--
  1360. TEST EXECUTION SECTION
  1361. -->
  1362. <target depends="init" if="have.tests" name="-pre-test-run">
  1363. <mkdir dir="${build.test.results.dir}"/>
  1364. </target>
  1365. <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
  1366. <webproject2:test includes="${includes}" testincludes="**/*Test.java"/>
  1367. </target>
  1368. <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
  1369. <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  1370. </target>
  1371. <target depends="init" if="have.tests" name="test-report"/>
  1372. <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
  1373. <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
  1374. <target depends="init" if="have.tests" name="-pre-test-run-single">
  1375. <mkdir dir="${build.test.results.dir}"/>
  1376. </target>
  1377. <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  1378. <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  1379. <webproject2:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
  1380. </target>
  1381. <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
  1382. <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  1383. </target>
  1384. <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"/>
  1385. <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
  1386. <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
  1387. <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
  1388. <webproject2:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
  1389. </target>
  1390. <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
  1391. <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  1392. </target>
  1393. <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"/>
  1394. <!--
  1395. TEST DEBUGGING SECTION
  1396. -->
  1397. <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
  1398. <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  1399. <webproject2:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
  1400. </target>
  1401. <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
  1402. <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  1403. <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
  1404. <webproject2:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
  1405. </target>
  1406. <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
  1407. <webproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
  1408. </target>
  1409. <target depends="init,compile-test,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
  1410. <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
  1411. <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
  1412. <webproject1:nbjpdareload dir="${build.test.classes.dir}"/>
  1413. </target>
  1414. <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
  1415. <!--
  1416. CLEANUP SECTION
  1417. -->
  1418. <target depends="init" name="deps-clean" unless="no.deps"/>
  1419. <target depends="init" name="do-clean">
  1420. <condition property="build.dir.to.clean" value="${build.web.dir}">
  1421. <isset property="dist.ear.dir"/>
  1422. </condition>
  1423. <property name="build.dir.to.clean" value="${build.web.dir}"/>
  1424. <delete includeEmptyDirs="true" quiet="true">
  1425. <fileset dir="${build.dir.to.clean}/WEB-INF/lib"/>
  1426. </delete>
  1427. <delete dir="${build.dir}"/>
  1428. <available file="${build.dir.to.clean}/WEB-INF/lib" property="status.clean-failed" type="dir"/>
  1429. <delete dir="${dist.dir}"/>
  1430. </target>
  1431. <target depends="do-clean" if="status.clean-failed" name="check-clean">
  1432. <echo message="Warning: unable to delete some files in ${build.web.dir}/WEB-INF/lib - they are probably locked by the J2EE server. "/>
  1433. <echo level="info" message="To delete all files undeploy the module from Server Registry in Runtime tab and then use Clean again."/>
  1434. </target>
  1435. <target depends="init" if="netbeans.home" name="undeploy-clean">
  1436. <nbundeploy failOnError="false" startServer="false"/>
  1437. </target>
  1438. <target name="-post-clean">
  1439. <!-- Empty placeholder for easier customization. -->
  1440. <!-- You can override this target in the ../build.xml file. -->
  1441. </target>
  1442. <target depends="init,undeploy-clean,deps-clean,do-clean,check-clean,-post-clean" description="Clean build products." name="clean"/>
  1443. <target depends="clean" description="Clean build products." name="clean-ear"/>
  1444. </project>