build-impl.xml 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- *** GENERATED FROM project.xml - DO NOT EDIT *** -->
  3. <project name="onebuttoniap-impl" default="jar" basedir="..">
  4. <!--load-properties-->
  5. <target name="pre-load-properties">
  6. <property file="nbproject/private/private.properties"/>
  7. <property name="user.properties.file" location="${netbeans.user}/build.properties"/>
  8. <available property="user.properties.file.exists" file="${user.properties.file}"/>
  9. </target>
  10. <target name="exists.config.active" unless="config.active">
  11. <echo level="warning" message="Active configuration (config.active property) is not set - using default."/>
  12. <property value="" name="config.active"/>
  13. </target>
  14. <target name="exists.netbeans.user" unless="netbeans.user">
  15. <echo level="warning" message="NetBeans IDE user directory (netbeans.user property) is not set. By specifying this property many properties required by the project will be automatically evaluated (e.g.: ant-ext library home, ...). You could also open this project in the NetBeans IDE - in this case this property would be set automatically."/>
  16. </target>
  17. <target name="exists.user.properties.file" unless="user.properties.file.exists">
  18. <echo level="warning" message="User properties file (user.properties.file) property is not set. By specifying this property many properties required by the project will be automatically evaluated (e.g.: libraries, platforms, ...)."/>
  19. </target>
  20. <target name="load-properties" depends="pre-load-properties,exists.config.active,exists.netbeans.user,exists.user.properties.file">
  21. <loadproperties srcfile="nbproject/project.properties">
  22. <filterchain>
  23. <containsregex pattern="^configs\.${config.active}\.(.*)" replace="\1"/>
  24. <concatfilter prepend="nbproject/project.properties"/>
  25. <containsregex pattern="^platform.active=|^deployment.method=|^deployment.instance="/>
  26. </filterchain>
  27. </loadproperties>
  28. <property name="deployment.instance" value="default"/>
  29. <loadproperties srcfile="${user.properties.file}">
  30. <filterchain>
  31. <replaceregex pattern="^platforms\.${platform.active}\." replace="platform."/>
  32. <replaceregex pattern="^deployment\.${deployment.method}\.scriptfile=" replace="deployment.scriptfile="/>
  33. <replaceregex pattern="^deployments\.${deployment.method}\.${deployment.instance}\.([^=]+)=" replace="\1="/>
  34. </filterchain>
  35. </loadproperties>
  36. <loadproperties srcfile="nbproject/project.properties">
  37. <filterchain>
  38. <containsregex pattern="^configs\.${config.active}\.(.*)" replace="\1"/>
  39. <concatfilter prepend="nbproject/project.properties"/>
  40. </filterchain>
  41. </loadproperties>
  42. </target>
  43. <!--basic-init-->
  44. <target name="exists.platform.active" unless="platform.active">
  45. <echo level="warning" message="Active platform (platform.active property) in not set. If you set this and user.properties.file property, many properties required by the project will be automatically evaluated (e.g.: platform home, platform classpath, ...)."/>
  46. </target>
  47. <target name="exists.platform.configuration" unless="platform.configuration">
  48. <echo level="warning" message="Platform configuration (platform.configuration) is not set. Using default (CLDC-1.0) configuration."/>
  49. <property name="platform.configuration" value="CLDC-1.0"/>
  50. </target>
  51. <target name="exists.platform.profile" unless="platform.profile">
  52. <echo level="warning" message="Platform profile (platform.profile) is not set. Using default (MIDP-1.0) profile."/>
  53. <property name="platform.profile" value="MIDP-1.0"/>
  54. </target>
  55. <target name="basic-init" depends="exists.platform.active,exists.platform.configuration,exists.platform.profile">
  56. <fail unless="libs.j2me_ant_ext.classpath">Classpath to J2ME Ant extension library (libs.j2me_ant_ext.classpath property) is not set. For example: location of mobility/modules/org-netbeans-mobility-antext.jar file in the IDE installation directory.</fail>
  57. <fail unless="platform.home">Platform home (platform.home property) is not set. Value of this property should be ${platform.active.description} emulator home directory location.</fail>
  58. <fail unless="platform.bootclasspath">Platform boot classpath (platform.bootclasspath property) is not set. Value of this property should be ${platform.active.description} emulator boot classpath containing all J2ME classes provided by emulator.</fail>
  59. <fail unless="src.dir">Must set src.dir</fail>
  60. <fail unless="build.dir">Must set build.dir</fail>
  61. <fail unless="dist.dir">Must set dist.dir</fail>
  62. <fail unless="dist.jar">Must set dist.jar</fail>
  63. <property name="javac.source" value="1.3"/>
  64. <property name="javac.target" value="1.1"/>
  65. <property name="javac.encoding" value="${file.encoding}"/>
  66. <property name="deployment.number" value="0.0.1"/>
  67. <property name="deployment.counter" value="000002"/>
  68. <condition property="no.deps">
  69. <istrue value="${no.dependencies}"/>
  70. </condition>
  71. <condition property="no.preprocess">
  72. <isfalse value="${use.preprocessor}"/>
  73. </condition>
  74. <condition property="no.javadoc.preview">
  75. <isfalse value="${javadoc.preview}"/>
  76. </condition>
  77. <condition property="filter.excludes.evaluated" value="${filter.excludes},${filter.more.excludes},**/*Test.java,**/test,**/test/**">
  78. <istrue value="${filter.exclude.tests}"/>
  79. </condition>
  80. <property name="filter.excludes.evaluated" value="${filter.excludes},${filter.more.excludes}"/>
  81. <condition property="deployment.do.override.jarurl" value="">
  82. <istrue value="${deployment.override.jarurl}"/>
  83. </condition>
  84. <condition property="config.active.name" value="DefaultConfiguration">
  85. <length string="${config.active}" trim="true" length="0"/>
  86. </condition>
  87. <property name="config.active.name" value="${config.active}"/>
  88. <taskdef resource="org/netbeans/mobility/antext/defs.properties">
  89. <classpath>
  90. <pathelement path="${libs.j2me_ant_ext.classpath}"/>
  91. </classpath>
  92. </taskdef>
  93. <condition property="skip.deployment">
  94. <equals arg1="${deployment.method}" arg2="NONE" casesensitive="false" trim="true"/>
  95. </condition>
  96. <condition property="app-version.autoincrement.trigger">
  97. <istrue value="${app-version.autoincrement}"/>
  98. </condition>
  99. <condition property="debug.timeout" value="30000">
  100. <or>
  101. <equals arg1="${debugger.timeout}" arg2="" trim="true"/>
  102. <not>
  103. <isset property="debugger.timeout"/>
  104. </not>
  105. </or>
  106. </condition>
  107. <property name="debug.timeout" value="${debugger.timeout}"/>
  108. <nb-overrideproperty name="buildsystem.baton" value="${src.dir}"/>
  109. </target>
  110. <!--cldc-init-->
  111. <target name="cldc-pre-init">
  112. <condition property="cldc-platform.trigger">
  113. <equals arg1="CLDC" arg2="${platform.trigger}" casesensitive="false"/>
  114. </condition>
  115. </target>
  116. <target name="cldc-init" depends="cldc-pre-init" if="cldc-platform.trigger">
  117. <property name="preverify.sources.dir" location="${build.dir}/preverifysrc"/>
  118. <property name="manifest.build.file" location="${build.dir}/manifest.mf"/>
  119. <property name="platform.device" value=""/>
  120. <property name="dist.jad.url" value="file://"/>
  121. <property name="run.cmd.options" value=""/>
  122. <condition property="evaluated.run.security.domain" value="">
  123. <isfalse value="${run.use.security.domain}"/>
  124. </condition>
  125. <property name="evaluated.run.security.domain" value="${run.security.domain}"/>
  126. <condition property="override.jarurl.trigger">
  127. <and>
  128. <istrue value="${cldc-platform.trigger}"/>
  129. <istrue value="${deployment.override.jarurl}"/>
  130. </and>
  131. </condition>
  132. <property name="deployment.jad" location="${dist.dir}/${dist.jad}"/>
  133. <property name="deployment.jar" location="${dist.dir}/${dist.jar}"/>
  134. <property name="deployment.dir" location="${dist.dir}"/>
  135. <patternset id="deployment.patternset">
  136. <include name="${dist.jad}"/>
  137. <include name="${dist.jar}"/>
  138. </patternset>
  139. </target>
  140. <!--cdc-init-->
  141. <target name="cdc-init">
  142. <condition property="cdc-platform.trigger">
  143. <equals arg1="CDC" arg2="${platform.trigger}" casesensitive="false"/>
  144. </condition>
  145. <available file="${manifest.file}" property="manifest.available"/>
  146. <condition property="main.class.applet">
  147. <equals arg1="${main.class.class}" arg2="applet" casesensitive="false"/>
  148. </condition>
  149. <condition property="main.class.xlet">
  150. <equals arg1="${main.class.class}" arg2="xlet" casesensitive="false"/>
  151. </condition>
  152. <condition property="manifest.available+main.class+fat.jar">
  153. <and>
  154. <isset property="manifest.available"/>
  155. <isset property="main.class"/>
  156. <istrue value="${platform.fat.jar}"/>
  157. <not>
  158. <equals arg1="${main.class}" arg2="" trim="true"/>
  159. </not>
  160. </and>
  161. </condition>
  162. <condition property="manifest.available+main.class">
  163. <and>
  164. <isset property="manifest.available"/>
  165. <isset property="main.class"/>
  166. <isfalse value="${platform.fat.jar}"/>
  167. <not>
  168. <equals arg1="${main.class}" arg2="" trim="true"/>
  169. </not>
  170. </and>
  171. </condition>
  172. <condition property="application.version.invalid" value="true">
  173. <equals arg1="${deployment.number}" arg2="" trim="true"/>
  174. </condition>
  175. <fail if="application.version.invalid" message="Property deployment.number must not be empty and must contain version in format %d.%d.%d!"/>
  176. <condition property="sign.jar.trigger" value="true">
  177. <and>
  178. <isset property="cdc-platform.trigger"/>
  179. <istrue value="${sign.enabled}"/>
  180. </and>
  181. </condition>
  182. </target>
  183. <!--semc-init-->
  184. <target name="semc-pre-init" if="cdc-platform.trigger">
  185. <condition property="semc-platform.trigger">
  186. <equals arg1="semc" arg2="${platform.type}" casesensitive="false"/>
  187. </condition>
  188. </target>
  189. <target name="semc-init" depends="semc-pre-init" if="semc-platform.trigger">
  190. <condition property="semc.icon.invalid" value="true">
  191. <or>
  192. <contains string="${semc.application.icon}" substring="$${"/>
  193. <equals arg1="${semc.application.icon}" arg2="" trim="true"/>
  194. </or>
  195. </condition>
  196. <condition property="no.certificateorkey" value="true">
  197. <or>
  198. <isset property="no.application.uid"/>
  199. <equals arg1="${semc.certificate.path}" arg2="" trim="true"/>
  200. <contains string="${semc.certificate.path}" substring="$${semc.certificate.path"/>
  201. <equals arg1="${semc.private.key.path}" arg2="" trim="true"/>
  202. <contains string="${semc.private.key.path}" substring="$${semc.private.key.path"/>
  203. </or>
  204. </condition>
  205. <property name="j9.dist" location="${build.dir}/j9/${semc.application.uid}.j9"/>
  206. <taskdef resource="org/netbeans/modules/j2me/cdc/project/defs.properties">
  207. <classpath>
  208. <pathelement path="${libs.cdc-ant-utils.classpath}"/>
  209. </classpath>
  210. </taskdef>
  211. <taskdef resource="org/netbeans/modules/j2me/cdc/project/semc/defs.properties">
  212. <classpath>
  213. <pathelement path="${libs.semc-ant-utils.classpath}"/>
  214. </classpath>
  215. </taskdef>
  216. <property name="deployment.dir" location="${dist.dir}"/>
  217. <patternset id="deployment.patternset">
  218. <include name="*.sis"/>
  219. <include name="*.SIS"/>
  220. </patternset>
  221. </target>
  222. <!--savaje-init-->
  223. <target name="savaje-pre-init" if="cdc-platform.trigger">
  224. <condition property="savaje-platform.trigger">
  225. <equals arg1="savaje" arg2="${platform.type}" casesensitive="false"/>
  226. </condition>
  227. </target>
  228. <target name="savaje-init" depends="savaje-pre-init" if="savaje-platform.trigger">
  229. <property name="savaje.application.uid" value="TBD"/>
  230. <condition property="savaje.bundle.base.invalid" value="true">
  231. <or>
  232. <equals arg1="${savaje.bundle.base}" arg2="" trim="true"/>
  233. <contains string="${savaje.bundle.base}" substring="$${savaje.bundle.base"/>
  234. </or>
  235. </condition>
  236. <condition property="savaje.unsupported.main" value="true">
  237. <or>
  238. <equals arg1="${main.class.applet}" arg2="true"/>
  239. </or>
  240. </condition>
  241. <condition property="savaje.icon.invalid" value="true">
  242. <or>
  243. <isset property="no.application.uid"/>
  244. <contains string="${savaje.application.icon}" substring="$${"/>
  245. <equals arg1="${savaje.application.icon}" arg2="" trim="true"/>
  246. </or>
  247. </condition>
  248. <property name="jnlp.dist" value="${build.dir}/jnlp/bundle.jnlp"/>
  249. <property name="deployment.dir" location="${dist.dir}"/>
  250. <patternset id="deployment.patternset">
  251. <include name="bundle.jnlp"/>
  252. <include name="bundle.policy"/>
  253. <include name="lib/*"/>
  254. </patternset>
  255. </target>
  256. <!--sjmc-init-->
  257. <target name="sjmc-pre-init" if="cdc-platform.trigger">
  258. <condition property="sjmc-platform.trigger">
  259. <equals arg1="sjmc" arg2="${platform.type}" casesensitive="false"/>
  260. </condition>
  261. </target>
  262. <target name="sjmc-init" depends="sjmc-pre-init" if="sjmc-platform.trigger"/>
  263. <!--ojec-init-->
  264. <target name="ojec-pre-init" if="cdc-platform.trigger">
  265. <condition property="ojec-platform.trigger">
  266. <equals arg1="ojec" arg2="${platform.type}" casesensitive="false"/>
  267. </condition>
  268. </target>
  269. <target name="ojec-init" depends="ojec-pre-init" if="ojec-platform.trigger"/>
  270. <!--cdc-hi-init-->
  271. <target name="cdc-hi-pre-init" if="cdc-platform.trigger">
  272. <condition property="cdc-hi-platform.trigger">
  273. <equals arg1="cdc-hi" arg2="${platform.type}" casesensitive="false"/>
  274. </condition>
  275. </target>
  276. <target name="cdc-hi-init" depends="cdc-hi-pre-init" if="cdc-hi-platform.trigger"/>
  277. <!--nokiaS80-init-->
  278. <target name="nokiaS80-pre-init" if="cdc-platform.trigger">
  279. <condition property="nokiaS80-platform.trigger">
  280. <equals arg1="nokiaS80" arg2="${platform.type}" casesensitive="false"/>
  281. </condition>
  282. </target>
  283. <target name="nokiaS80-init" depends="nokiaS80-pre-init" if="nokiaS80-platform.trigger">
  284. <property name="j9.dist" location="${build.dir}/j9/NOKIA.j9"/>
  285. <property name="manifest.build.file" location="${build.dir}/manifest.mf"/>
  286. <condition property="nokia.icon.invalid">
  287. <or>
  288. <contains string="${nokiaS80.application.icon}" substring="$${"/>
  289. <equals arg1="${nokiaS80.application.icon}" arg2="" trim="true"/>
  290. </or>
  291. </condition>
  292. <property name="deployment.dir" location="${dist.dir}"/>
  293. <patternset id="deployment.patternset">
  294. <include name="${dist.jar}"/>
  295. </patternset>
  296. </target>
  297. <!--init-->
  298. <target name="pre-init"/>
  299. <target name="post-init"/>
  300. <target name="init" depends="pre-init,load-properties,basic-init,cldc-init,cdc-init,semc-init,savaje-init,sjmc-init,ojec-init,cdc-hi-init,nokiaS80-init,post-init"/>
  301. <!--conditional clean-->
  302. <target name="conditional-clean-init">
  303. <uptodate property="no.clean.before.build" targetfile="${build.dir}/.timestamp">
  304. <srcfiles dir="nbproject">
  305. <include name="project.properties"/>
  306. <include name="build-impl.xml"/>
  307. </srcfiles>
  308. </uptodate>
  309. </target>
  310. <target name="conditional-clean" depends="init,conditional-clean-init" unless="no.clean.before.build" description="Clean project in case its meta information has changed.">
  311. <antcall target="do-clean" inheritall="true" inheritrefs="true"/>
  312. </target>
  313. <!--deps-jar-->
  314. <target name="deps-jar" depends="conditional-clean" unless="no.deps">
  315. <ant target="jar" inheritall="false" antfile="${project.onebuttonlib}/build.xml">
  316. <property name="config.active" value=""/>
  317. </ant>
  318. </target>
  319. <!--preprocess-->
  320. <target name="pre-preprocess"/>
  321. <target name="do-preprocess" unless="no.preprocess">
  322. <fail unless="preprocessed.dir">Must set preprocessed.dir</fail>
  323. <property name="abilities" value=""/>
  324. <property name="debug.level" value="debug"/>
  325. <mkdir dir="${preprocessed.dir}"/>
  326. <echo message="ignore me" file="${build.dir}/.timestamp"/>
  327. <nb-prep destdir="${preprocessed.dir}" preprocessfor="${config.active.name},${abilities},DebugLevel=${debug.level}" encoding="${javac.encoding}">
  328. <fileset dir="${buildsystem.baton}" defaultexcludes="${filter.use.standard}" excludes="${filter.excludes.evaluated}"/>
  329. </nb-prep>
  330. <copy todir="${preprocessed.dir}">
  331. <fileset dir="${buildsystem.baton}" defaultexcludes="${filter.use.standard}" excludes="${filter.excludes.evaluated},${build.classes.excludes}"/>
  332. </copy>
  333. <nb-overrideproperty name="buildsystem.baton" value="${preprocessed.dir}"/>
  334. </target>
  335. <target name="post-preprocess"/>
  336. <target name="preprocess" depends="deps-jar,pre-preprocess,do-preprocess,post-preprocess" description="Preprocess project sources."/>
  337. <!--compile-->
  338. <target name="pre-compile"/>
  339. <target name="do-compile">
  340. <fail unless="build.classes.dir">Must set build.classes.dir</fail>
  341. <mkdir dir="${build.classes.dir}"/>
  342. <javac includeantruntime="false" source="${javac.source}" target="${javac.target}" deprecation="${javac.deprecation}" optimize="${javac.optimize}" debug="${javac.debug}" destdir="${build.classes.dir}" srcdir="${buildsystem.baton}" bootclasspath="${platform.bootclasspath}" encoding="${javac.encoding}">
  343. <classpath>
  344. <path path="${libs.classpath}"/>
  345. </classpath>
  346. </javac>
  347. <copy todir="${build.classes.dir}">
  348. <fileset dir="${buildsystem.baton}" defaultexcludes="${filter.use.standard}" excludes="${filter.excludes.evaluated},${build.classes.excludes}"/>
  349. </copy>
  350. <nb-overrideproperty name="buildsystem.baton" value="${build.classes.dir}"/>
  351. </target>
  352. <target name="extract-libs" description="Extracts all bundled libraries.">
  353. <mkdir dir="${build.classes.dir}"/>
  354. <nb-extract dir="${build.classes.dir}" excludeManifest="true" classpath="${libs.classpath}" excludeclasspath="${extra.classpath}"/>
  355. </target>
  356. <target name="post-compile"/>
  357. <target name="compile" depends="preprocess,pre-compile,extract-libs,do-compile,post-compile" description="Compile project classes."/>
  358. <!--compile-single-->
  359. <target name="pre-compile-single"/>
  360. <target name="do-compile-single">
  361. <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  362. <mkdir dir="${build.classes.dir}"/>
  363. <javac includeantruntime="false" source="${javac.source}" target="${javac.target}" deprecation="${javac.deprecation}" optimize="${javac.optimize}" debug="${javac.debug}" srcdir="${buildsystem.baton}" destdir="${build.classes.dir}" bootclasspath="${platform.bootclasspath}" includes="${javac.includes}" encoding="${javac.encoding}">
  364. <classpath>
  365. <path path="${libs.classpath}"/>
  366. </classpath>
  367. </javac>
  368. </target>
  369. <target name="post-compile-single"/>
  370. <target name="compile-single" depends="preprocess,pre-compile-single,do-compile-single,post-compile-single" description="Compile selected project classes."/>
  371. <!--proguard-->
  372. <target name="proguard-init" description="Up-to-date check before obfuscation.">
  373. <property name="obfuscation.level" value="0"/>
  374. <condition property="no.obfusc">
  375. <or>
  376. <equals arg1="${obfuscation.level}" arg2="0"/>
  377. <uptodate targetfile="${obfuscator.destjar}">
  378. <srcfiles dir="${buildsystem.baton}"/>
  379. </uptodate>
  380. </or>
  381. </condition>
  382. <uptodate property="obfuscation.up-to-date" targetfile="${obfuscator.destjar}">
  383. <srcfiles dir="${buildsystem.baton}"/>
  384. </uptodate>
  385. </target>
  386. <target name="skip-obfuscation" depends="proguard-init" if="obfuscation.up-to-date">
  387. <fail unless="obfuscated.classes.dir">Must set obfuscated.classes.dir</fail>
  388. <nb-overrideproperty name="buildsystem.baton" value="${obfuscated.classes.dir}"/>
  389. </target>
  390. <target name="proguard" depends="skip-obfuscation" description="Obfuscate project classes." unless="no.obfusc">
  391. <fail unless="obfuscated.classes.dir">Must set obfuscated.classes.dir</fail>
  392. <fail unless="obfuscator.srcjar">Must set obfuscator.srcjar</fail>
  393. <fail unless="obfuscator.destjar">Must set obfuscator.destjar</fail>
  394. <property name="obfuscator.classpath" value=""/>
  395. <dirname file="${obfuscator.srcjar}" property="obfuscator.srcjar.dir"/>
  396. <dirname file="${obfuscator.destjar}" property="obfuscator.destjar.dir"/>
  397. <mkdir dir="${obfuscator.srcjar.dir}"/>
  398. <mkdir dir="${obfuscator.destjar.dir}"/>
  399. <jar jarfile="${obfuscator.srcjar}" basedir="${buildsystem.baton}"/>
  400. <property name="obfuscation.custom" value=""/>
  401. <nb-obfuscate srcjar="${obfuscator.srcjar}" destjar="${obfuscator.destjar}" obfuscatorclasspath="${obfuscator.classpath}" classpath="${platform.bootclasspath}:${extra.classpath}" obfuscationLevel="${obfuscation.level}" extraScript="${obfuscation.custom}"/>
  402. <mkdir dir="${obfuscated.classes.dir}"/>
  403. <unjar src="${obfuscator.destjar}" dest="${obfuscated.classes.dir}"/>
  404. <nb-overrideproperty name="buildsystem.baton" value="${obfuscated.classes.dir}"/>
  405. </target>
  406. <!--obfuscate-->
  407. <target name="pre-obfuscate"/>
  408. <target name="post-obfuscate"/>
  409. <target name="obfuscate" depends="compile,pre-obfuscate,proguard,post-obfuscate" description="Obfuscate project classes."/>
  410. <!--lwuit-build-->
  411. <import file="lwuit.xml" optional="true"/>
  412. <target name="-lwuit-check">
  413. <condition property="lwuit.allowed">
  414. <and>
  415. <available file="nbproject/lwuit.xml"/>
  416. <isset property="is.mesdk_lwuit"/>
  417. </and>
  418. </condition>
  419. </target>
  420. <target name="-pre-lwuit-build" depends="-lwuit-check" if="lwuit.allowed"/>
  421. <target name="-lwuit-build" depends="-lwuit-check" if="lwuit.allowed">
  422. <antcall target="lwuit_build"/>
  423. </target>
  424. <target name="-post-lwuit-build" depends="-lwuit-check" if="lwuit.allowed"/>
  425. <target name="lwuit-build" depends="-lwuit-check,-pre-lwuit-build, -lwuit-build, -post-lwuit-build" if="lwuit.allowed"/>
  426. <!--preverify-->
  427. <target name="pre-preverify"/>
  428. <target name="do-preverify" if="cldc-platform.trigger">
  429. <fail unless="preverify.classes.dir">Must set preverify.classes.dir</fail>
  430. <mkdir dir="${preverify.sources.dir}"/>
  431. <copy todir="${preverify.sources.dir}">
  432. <fileset dir="${buildsystem.baton}" includes="**/*.class"/>
  433. </copy>
  434. <mkdir dir="${preverify.classes.dir}"/>
  435. <nb-preverify srcdir="${preverify.sources.dir}" destdir="${preverify.classes.dir}" classpath="${platform.bootclasspath}:${extra.classpath}" configuration="${platform.configuration}" platformhome="${platform.home}" platformtype="${platform.type}" commandline="${platform.preverifycommandline}"/>
  436. <copy todir="${preverify.classes.dir}">
  437. <fileset dir="${buildsystem.baton}" defaultexcludes="${filter.use.standard}" excludes="${filter.excludes.evaluated},${build.classes.excludes}"/>
  438. </copy>
  439. <nb-overrideproperty name="buildsystem.baton" value="${preverify.classes.dir}"/>
  440. </target>
  441. <target name="post-preverify"/>
  442. <target name="preverify" depends="obfuscate,lwuit-build,pre-preverify,do-preverify,post-preverify" description="Preverify project classes."/>
  443. <!--set-password-->
  444. <target name="set-password-init">
  445. <property name="sign.enabled" value="false"/>
  446. <condition property="skip-sign-keystore-password-input">
  447. <or>
  448. <isfalse value="${sign.enabled}"/>
  449. <and>
  450. <isset property="sign.keystore"/>
  451. <isset property="sign.keystore.password"/>
  452. <not>
  453. <equals arg1="${sign.keystore}" arg2="" trim="true"/>
  454. </not>
  455. <not>
  456. <equals arg1="${sign.keystore.password}" arg2="" trim="true"/>
  457. </not>
  458. </and>
  459. </or>
  460. </condition>
  461. <condition property="skip-sign-alias-password-input">
  462. <or>
  463. <isfalse value="${sign.enabled}"/>
  464. <and>
  465. <isset property="sign.keystore"/>
  466. <isset property="sign.alias"/>
  467. <isset property="sign.alias.password"/>
  468. <not>
  469. <equals arg1="${sign.keystore}" arg2="" trim="true"/>
  470. </not>
  471. <not>
  472. <equals arg1="${sign.alias}" arg2="" trim="true"/>
  473. </not>
  474. <not>
  475. <equals arg1="${sign.alias.password}" arg2="" trim="true"/>
  476. </not>
  477. </and>
  478. </or>
  479. </condition>
  480. </target>
  481. <target name="set-keystore-password" if="netbeans.home" unless="skip-sign-keystore-password-input">
  482. <nb-enter-password keystore="${sign.keystore}" passwordproperty="sign.keystore.password"/>
  483. </target>
  484. <target name="set-alias-password" if="netbeans.home" unless="skip-sign-alias-password-input">
  485. <nb-enter-password keystore="${sign.keystore}" keyalias="${sign.alias}" passwordproperty="sign.alias.password"/>
  486. </target>
  487. <target name="set-password" depends="set-password-init,set-keystore-password,set-alias-password"/>
  488. <!--create JAD-->
  489. <target name="add-configuration" unless="contains.manifest.configuration">
  490. <nb-output file="${dist.dir}/${dist.jad}" encoding="UTF-8" append="true">MicroEdition-Configuration: ${platform.configuration}
  491. </nb-output>
  492. <nb-output file="${manifest.build.file}" encoding="UTF-8" append="true">MicroEdition-Configuration: ${platform.configuration}
  493. </nb-output>
  494. </target>
  495. <target name="add-profile" unless="contains.manifest.profile">
  496. <nb-output file="${dist.dir}/${dist.jad}" encoding="UTF-8" append="true">MicroEdition-Profile: ${platform.profile}
  497. </nb-output>
  498. <nb-output file="${manifest.build.file}" encoding="UTF-8" append="true">MicroEdition-Profile: ${platform.profile}
  499. </nb-output>
  500. </target>
  501. <target name="create-jad" if="cldc-platform.trigger">
  502. <fail unless="dist.jad">Must set dist.jad</fail>
  503. <mkdir dir="${build.dir}"/>
  504. <dirname file="${dist.dir}/${dist.jad}" property="dist.jad.dir"/>
  505. <mkdir dir="${dist.jad.dir}"/>
  506. <condition property="evaluated.manifest.apipermissions" value="${manifest.apipermissions}">
  507. <not>
  508. <equals arg1="${platform.profile}" arg2="MIDP-1.0"/>
  509. </not>
  510. </condition>
  511. <condition property="evaluated.manifest.pushregistry" value="${manifest.pushregistry}">
  512. <not>
  513. <equals arg1="${platform.profile}" arg2="MIDP-1.0"/>
  514. </not>
  515. </condition>
  516. <condition property="contains.manifest.configuration">
  517. <contains substring="MicroEdition-Configuration: " string="${manifest.others}"/>
  518. </condition>
  519. <condition property="contains.manifest.profile">
  520. <contains substring="MicroEdition-Profile: " string="${manifest.others}"/>
  521. </condition>
  522. <property value="" name="evaluated.manifest.apipermissions"/>
  523. <property value="" name="evaluated.manifest.pushregistry"/>
  524. <property name="manifest.jad" value=""/>
  525. <property name="manifest.manifest" value=""/>
  526. <nb-output file="${dist.dir}/${dist.jad}" encoding="UTF-8">${manifest.midlets}${evaluated.manifest.apipermissions}${evaluated.manifest.pushregistry}${manifest.others}${manifest.jad}</nb-output>
  527. <nb-output file="${manifest.build.file}" encoding="UTF-8">${manifest.midlets}${evaluated.manifest.apipermissions}${evaluated.manifest.pushregistry}${manifest.others}${manifest.manifest}</nb-output>
  528. <antcall target="add-configuration" inheritall="true" inheritrefs="true"/>
  529. <antcall target="add-profile" inheritall="true" inheritrefs="true"/>
  530. <property name="manifest.available" value="true"/>
  531. </target>
  532. <!--do-extra-libs-->
  533. <target name="do-extra-libs" if="extra.classpath">
  534. <property name="dist.lib.dir" value="${dist.dir}/lib"/>
  535. <mkdir dir="${dist.lib.dir}"/>
  536. <copy todir="${dist.lib.dir}">
  537. <path path="${extra.classpath}"/>
  538. <flattenmapper/>
  539. </copy>
  540. </target>
  541. <!--nokiaS80-manifest-->
  542. <target name="nokiaS80-prepare-j9" if="nokiaS80-platform.trigger">
  543. <fail message="Main class is not set!">
  544. <condition>
  545. <equals arg1="${main.class}" arg2="" trim="true"/>
  546. </condition>
  547. </fail>
  548. <mkdir dir="${build.dir}/j9"/>
  549. <taskdef name="j9builder" classname="org.netbeans.modules.j2me.cdc.project.J9Builder" classpath="${libs.cdc-ant-utils.classpath}"/>
  550. <j9builder jvmargs="${run.jvmargs}" mainclass="${main.class}" args="${application.args}" home="${platform.home}" dist="${j9.dist}" id="NOKIA" platform="${platform.type}" xlet="${main.class.xlet}" applet="${main.class.applet}" jarname="${dist.jar}"/>
  551. <copy file="${manifest.file}" tofile="${manifest.build.file}" failonerror="false"/>
  552. <property name="manifest.available" value="true"/>
  553. <loadfile property="nokia.manifest.j9" srcFile="${j9.dist}"/>
  554. </target>
  555. <target name="nokiaS80-prepare-manifest" depends="nokiaS80-prepare-j9" if="nokiaS80-platform.trigger" unless="nokia.icon.invalid">
  556. <pathconvert property="logo.icon.name" pathsep=" ">
  557. <path path="${nokiaS80.application.icon}"/>
  558. <chainedmapper>
  559. <flattenmapper/>
  560. <globmapper from="*" to="*"/>
  561. </chainedmapper>
  562. </pathconvert>
  563. <copy file="${nokiaS80.application.icon}" todir="${buildsystem.baton}"/>
  564. <manifest file="${manifest.build.file}" mode="update">
  565. <attribute name="Main-Class" value="${main.class}"/>
  566. <attribute name="PproApp-Name" value="${application.name}"/>
  567. <attribute name="PproApp-Vendor" value="${application.vendor}"/>
  568. <attribute name="PproApp-Version" value="${deployment.number}"/>
  569. <attribute name="PproApp-Icon" value="${logo.icon.name}"/>
  570. <attribute name="x-ibm-pp-j9" value="${nokia.manifest.j9}"/>
  571. </manifest>
  572. </target>
  573. <target name="nokiaS80-prepare-manifest-no-icon" depends="nokiaS80-prepare-j9" if="nokia.icon.invalid">
  574. <manifest file="${manifest.build.file}" mode="update">
  575. <attribute name="Main-Class" value="${main.class}"/>
  576. <attribute name="PproApp-Name" value="${application.name}"/>
  577. <attribute name="PproApp-Vendor" value="${application.vendor}"/>
  578. <attribute name="PproApp-Version" value="${deployment.number}"/>
  579. <attribute name="x-ibm-pp-j9" value="${nokia.manifest.j9}"/>
  580. </manifest>
  581. </target>
  582. <target name="nokiaS80-create-manifest" depends="nokiaS80-prepare-j9,nokiaS80-prepare-manifest,nokiaS80-prepare-manifest-no-icon" if="nokiaS80-platform.trigger"/>
  583. <!--jad-jsr211-properties-->
  584. <target name="jad-jsr211-properties.check">
  585. <condition property="jad-jsr211-properties.allowed">
  586. <and>
  587. <isset property="cldc-platform.trigger"/>
  588. <isset property="netbeans.home"/>
  589. <isset property="is.mesdk_jsr211"/>
  590. </and>
  591. </condition>
  592. </target>
  593. <target name="jad-jsr211-properties" description="Updates JAD and manifest with JSR211 properties." depends="jad-jsr211-properties.check" if="jad-jsr211-properties.allowed">
  594. <jadjsr211properties jadfile="${dist.dir}/${dist.jad}" manifestfile="${build.dir}/${manifest.file}"/>
  595. </target>
  596. <!--semc-build-j9-->
  597. <target name="semc-build-j9" if="semc-platform.trigger">
  598. <epocpathsetter home="${platform.home}"/>
  599. <property name="semc.application.caps" value=""/>
  600. <mkdir dir="${platform.home}/epoc32/winscw/c/private/${semc.application.uid}"/>
  601. <mkdir dir="${build.dir}/j9"/>
  602. <fail message="Main class is not set!">
  603. <condition>
  604. <equals arg1="${main.class}" arg2="" trim="true"/>
  605. </condition>
  606. </fail>
  607. <j9builder jvmargs="${run.jvmargs}" mainclass="${main.class}" args="${application.args}" home="${platform.home}" dist="${j9.dist}" id="${semc.application.uid}" platform="${platform.type}" xlet="${main.class.xlet}" applet="${main.class.applet}" jarname="${dist.jar}"/>
  608. </target>
  609. <!--do-jar-->
  610. <target name="do-jar" if="manifest.available">
  611. <dirname file="${dist.dir}/${dist.jar}" property="dist.jar.dir"/>
  612. <mkdir dir="${dist.jar.dir}"/>
  613. <property name="manifest.build.file" location="${manifest.file}"/>
  614. <jar compress="${jar.compress}" jarfile="${dist.dir}/${dist.jar}" manifest="${manifest.build.file}" manifestencoding="UTF-8">
  615. <fileset dir="${buildsystem.baton}"/>
  616. </jar>
  617. </target>
  618. <!--do-jar-no-manifest-->
  619. <target name="do-jar-no-manifest" unless="manifest.available">
  620. <dirname file="${dist.dir}/${dist.jar}" property="dist.jar.dir"/>
  621. <mkdir dir="${dist.jar.dir}"/>
  622. <jar compress="${jar.compress}" jarfile="${dist.dir}/${dist.jar}">
  623. <fileset dir="${buildsystem.baton}"/>
  624. </jar>
  625. </target>
  626. <!--update-jad-->
  627. <target name="update-jad" if="cldc-platform.trigger">
  628. <nb-jad jadfile="${dist.dir}/${dist.jad}" jarfile="${dist.dir}/${dist.jar}" url="${dist.jar}" sign="${sign.enabled}" keystore="${sign.keystore}" keystorepassword="${sign.keystore.password}" alias="${sign.alias}" aliaspassword="${sign.alias.password}" encoding="UTF-8"/>
  629. </target>
  630. <target name="sign-jar" if="sign.jar.trigger">
  631. <signjar jar="${dist.dir}/${dist.jar}" alias="${sign.alias}" keystore="${sign.keystore}" storepass="${sign.keystore.password}" keypass="${sign.alias.password}"/>
  632. </target>
  633. <!--savaje-build-jnlp-->
  634. <target name="savaje-prepare-icon" if="savaje-platform.trigger" unless="savaje.icon.invalid">
  635. <pathconvert property="savaje.application.icon.name" pathsep=" ">
  636. <path path="${savaje.application.icon}"/>
  637. <chainedmapper>
  638. <flattenmapper/>
  639. <globmapper from="*" to="*"/>
  640. </chainedmapper>
  641. </pathconvert>
  642. <mkdir dir="${dist.dir}/lib"/>
  643. <copy tofile="${dist.dir}/lib/${savaje.application.icon.name}" file="${savaje.application.icon}" overwrite="true" failonerror="false"/>
  644. </target>
  645. <target name="savaje-build-jnlp" depends="savaje-prepare-icon" if="savaje-platform.trigger">
  646. <mkdir dir="${build.dir}/jnlp/"/>
  647. <taskdef resource="org/netbeans/modules/j2me/cdc/project/savaje/defs.properties">
  648. <classpath>
  649. <pathelement path="${libs.savaje-ant-utils.classpath}"/>
  650. </classpath>
  651. </taskdef>
  652. <jnlp dir="${build.dir}/jnlp/" file="bundle.jnlp" codebase="WTK_AGUI" distjar="lib/${dist.jar.name}" applicationicon="lib/${savaje.application.icon.name}" smallicon="${savaje.application.icon.small}" focusedicon="${savaje.application.icon.focused}" applicationtitle="${application.name}" applicationvendor="${application.vendor}" applicationDescription="${application.description}" applicationArgs="${application.args}" mainClass="${main.class}" debug="${savaje.bundle.debug}" debugport="${savaje.bundle.debug.port}">
  653. <fileset dir="${dist.dir}/lib"/>
  654. </jnlp>
  655. <policy file="${build.dir}/jnlp/bundle.policy" codebase="WTK_AGUI"/>
  656. <copy tofile="${dist.dir}/lib/classes.jar" file="${dist.dir}/${dist.jar}" overwrite="true"/>
  657. <copy todir="${dist.dir}" file="${build.dir}/jnlp/bundle.jnlp" overwrite="true"/>
  658. <copy tofile="${dist.dir}/bundle.policy" file="${build.dir}/jnlp/bundle.policy" overwrite="true"/>
  659. <copy todir="${dist.dir}/lib" overwrite="true" failonerror="false">
  660. <fileset dir="${resources.dir}"/>
  661. </copy>
  662. </target>
  663. <!--jar-->
  664. <target name="pre-jar"/>
  665. <target name="post-jar"/>
  666. <target name="jar" depends="preverify,pre-jar,set-password,create-jad,do-extra-libs,nokiaS80-create-manifest,jad-jsr211-properties,semc-build-j9,do-jar,do-jar-no-manifest,update-jad,sign-jar,savaje-build-jnlp,post-jar" description="Build jar and application descriptor."/>
  667. <!--override-jad-->
  668. <target name="override-jad" if="override.jarurl.trigger">
  669. <property name="deployment.jarurl" value="${dist.jar}"/>
  670. <nb-jad jadfile="${dist.dir}/${dist.jad}" jarfile="${dist.dir}/${dist.jar}" url="${deployment.jarurl}" sign="${sign.enabled}" keystore="${sign.keystore}" keystorepassword="${sign.keystore.password}" alias="${sign.alias}" aliaspassword="${sign.alias.password}" encoding="UTF-8"/>
  671. </target>
  672. <!--semc-make-sis-->
  673. <target name="-semc-sis-init" if="semc-platform.trigger" description="Init necessary properties for SEMC platform">
  674. <property name="pprolauncher.dir" value="${platform.home}/epoc32/tools/ppro-custom-launcher/output/arm/PProLauncher${semc.application.uid}"/>
  675. </target>
  676. <target name="semc-ppro-arm" if="semc-platform.trigger" description="Builds neccessary files for semc device">
  677. <exec executable="${platform.home}/epoc32/tools/create-ppro-app.bat" dir="${platform.home}/epoc32/tools/">
  678. <arg value="arm"/>
  679. <arg value="${application.name}"/>
  680. <arg value="${semc.application.uid}"/>
  681. <arg value="${j9.dist}"/>
  682. <arg value="${semc.application.caps}"/>
  683. <env key="SDKDRIVE" value="${sdkdrive}"/>
  684. <env key="EPOCROOT" value="${epocroot}"/>
  685. <env key="Path" value="${epocpath}"/>
  686. </exec>
  687. </target>
  688. <target name="semc-make-sis-icon" if="semc-platform.trigger" unless="semc.icon.invalid">
  689. <copy file="${semc.application.icon}" tofile="${pprolauncher.dir}/${semc.application.uid}.mbm" failonerror="false"/>
  690. </target>
  691. <target name="semc-make-sis" depends="semc-ppro-arm,semc-make-sis-icon" if="semc-platform.trigger" unless="no.application.uid" description="Builds SIS file for device">
  692. <property name="dll.dir" location="dll"/>
  693. <mkdir dir="${dll.dir}"/>
  694. <copy todir="${pprolauncher.dir}">
  695. <fileset dir="${dist.dir}">
  696. <exclude name="javadoc/**"/>
  697. </fileset>
  698. </copy>
  699. <copy todir="${pprolauncher.dir}">
  700. <fileset dir="${dll.dir}">
  701. <include name="**/*.dll"/>
  702. </fileset>
  703. </copy>
  704. <copy todir="${pprolauncher.dir}" failonerror="false">
  705. <fileset dir="${resources.dir}"/>
  706. </copy>
  707. <pkgmake workdir="${pprolauncher.dir}" id="${semc.application.uid}" appname="${application.name}" appicon="${semc.application.uid}.mbm" vendor="${application.vendor}" version="${deployment.number}" logo="${logo.image}" logoinstallonly="${logo.image.installonly}">
  708. <fileset dir="${dist.dir}">
  709. <exclude name="javadoc/**"/>
  710. </fileset>
  711. <fileset dir="${dll.dir}">
  712. <include name="**/*.dll"/>
  713. </fileset>
  714. <fileset dir="${resources.dir}"/>
  715. </pkgmake>
  716. <exec executable="${platform.home}/epoc32/tools/makesis" dir="${pprolauncher.dir}">
  717. <arg value="-d${pprolauncher.dir}"/>
  718. <arg value="PProLauncher${semc.application.uid}.pkg"/>
  719. <arg value="${application.name}.sis"/>
  720. <env key="SDKDRIVE" value="${sdkdrive}"/>
  721. <env key="EPOCROOT" value="${epocroot}"/>
  722. <env key="Path" value="${epocpath}"/>
  723. </exec>
  724. <copy todir="${dist.dir}">
  725. <fileset dir="${pprolauncher.dir}">
  726. <include name="**/*.SIS"/>
  727. <include name="**/*.sis"/>
  728. </fileset>
  729. </copy>
  730. </target>
  731. <target name="semc-sign-sis" if="semc-platform.trigger" depends="semc-make-sis" unless="no.certificateorkey" description="Sign SIS file">
  732. <exec executable="${platform.home}/epoc32/tools/signsis" dir="${pprolauncher.dir}">
  733. <arg value="-s"/>
  734. <arg value="${pprolauncher.dir}/${application.name}.sis"/>
  735. <arg value="${pprolauncher.dir}/${application.name}-SIGNED.sis"/>
  736. <arg value="${semc.certificate.path}"/>
  737. <arg value="${semc.private.key.path}"/>
  738. <arg value="${semc.private.key.password}"/>
  739. <env key="SDKDRIVE" value="${sdkdrive}"/>
  740. <env key="EPOCROOT" value="${epocroot}"/>
  741. <env key="Path" value="${epocpath}"/>
  742. </exec>
  743. <copy todir="${dist.dir}">
  744. <fileset dir="${pprolauncher.dir}">
  745. <include name="**/*.SIS"/>
  746. <include name="**/*.sis"/>
  747. </fileset>
  748. </copy>
  749. </target>
  750. <target name="semc-no-sign-sis" depends="semc-make-sis" if="no.certificateorkey" unless="no.application.uid" description="Prints out only info when SIS is not signed ">
  751. <echo message="Signed SIS was not created! Set up path to certificate and private key in project properties!"/>
  752. </target>
  753. <target name="-pre-semc-sis" if="semc-platform.trigger" description="Customizable target called before SIS file is built"/>
  754. <target name="semc-sis" if="semc-platform.trigger" depends="-semc-sis-init, -pre-semc-sis, semc-sign-sis,semc-no-sign-sis, -post-semc-sis" unless="no.application.uid"/>
  755. <target name="-post-semc-sis" if="semc-platform.trigger" description="Customizable target called after SIS file is built"/>
  756. <!--increment-app-version-->
  757. <target name="increment-app-version" if="app-version.autoincrement.trigger">
  758. <propertyfile file="nbproject/private/private.properties">
  759. <entry key="deployment.counter" type="int" operation="+" default="2" pattern="0"/>
  760. <entry key="deployment.number" value="000000${deployment.counter}"/>
  761. </propertyfile>
  762. <property name="deployment.number.pattern" value="\2\3.\5\6.\8\9"/>
  763. <replaceregexp byline="true" file="nbproject/private/private.properties" match="^deployment.number=[0-9]*(0|([1-9]))([0-9])(0|([1-9]))([0-9])(0|([1-9]))([0-9])$" replace="deployment.number=${deployment.number.pattern}"/>
  764. </target>
  765. <!--build-->
  766. <target name="pre-build"/>
  767. <target name="post-build"/>
  768. <target name="build" depends="jar,pre-build,override-jad,semc-sis,increment-app-version,post-build" description="Builds final distribution of the application."/>
  769. <!--open-netmon-->
  770. <target name="netmon.check">
  771. <condition property="netmon.allowed">
  772. <and>
  773. <not>
  774. <isset property="bdj-platform.trigger"/>
  775. </not>
  776. <isset property="netbeans.home"/>
  777. <isset property="is.mesdk_netmon"/>
  778. </and>
  779. </condition>
  780. </target>
  781. <target name="open-netmon" description="Open network monitor" depends="netmon.check" if="netmon.allowed">
  782. <opennetmon device="${platform.device}"/>
  783. </target>
  784. <!--cldc-run-->
  785. <target name="cldc-run" if="cldc-platform.trigger">
  786. <nb-run jadfile="${dist.dir}/${dist.jad}" jarfile="${dist.dir}/${dist.jar}" jadurl="${dist.jad.url}" device="${platform.device}" platformhome="${platform.home}" platformtype="${platform.type}" execmethod="${run.method}" securitydomain="${evaluated.run.security.domain}" commandline="${platform.runcommandline}" classpath="${platform.bootclasspath}:${dist.dir}/${dist.jar}" cmdoptions="${run.cmd.options}"/>
  787. </target>
  788. <!--semc-run-and-debug-prepare-targets-->
  789. <target name="semc-icon-assembly" if="semc-platform.trigger" unless="semc.icon.invalid">
  790. <copy file="${semc.application.icon}" tofile="${platform.home}/epoc32/release/winscw/udeb/z/Resource/Apps/${semc.application.uid}.mbm" failonerror="false"/>
  791. <iconassembly home="${platform.home}" uid="${semc.application.uid}" count="${application.icon.count}"/>
  792. </target>
  793. <target name="semc-ppro-emulator" if="semc-platform.trigger" description="Builds neccessary files for semc emulator">
  794. <exec executable="${platform.home}/epoc32/tools/create-ppro-app.bat" dir="${platform.home}/epoc32/tools/">
  795. <arg value="win32"/>
  796. <arg value="${application.name}"/>
  797. <arg value="${semc.application.uid}"/>
  798. <arg value="${j9.dist}"/>
  799. <arg value="${semc.application.caps}"/>
  800. <env key="SDKDRIVE" value="${sdkdrive}"/>
  801. <env key="EPOCROOT" value="${epocroot}"/>
  802. <env key="Path" value="${epocpath}"/>
  803. </exec>
  804. </target>
  805. <target name="semc-do-run" if="semc-platform.trigger" description="Prepare log folders, copy necessary files">
  806. <copy todir="${platform.home}/epoc32/winscw/C/private/${semc.application.uid}">
  807. <fileset dir="${dist.dir}">
  808. <exclude name="javadoc/**"/>
  809. </fileset>
  810. </copy>
  811. <mkdir dir="${platform.home}/epoc32/winscw/c/logs/j9vm"/>
  812. <epocinipath file="${platform.home}/epoc32/data/epoc.ini"/>
  813. <exec executable="${platform.home}/epoc32/release/winscw/udeb/epoc.exe">
  814. <env key="SDKDRIVE" value="${sdkdrive}"/>
  815. <env key="EPOCROOT" value="${epocroot}"/>
  816. <env key="Path" value="${epocpath}"/>
  817. </exec>
  818. </target>
  819. <!--semc-run-->
  820. <target name="semc-run" depends="semc-icon-assembly,semc-ppro-emulator,semc-do-run" if="semc-platform.trigger"/>
  821. <!--savaje-run-->
  822. <target name="savaje-run" if="savaje-platform.trigger">
  823. <sunEmulatorExec home="${platform.home}" mainclass="${main.class}" args="${application.args}" jvmargs="${run.cmd.options}" device="${platform.device}" profile="${platform.profile}" xlet="${main.class.xlet}" applet="${main.class.applet}">
  824. <fileset dir="${dist.dir}">
  825. <exclude name="javadoc/**"/>
  826. </fileset>
  827. </sunEmulatorExec>
  828. </target>
  829. <!--sjmc-run-->
  830. <target name="sjmc-run" if="sjmc-platform.trigger">
  831. <taskdef name="sjmcEmulatorExec" classname="org.netbeans.modules.j2me.cdc.project.sjmc.SJMCToolkitEmulatorExecTask" classpath="${libs.sjmc-ant-utils.classpath}"/>
  832. <sjmcEmulatorExec home="${platform.home}" mainclass="${main.class}" args="${application.args}" jvmargs="${run.cmd.options}" device="${platform.device}" profile="${platform.profile}" xlet="${main.class.xlet}" applet="${main.class.applet}">
  833. <fileset dir="${dist.dir}">
  834. <exclude name="javadoc/**"/>
  835. </fileset>
  836. </sjmcEmulatorExec>
  837. </target>
  838. <!--ojec-run-->
  839. <target name="ojec-run" if="ojec-platform.trigger">
  840. <taskdef name="ojecEmulatorExec" classname="org.netbeans.modules.j2me.cdc.project.ojec.OJECToolkitEmulatorExecTask" classpath="${libs.ojec-ant-utils.classpath}"/>
  841. <ojecEmulatorExec home="${platform.home}" mainclass="${main.class}" args="${application.args}" jvmargs="${run.cmd.options}" device="${platform.device}" profile="${platform.profile}" xlet="${main.class.xlet}" applet="${main.class.applet}">
  842. <fileset dir="${dist.dir}">
  843. <exclude name="javadoc/**"/>
  844. </fileset>
  845. </ojecEmulatorExec>
  846. </target>
  847. <!--nokiaS80-run-->
  848. <target name="nokiaS80-run" if="nokiaS80-platform.trigger">
  849. <mkdir dir="${platform.home}/epoc32/wins/c/PP_Applications"/>
  850. <mkdir dir="${platform.home}/epoc32/wins/c/logs/j9vm"/>
  851. <taskdef name="nokiaexec" classname="org.netbeans.modules.j2me.cdc.project.nokiaS80.NokiaEmulatorExecTask" classpath="${libs.nokiaS80-ant-utils.classpath}"/>
  852. <nokiaexec jvmargs="${run.jvmargs}" mainclass="${main.class}" args="${application.args}" home="${platform.home}" device="${platform.device}" xlet="${main.class.xlet}" applet="${main.class.applet}">
  853. <fileset dir="${dist.dir}">
  854. <exclude name="javadoc/**"/>
  855. </fileset>
  856. </nokiaexec>
  857. </target>
  858. <!--cdc-hi-run-->
  859. <target name="-pre-cdc-hi-run" if="cdc-hi-platform.trigger"/>
  860. <target name="-cdc-hi-run" if="cdc-hi-platform.trigger">
  861. <fail message="Main class is not set!">
  862. <condition>
  863. <equals arg1="${main.class}" arg2=""/>
  864. </condition>
  865. </fail>
  866. <exec executable="${platform.home}/bin/emulator">
  867. <arg value="-cp"/>
  868. <arg value="${basedir}/${dist.dir}/${dist.jar}"/>
  869. <arg value="-Xdevice:${platform.device}"/>
  870. <arg value="${run.cmd.options}"/>
  871. <arg value="-Xmain:${main.class}"/>
  872. <arg value="${application.args}"/>
  873. </exec>
  874. </target>
  875. <target name="-post-cdc-hi-run" if="cdc-hi-platform.trigger"/>
  876. <target name="cdc-hi-run" if="cdc-hi-platform.trigger" depends="-pre-cdc-hi-run, -cdc-hi-run, -post-cdc-hi-run"/>
  877. <!--open-profiler-->
  878. <target name="profiler.check">
  879. <condition property="profiler.allowed">
  880. <and>
  881. <not>
  882. <isset property="bdj-platform.trigger"/>
  883. </not>
  884. <isset property="netbeans.home"/>
  885. <isset property="is.mesdk_profiler"/>
  886. </and>
  887. </condition>
  888. </target>
  889. <target name="open-profiler" description="Open profiler snapshot" depends="profiler.check" if="profiler.allowed">
  890. <openprofiler device="${platform.device}"/>
  891. </target>
  892. <!--run-->
  893. <target name="pre-run"/>
  894. <target name="run" depends="jar,pre-run,open-netmon,cldc-run,semc-run,savaje-run,sjmc-run,ojec-run,nokiaS80-run,cdc-hi-run,open-profiler" description="Run MIDlet suite."/>
  895. <target name="run-no-build" depends="init,pre-run,open-netmon,cldc-run,semc-run,savaje-run,sjmc-run,ojec-run,nokiaS80-run,cdc-hi-run,open-profiler" description="Quick Run already built MIDlet suite."/>
  896. <!--cldc-debug-->
  897. <target name="cldc-debug" if="cldc-platform.trigger">
  898. <parallel>
  899. <nb-run debug="true" debugsuspend="true" debugserver="true" debuggeraddressproperty="jpda.port" platformtype="${platform.type}" platformhome="${platform.home}" device="${platform.device}" jadfile="${dist.dir}/${dist.jad}" jadurl="${dist.jad.url}" jarfile="${dist.dir}/${dist.jar}" execmethod="${run.method}" securitydomain="${evaluated.run.security.domain}" commandline="${platform.debugcommandline}" classpath="${platform.bootclasspath}:${dist.dir}/${dist.jar}" cmdoptions="${run.cmd.options}"/>
  900. <sequential>
  901. <sleep seconds="5"/>
  902. <antcall target="nbdebug"/>
  903. </sequential>
  904. </parallel>
  905. </target>
  906. <!--semc-debug-->
  907. <!--semc-build-j9-debug-->
  908. <target name="semc-build-j9-debug" if="semc-platform.trigger">
  909. <fail message="Main class is not set!">
  910. <condition>
  911. <equals arg1="${main.class}" arg2=""/>
  912. </condition>
  913. </fail>
  914. <j9builder jvmargs="${run.jvmargs} -Xrunjdwp:server=n,address=${jpda.port}" mainclass="${main.class}" args="${application.args}" platform="${platform.type}" home="${platform.home}" dist="${j9.dist}" id="${semc.application.uid}" xlet="${main.class.xlet}" applet="${main.class.applet}" jarname="${dist.jar}"/>
  915. </target>
  916. <target name="semc-debug-start" if="semc-platform.trigger">
  917. <nbjpdastart transport="dt_socket" addressproperty="jpda.port" name="${main.class}">
  918. <classpath>
  919. <path path="${build.classes.dir}"/>
  920. </classpath>
  921. <bootclasspath>
  922. <path path="${platform.bootclasspath}"/>
  923. </bootclasspath>
  924. </nbjpdastart>
  925. </target>
  926. <target name="semc-debug" depends="semc-debug-start,semc-build-j9-debug,semc-icon-assembly,semc-ppro-emulator,semc-do-run" if="semc-platform.trigger"/>
  927. <!--savaje-debug-->
  928. <target name="savaje-debug" if="savaje-platform.trigger">
  929. <parallel>
  930. <sunEmulatorExec home="${platform.home}" mainclass="${main.class}" args="${application.args}" jvmargs="${run.cmd.options}" device="${platform.device}" profile="${platform.profile}" xlet="${main.class.xlet}" applet="${main.class.applet}" debug="true" debuggeraddressproperty="jpda.port">
  931. <fileset dir="${dist.dir}">
  932. <exclude name="javadoc/**"/>
  933. </fileset>
  934. </sunEmulatorExec>
  935. <sequential>
  936. <sleep seconds="5"/>
  937. <antcall target="nbdebug"/>
  938. </sequential>
  939. </parallel>
  940. </target>
  941. <!--sjmc-debug-->
  942. <target name="sjmc-debug" if="sjmc-platform.trigger">
  943. <taskdef name="sjmcEmulatorExec" classname="org.netbeans.modules.j2me.cdc.project.sjmc.SJMCToolkitEmulatorExecTask" classpath="${libs.sjmc-ant-utils.classpath}"/>
  944. <parallel>
  945. <sjmcEmulatorExec home="${platform.home}" mainclass="${main.class}" args="${application.args}" jvmargs="${run.cmd.options}" device="${platform.device}" profile="${platform.profile}" xlet="${main.class.xlet}" applet="${main.class.applet}" debug="true" debuggeraddressproperty="jpda.port">
  946. <fileset dir="${dist.dir}">
  947. <exclude name="javadoc/**"/>
  948. </fileset>
  949. </sjmcEmulatorExec>
  950. <sequential>
  951. <sleep seconds="1"/>
  952. <antcall target="nbdebug"/>
  953. </sequential>
  954. </parallel>
  955. </target>
  956. <!--ojec-debug-->
  957. <target name="ojec-debug" if="ojec-platform.trigger">
  958. <taskdef name="ojecEmulatorExec" classname="org.netbeans.modules.j2me.cdc.project.ojec.OJECToolkitEmulatorExecTask" classpath="${libs.ojec-ant-utils.classpath}"/>
  959. <parallel>
  960. <ojecEmulatorExec home="${platform.home}" mainclass="${main.class}" args="${application.args}" jvmargs="${run.cmd.options}" device="${platform.device}" profile="${platform.profile}" xlet="${main.class.xlet}" applet="${main.class.applet}" debug="true" debuggeraddressproperty="jpda.port">
  961. <fileset dir="${dist.dir}">
  962. <exclude name="javadoc/**"/>
  963. </fileset>
  964. </ojecEmulatorExec>
  965. <sequential>
  966. <sleep seconds="1"/>
  967. <antcall target="nbdebug"/>
  968. </sequential>
  969. </parallel>
  970. </target>
  971. <!--cdc-hi-debug-->
  972. <target name="-pre-cdc-hi-debug" if="cdc-hi-platform.trigger"/>
  973. <target name="-cdc-hi-debug" if="cdc-hi-platform.trigger">
  974. <taskdef name="freePortRetriever" classname="org.netbeans.modules.j2me.cdc.project.savaje.FreePortRetriever" classpath="${libs.savaje-ant-utils.classpath}"/>
  975. <freePortRetriever debuggerPortProperty="active.debug.port"/>
  976. <parallel>
  977. <exec executable="${platform.home}/bin/emulator">
  978. <arg value="-cp"/>
  979. <arg value="${basedir}/${dist.dir}/${dist.jar}"/>
  980. <arg value="-Xdevice:${platform.device}"/>
  981. <arg value="-Xmain:${main.class}"/>
  982. <arg value="-Xrunjdwp:transport=dt_socket,address=${active.debug.port},server=y,suspend=y"/>
  983. <arg value="-Xdebug"/>
  984. </exec>
  985. <sequential>
  986. <property name="debug.delay" value="500"/>
  987. <nb-mobility-debug address="${active.debug.port}" name="${app.codename}" delay="${debug.delay}" timeout="${debug.timeout}" period="2000"/>
  988. </sequential>
  989. </parallel>
  990. </target>
  991. <target name="-post-cdc-hi-debug" if="cdc-hi-platform.trigger"/>
  992. <target name="cdc-hi-debug" if="cdc-hi-platform.trigger" depends="-pre-cdc-hi-debug, -cdc-hi-debug, -post-cdc-hi-debug"/>
  993. <!--nokiaS80-debug-->
  994. <target name="nokiaS80-debug" if="nokiaS80-platform.trigger">
  995. <taskdef name="j9builder" classname="org.netbeans.modules.j2me.cdc.project.J9Builder" classpath="${libs.cdc-ant-utils.classpath}"/>
  996. <j9builder jvmargs="${run.jvmargs} -Xrunjdwp:server=n,address=${jpda.port}" mainclass="${main.class}" args="${application.args}" platform="${platform.type}" home="${platform.home}" dist="${j9.dist}" id="NOKIA" xlet="${main.class.xlet}" applet="${main.class.applet}" jarname="${dist.jar}"/>
  997. <mkdir dir="${platform.home}/epoc32/wins/c/logs/j9vm"/>
  998. <taskdef name="nokiaexec" classname="org.netbeans.modules.j2me.cdc.project.nokiaS80.NokiaEmulatorExecTask" classpath="${libs.nokiaS80-ant-utils.classpath}"/>
  999. <parallel>
  1000. <nokiaexec debug="true" debuggeraddressproperty="jpda.port" jvmargs="${run.jvmargs}" mainclass="${main.class}" args="${application.args}" home="${platform.home}" device="${platform.device}" xlet="${main.class.xlet}" applet="${main.class.applet}">
  1001. <fileset dir="${dist.dir}">
  1002. <exclude name="javadoc/**"/>
  1003. </fileset>
  1004. </nokiaexec>
  1005. <sequential>
  1006. <sleep seconds="10"/>
  1007. <antcall target="nbdebug"/>
  1008. </sequential>
  1009. </parallel>
  1010. </target>
  1011. <!--debug-->
  1012. <target name="remove-timestamp">
  1013. <delete file="$/.timestamp"/>
  1014. </target>
  1015. <target name="pre-debug"/>
  1016. <target name="debug" description="Debug project." depends="clean,jar,remove-timestamp,pre-debug,cldc-debug,semc-debug,savaje-debug,sjmc-debug,ojec-debug,cdc-hi-debug,nokiaS80-debug"/>
  1017. <target name="nbdebug" description="Start NetBeans debugger" if="netbeans.home">
  1018. <property name="debug.delay" value="5000"/>
  1019. <nb-mobility-debug address="${jpda.port}" name="${app.codename}" delay="${debug.delay}" timeout="${debug.timeout}" period="2000"/>
  1020. </target>
  1021. <target name="debug-run-base" depends="cldc-debug-run,cdc-hi-debug-run"/>
  1022. <target name="-pre-cldc-debug-run" if="cldc-platform.trigger"/>
  1023. <target name="-cldc-debug-run" depends="init,jar" if="cldc-platform.trigger">
  1024. <echo> Starting emulator with port number ${active.debug.port} </echo>
  1025. <exec executable="${platform.home}/bin/emulator">
  1026. <arg value="-Xdescriptor:${basedir}/${dist.dir}/${dist.jad}"/>
  1027. <arg value="-Xdevice:${platform.device}"/>
  1028. <arg value="-Xdebug"/>
  1029. <arg value="-Xrunjdwp:transport=dt_socket,address=${active.debug.port},server=y,suspend=y"/>
  1030. </exec>
  1031. </target>
  1032. <target name="-post-cldc-debug-run" if="cldc-platform.trigger"/>
  1033. <target name="cldc-debug-run" if="cldc-platform.trigger" depends="-pre-cldc-debug-run, -cldc-debug-run, -post-cldc-debug-run"/>
  1034. <target name="-pre-cdc-hi-debug-run" if="cdc-hi-platform.trigger"/>
  1035. <target name="-cdc-hi-debug-run" depends="init,jar" if="cdc-hi-platform.trigger">
  1036. <fail message="Main class is not set!">
  1037. <condition>
  1038. <equals arg1="${main.class}" arg2=""/>
  1039. </condition>
  1040. </fail>
  1041. <echo> Starting emulator with port number ${active.debug.port} </echo>
  1042. <exec executable="${platform.home}/bin/emulator">
  1043. <arg value="-cp"/>
  1044. <arg value="${basedir}/${dist.dir}/${dist.jar}"/>
  1045. <arg value="-Xdevice:${platform.device}"/>
  1046. <arg value="-Xmain:${main.class}"/>
  1047. <arg value="-Xdebug"/>
  1048. <arg value="-Xrunjdwp:transport=dt_socket,address=${active.debug.port},server=y,suspend=y"/>
  1049. </exec>
  1050. </target>
  1051. <target name="-post-cdc-hi-debug-run" if="cdc-hi-platform.trigger"/>
  1052. <target name="cdc-hi-debug-run" if="cdc-hi-platform.trigger" depends="-pre-cdc-hi-debug-run, -cdc-hi-debug-run, -post-cdc-hi-debug-run"/>
  1053. <!--javadoc-->
  1054. <target name="browse-javadoc" if="netbeans.home" unless="no.javadoc.preview">
  1055. <nbbrowse file="${dist.javadoc.dir}/index.html"/>
  1056. </target>
  1057. <target name="javadoc" depends="preprocess">
  1058. <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
  1059. <mkdir dir="${dist.javadoc.dir}"/>
  1060. <javadoc source="${javac.source}" destdir="${dist.javadoc.dir}" bootclasspath="${platform.bootclasspath}" notree="${javadoc.notree}" use="${javadoc.use}" nonavbar="${javadoc.nonavbar}" noindex="${javadoc.noindex}" splitindex="${javadoc.splitindex}" author="${javadoc.author}" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}" private="${javadoc.private}" encoding="${javac.encoding}" docencoding="${javac.encoding}" charset="${javac.encoding}">
  1061. <classpath>
  1062. <path path="${libs.classpath}"/>
  1063. </classpath>
  1064. <sourcepath>
  1065. <pathelement location="${buildsystem.baton}"/>
  1066. </sourcepath>
  1067. </javadoc>
  1068. <antcall target="browse-javadoc"/>
  1069. </target>
  1070. <!--clean and build-->
  1071. <target name="rebuild" depends="clean,build" description="Rebuild the application."/>
  1072. <target name="clean-timestamp">
  1073. <delete file="${build.dir}/.timestamp"/>
  1074. </target>
  1075. <target name="clean-preprocessed">
  1076. <delete dir="${preprocessed.dir}"/>
  1077. </target>
  1078. <target name="clean-classes">
  1079. <delete dir="${build.classes.dir}"/>
  1080. </target>
  1081. <target name="clean-obfuscated">
  1082. <delete file="${obfuscator.srcjar}"/>
  1083. <delete file="${obfuscator.destjar}"/>
  1084. <delete dir="${obfuscated.classes.dir}"/>
  1085. </target>
  1086. <target name="clean-preverified">
  1087. <delete dir="${preverify.sources.dir}"/>
  1088. <delete dir="${preverify.classes.dir}"/>
  1089. </target>
  1090. <target name="clean-manifest" if="manifest.build.file">
  1091. <delete file="${manifest.build.file}"/>
  1092. </target>
  1093. <target name="clean-jar">
  1094. <delete file="${dist.dir}/${dist.jar}"/>
  1095. </target>
  1096. <target name="clean-jad">
  1097. <delete file="${dist.dir}/${dist.jad}"/>
  1098. </target>
  1099. <target name="clean-javadoc">
  1100. <delete dir="${dist.javadoc.dir}"/>
  1101. </target>
  1102. <target name="clean-j9" if="j9.dist">
  1103. <delete file="${j9.dist}"/>
  1104. </target>
  1105. <target name="clean-semc" if="semc-platform.trigger">
  1106. <delete dir="${dist.dir}" includes="*.sis,*.SIS"/>
  1107. <delete dir="${platform.home}/epoc32/tools/ppro-custom-launcher/output/win32/PProLauncher${semc.application.uid}"/>
  1108. <delete dir="${platform.home}/epoc32/tools/ppro-custom-launcher/output/arm/PProLauncher${semc.application.uid}"/>
  1109. <delete file="${platform.home}/epoc32/release/winscw/udeb/PProLauncher${semc.application.uid}.exe"/>
  1110. <delete file="${platform.home}/epoc32/release/winscw/udeb/z/Resource/Apps/PProLauncher${semc.application.uid}.rsc"/>
  1111. <delete file="${platform.home}/epoc32/release/winscw/udeb/z/private/10003a3f/apps/PProLauncher${semc.application.uid}_reg.rsc"/>
  1112. <delete file="${platform.home}/epoc32/release/winscw/udeb/z/Resource/Apps/PProLauncher${semc.application.uid}_loc.R01"/>
  1113. <delete file="${platform.home}/epoc32/release/winscw/udeb/z/Resource/Apps/${semc.application.uid}.mbm"/>
  1114. <delete file="${platform.home}/epoc32/data/Z/private/10003a3f/apps/PProLauncher${semc.application.uid}_reg.rsc"/>
  1115. <delete file="${platform.home}/epoc32/data/Z/Resource/Apps/PProLauncher${semc.application.uid}.rsc"/>
  1116. <delete file="${platform.home}/epoc32/data/Z/Resource/Apps/PProLauncher${semc.application.uid}_loc.R01"/>
  1117. <delete dir="${platform.home}/epoc32/winscw/C/private/${semc.application.uid}"/>
  1118. </target>
  1119. <target name="clean-savaje" if="savaje-platform.trigger">
  1120. <delete dir="${build.dir}/jnlp"/>
  1121. <delete file="${dist.dir}/bundle.jnlp"/>
  1122. <delete file="${dist.dir}/bundle.policy"/>
  1123. <delete dir="${dist.dir}/lib"/>
  1124. </target>
  1125. <target name="clean-sjmc" if="sjmc-platform.trigger">
  1126. <delete dir="${dist.dir}/lib"/>
  1127. </target>
  1128. <target name="clean-ojec" if="ojec-platform.trigger">
  1129. <delete dir="${dist.dir}/lib"/>
  1130. </target>
  1131. <!--clean-->
  1132. <target name="pre-clean"/>
  1133. <target name="post-clean"/>
  1134. <target name="-clean-configuration">
  1135. <condition property="can.clean.config.completely">
  1136. <not>
  1137. <equals arg1="${config.active}" arg2="" trim="true"/>
  1138. </not>
  1139. </condition>
  1140. </target>
  1141. <target name="-clean-configuration-root" depends="-clean-configuration" if="can.clean.config.completely">
  1142. <delete dir="${build.dir}"/>
  1143. <delete dir="${dist.dir}"/>
  1144. <available property="dist.dir.exists" file="dist"/>
  1145. <condition property="dist.dir.empty">
  1146. <and>
  1147. <isset property="dist.dir.exists"/>
  1148. <resourcecount count="0">
  1149. <fileset dir="dist"/>
  1150. </resourcecount>
  1151. </and>
  1152. </condition>
  1153. </target>
  1154. <target name="-clean-default-configuration-root" depends="-clean-configuration" unless="can.clean.config.completely">
  1155. <tempfile deleteonexit="true" property="tmp.exclude" prefix="convert"/>
  1156. <echo file="${tmp.exclude}">${all.configurations}</echo>
  1157. <replaceregexp file="${tmp.exclude}" match="(.)(,|$)" replace="\1/**\2" flags="g"/>
  1158. <loadfile srcfile="${tmp.exclude}" property="exclude.pattern"/>
  1159. <delete file="${tmp.exclude}"/>
  1160. <delete quiet="true">
  1161. <fileset dir="${build.dir}" excludes="${exclude.pattern}"/>
  1162. </delete>
  1163. <delete quiet="true">
  1164. <fileset dir="${dist.dir}" excludes="${exclude.pattern}"/>
  1165. </delete>
  1166. <delete quiet="true">
  1167. <fileset dir="${dist.dir}/lib"/>
  1168. </delete>
  1169. <available property="dist.dir.exists" file="dist"/>
  1170. <condition property="dist.dir.empty">
  1171. <and>
  1172. <isset property="dist.dir.exists"/>
  1173. <resourcecount count="0">
  1174. <fileset dir="dist"/>
  1175. </resourcecount>
  1176. </and>
  1177. </condition>
  1178. </target>
  1179. <target name="-clean-completely" if="dist.dir.empty">
  1180. <delete dir="build" quiet="true"/>
  1181. <delete dir="dist" quiet="true"/>
  1182. </target>
  1183. <target name="do-clean" depends="pre-clean,clean-timestamp,clean-preprocessed,clean-classes,clean-obfuscated,clean-preverified,clean-manifest,clean-jar,clean-jad,clean-javadoc,clean-j9,clean-semc,clean-savaje,clean-sjmc,clean-ojec,-clean-default-configuration-root,-clean-configuration-root,-clean-completely,post-clean"/>
  1184. <target name="clean" depends="conditional-clean" if="no.clean.before.build" description="Clean build products.">
  1185. <antcall target="do-clean" inheritall="true" inheritrefs="true"/>
  1186. </target>
  1187. <!--deploy-->
  1188. <target name="pre-deploy"/>
  1189. <target name="do-deploy" if="deployment.method" unless="skip.deployment">
  1190. <fail unless="deployment.scriptfile">Property deployment.${deployment.method}.scriptfile not set. The property should point to an Ant script providing ${deployment.method} deployment.</fail>
  1191. <ant antfile="${deployment.scriptfile}" inheritall="true" inheritrefs="true"/>
  1192. <antcall target="post-deploy" inheritall="true" inheritrefs="true"/>
  1193. </target>
  1194. <target name="post-deploy"/>
  1195. <target name="deploy" depends="build,pre-deploy,do-deploy,post-deploy"/>
  1196. <!--for-all-configs targets-->
  1197. <target name="for-all-configs" depends="load-properties">
  1198. <fail unless="libs.ant-contrib.classpath">Classpath to Ant Contrib library (libs.ant-contrib.classpath property) is not set.</fail>
  1199. <property name="selected.configurations" value="${all.configurations}"/>
  1200. <taskdef resource="net/sf/antcontrib/antlib.xml">
  1201. <classpath>
  1202. <pathelement path="${libs.ant-contrib.classpath}"/>
  1203. </classpath>
  1204. </taskdef>
  1205. <for list="${selected.configurations}" param="cfg" keepgoing="true" trim="true">
  1206. <sequential>
  1207. <echo>Active project configuration: @{cfg}</echo>
  1208. <antcall target="${target.to.call}" inheritall="false" inheritrefs="false">
  1209. <param name="config.active" value="@{cfg}"/>
  1210. <propertyset>
  1211. <propertyref name="no.deps"/>
  1212. </propertyset>
  1213. </antcall>
  1214. <property name="no.deps" value="true"/>
  1215. </sequential>
  1216. </for>
  1217. </target>
  1218. <target name="jar-all">
  1219. <antcall target="for-all-configs">
  1220. <param name="target.to.call" value="jar"/>
  1221. </antcall>
  1222. </target>
  1223. <target name="build-all">
  1224. <antcall target="for-all-configs">
  1225. <param name="target.to.call" value="build"/>
  1226. </antcall>
  1227. </target>
  1228. <target name="javadoc-all">
  1229. <antcall target="for-all-configs">
  1230. <param name="target.to.call" value="javadoc"/>
  1231. </antcall>
  1232. </target>
  1233. <target name="deploy-all">
  1234. <antcall target="for-all-configs">
  1235. <param name="target.to.call" value="deploy"/>
  1236. </antcall>
  1237. </target>
  1238. <target name="rebuild-all">
  1239. <antcall target="for-all-configs">
  1240. <param name="target.to.call" value="rebuild"/>
  1241. </antcall>
  1242. </target>
  1243. <target name="clean-all">
  1244. <property file="nbproject/project.properties"/>
  1245. <fail unless="build.root.dir">Property build.root.dir is not set. By default its value should be \"build\".</fail>
  1246. <fail unless="dist.root.dir">Property dist.root.dir is not set. By default its value should be \"dist\".</fail>
  1247. <antcall target="for-all-configs">
  1248. <param name="target.to.call" value="clean"/>
  1249. </antcall>
  1250. </target>
  1251. </project>