You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build-impl.xml 80KB

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