/nbproject/build-impl.xml

https://bitbucket.org/mgyth/server2 · XML · 1442 lines · 1335 code · 0 blank · 107 comment · 0 complexity · 44dda88e141a7cd3df205d675fcc283b MD5 · raw file

Large files are truncated click here to view the full 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="-c…