Guest User

build-imp.xml

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