build-impl.xml 85 KB

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