PageRenderTime 56ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/nbproject/build-impl.xml

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