build-impl.xml 83 KB

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