build.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <project
  2. name="com.nokia.xfolite.XFormsMidlet"
  3. default="j2mepolish">
  4. <!-- import user specific properties -->
  5. <property file="${user.name}.properties" />
  6. <!-- The polish.home property needs to point to the directory -->
  7. <!-- containing the J2ME Polish installation. -->
  8. <property name="polish.home" location="C:\Program Files\J2ME-Polish" />
  9. <!-- property name="polish.client.source" location="C:\Program Files\J2ME-Polish\build"/ -->
  10. <!-- import global properties -->
  11. <property file="${polish.home}/global.properties" />
  12. <!-- the device for the test mode - you can define it on the command-line
  13. using the -D switch, e.g. ant -Ddevice=Generic/midp2 emulator -->
  14. <property name="testdevices" value="Nokia/Series40E5FP1" />
  15. <property name="devices" value="Nokia/E61i" />
  16. <property name="releasedevices" value="Nokia/2330_custom,Nokia/E90_custom,Nokia/E61i,Nokia/E50,Nokia/E70,Nokia/6680,Generic/DefaultColorPhone" />
  17. <!-- Definition of the J2ME Polish task: -->
  18. <taskdef name="j2mepolish"
  19. classname="de.enough.polish.ant.PolishTask"
  20. classpath="${polish.home}/lib/enough-j2mepolish-build.jar:${polish.home}/lib/jdom.jar"
  21. />
  22. <!-- build targets, each target can be called via "ant [name]",
  23. e.g. "ant clean", "ant test j2mepolish" or just "ant" for calling the default-target -->
  24. <target name="setdeploy"
  25. description="Call this target first to set the OTA download-URL, e.g. ant setdeploy j2mepolish"
  26. >
  27. <property name="deploy-url" value="http://www.company.com/download/" />
  28. </target>
  29. <target name="enableDebug"
  30. description="Call this target first to skip the obfuscation step, call the emulator and start the debugger, e.g. ant enableDebug j2mepolish"
  31. >
  32. <property name="debug" value="true" />
  33. </target>
  34. <!-- Disable signing -->
  35. <target name="no-sign" description="Disables signing">
  36. <property name="signing.disabled" value="true" />
  37. <echo level="info" message="Signing is disabled..." />
  38. </target>
  39. <target name="test"
  40. description="Call this target first to skip the obfuscation step and call the emulator, e.g. ant test j2mepolish"
  41. >
  42. <property name="test" value="true" />
  43. <property name="signing.disabled" value="true"/>
  44. <property name="dir.work" value="build/test" />
  45. </target>
  46. <target name="init">
  47. <property name="test" value="false" />
  48. <property name="dir.work" value="build/real" />
  49. <property name="deploy-url" value="" />
  50. <property name="resource.dir" value="resources" />
  51. <tstamp/>
  52. <property name="xfolite.version" value="${DSTAMP}${TSTAMP}" />
  53. </target>
  54. <target name="j2mepolish"
  55. depends="init"
  56. description="This is the controller for the J2ME build process."
  57. >
  58. <j2mepolish>
  59. <info
  60. name="Xfolite"
  61. version="1.0.0"
  62. icon="app_icon.png"
  63. description="A midlet for running XForms forms"
  64. vendorName="Nokia Corporation"
  65. infoUrl="http://www.nokia.com"
  66. jarName="Xfolite-${xfolite.version}-${polish.vendor}-${polish.name}-${polish.locale}.jar"
  67. jarUrl="Xfolite-${xfolite.version}-${polish.vendor}-${polish.name}-${polish.locale}.jar"
  68. copyright="Copyright 2006-2010 Nokia Corporation."
  69. />
  70. <deviceRequirements if="test">
  71. <requirement name="Identifier" value="${testdevices}" />
  72. </deviceRequirements>
  73. <deviceRequirements if="release">
  74. <requirement name="Identifier" value="${releasedevices}" />
  75. </deviceRequirements>
  76. <deviceRequirements unless="test">
  77. <requirement name="Identifier" value="${devices}"/>
  78. </deviceRequirements>
  79. <!-- build settings -->
  80. <!--
  81. -->
  82. <build
  83. symbols="ExampleSymbol, AnotherExample"
  84. fullscreen="menu"
  85. usePolishGui="true"
  86. workDir="${dir.work}"
  87. >
  88. <sources>
  89. <source dir="${basedir}/source" />
  90. </sources>
  91. <midlet class="com.nokia.xfolite.client.XFormsMidlet" name="Xfolite" />
  92. <variables includeAntProperties="true" >
  93. <!--
  94. <variable name="nokia.E61hack" value="false" />
  95. <variable name="nokia.codeGeneration" value="false"/>
  96. <variable name="nokia.perfTrace.enabled" value="false"/>
  97. <variable name="polish.animationInterval" value="100" />
  98. <variable name="polish.supportInvisibleItems" value="true" />
  99. <variable name="dir.include" value="include" />
  100. <variable name="polish.TextField.useDirectInput" value="true" />
  101. <variable name="polish.key.ClearKey" value="8" />
  102. <variable name="polish.TextField.supportSymbolsEntry" value="false" />
  103. <variable name="polish.MenuBar.useExtendedMenuBar" value="true" />
  104. <variable name="polish.useScrollBar" value="true" />
  105. <variable name="polish.useDynamicStyles" value="true" />
  106. <variable name="polish.ScreenInfo.enable" value="true" />
  107. <variable name="polish.Container.allowCycling" value="false"/>
  108. -->
  109. <variable name="nokia.E61hack" value="false" />
  110. <variable name="nokia.perfTrace.enabled" value="false"/>
  111. <variable name="polish.animationInterval" value="100" />
  112. <variable name="polish.supportInvisibleItems" value="true" />
  113. <variable name="dir.include" value="include" />
  114. <variable name="polish.TextField.useDirectInput" value="true" />
  115. <variable name="polish.TextField.allowNativeModeSwitch" value="true"/>
  116. <!-- <variable name="polish.key.ClearKey" value="8" /> -->
  117. <variable name="polish.TextField.supportSymbolsEntry" value="true" />
  118. <variable name="polish.DateField.useDirectInput" value="true" />
  119. <variable name="polish.DateField.useDirectInputForPointer" value="true" />
  120. <!-- todo: define date format in localization files instead -->
  121. <variable name="polish.DateFormat" value="ymd" />
  122. <variable name="polish.MenuBar.useExtendedMenuBar" value="true" />
  123. <variable name="polish.useScrollBar" value="true" />
  124. <variable name="polish.useDynamicStyles" value="true" />
  125. <variable name="polish.ScreenInfo.enable" value="true" />
  126. <variable name="polish.Container.allowCycling" value="false"/>
  127. <variable name="polish.TextField.suppressDeleteCommand" value="false"/>
  128. <variable name="polish.TextField.keepDeleteCommand" value="false"/>
  129. <variable name="polish.css.text-wrap" value="true"/>
  130. <variable name="polish.TextField.suppressAddSymbolCommand" value="false"/>
  131. <variable name="polish.TextField.suppressClearCommand" value="true"/>
  132. <variable name="polish.TextField.includeInputInfo" value="true" />
  133. <variable name="polish.debugEnabled" value="true"/>
  134. <!-- <variable name="polish.MenuBar.useMiddleCommand" value="true"/> -->
  135. </variables>
  136. <resources
  137. dir="${resource.dir}"
  138. defaultexcludes="yes"
  139. excludes="readme.txt"
  140. >
  141. <!--
  142. <localization locales="de_DE, en_US" unless="test" />
  143. <localization locales="en_US" if="test" />
  144. -->
  145. <localization defaultLocale="en_US" locales="en_US,fi" if="localize" />
  146. <localization defaultLocale="en_US" locales="en_US" unless="localize" />
  147. </resources>
  148. <!-- obfuscator settings: do not obfuscate when the test-property is true -->
  149. <obfuscator name="ProGuard" unless="test" >
  150. <!--
  151. You can set additional parameters here, e.g.:
  152. <parameter name="optimize" value="false" />
  153. -->
  154. </obfuscator>
  155. <!-- debug settings: only include debug setting when the test-property is true -->
  156. <debug if="test" showLogOnError="false" verbose="true" level="info">
  157. <filter pattern="com.nokia.xfolite.*" level="info" />
  158. <filter pattern="com.nokia.xfolite.client.*" level="debug" />
  159. <filter pattern="com.nokia.xfolite.client.database.*" level="info" />
  160. <filter pattern="com.nokia.xfolite.xforms.model.datatypes.DataTypeDate" level="info" />
  161. <filter pattern="com.nokia.xfolite.client.XFormsController" level="info" />
  162. <filter pattern="com.nokia.xfolite.client.PolishWidgetFactory" level="info" />
  163. <filter pattern="de.enough.polish.ui.*" level="info" />
  164. </debug>
  165. <!-- user defined JAD attributes can also be used: -->
  166. <jad>
  167. <attribute name="MicroEdition-Configuration" value="CLDC-1.0"/>
  168. <attribute name="MicroEdition-Profile" value="MIDP-2.0"/>
  169. <!-- MIDlet permissions -->
  170. <attribute name="MIDlet-Permissions" value="javax.microedition.io.Connector.http,javax.microedition.io.Connector.https" />
  171. <attribute name="Xfolite-Version" value="${xfolite.version}"/>
  172. <attribute name="menu_label" value="${jad.menuLabel}" />
  173. <attribute name="form1_label" value="${jad.maintenanceFormLabel}" />
  174. <attribute name="form1_url" value="resource:/maintenance.xml" />
  175. <attribute name="form2_label" value="Form Controls" />
  176. <attribute name="form2_url" value="resource:/formcontrols.xml" />
  177. <attribute name="form3_label" value="J2ME Polish Bug Tests" />
  178. <attribute name="form3_url" value="resource:/bugs.xml" />
  179. <attribute name="form4_label" value="XFormsDB Blog" />
  180. <attribute name="form4_url" value="http://testbed.tml.hut.fi/blog/index.xformsdbmobile" />
  181. <attribute name="form5_label" value="XFormsDB Blog Admin" />
  182. <attribute name="form5_url" value="http://testbed.tml.hut.fi/blog/admin/index.xformsdbmobile" />
  183. <attribute name="form6_label" value="OpenXData Example" />
  184. <attribute name="form6_url" value="resource:/open_x_example.xml" />
  185. </jad>
  186. </build>
  187. <!-- execution of emulator(s) -->
  188. <emulator
  189. wait="true"
  190. securityDomain="trusted"
  191. enableProfiler="true"
  192. enableMemoryMonitor="true"
  193. enableNetworkMonitor="true"
  194. if="debug"
  195. >
  196. <!-- this is an example for connecting to a debugger - use the ${polish.debug.port} Ant property
  197. for getting to know the port of the debugger. In this example the
  198. "connect-debugger" target is also required.
  199. -->
  200. <!--
  201. <debugger name="antcall" target="connect-debugger" port="6001" />
  202. -->
  203. </emulator>
  204. <emulator
  205. wait="true"
  206. trace="none"
  207. securityDomain="trusted"
  208. enableProfiler="false"
  209. enableMemoryMonitor="false"
  210. enableNetworkMonitor="false"
  211. if="test and not debug"
  212. >
  213. </emulator>
  214. </j2mepolish>
  215. </target>
  216. <target
  217. name="emulator"
  218. depends="test,j2mepolish"
  219. description="invokes the emulator"
  220. >
  221. </target>
  222. <target
  223. name="perf"
  224. description="Starts application in performance testing mode">
  225. <exec executable="java">
  226. <arg value="-cp"/>
  227. <arg value="C:\APPS\microemulator\microemulator.jar;C:\APPS\microemulator\lib\microemu-jsr-75.jar"/>
  228. <arg value="-agentlib:yjpagent"/>
  229. <arg value="org.microemu.app.Main"/>
  230. <arg value="--impl"/>
  231. <arg value="org.microemu.cldc.file.FileSystem"/>
  232. <arg value="--appclassloader"/>
  233. <arg value="delegating"/>
  234. <arg value="dist/Xfolite.jad"/>
  235. </exec>
  236. </target>
  237. <target name="clean"
  238. description="allows a clean build. You should call [ant clean] whenever you made changes to devices.xml, vendors.xml or groups.xml">
  239. <delete dir="build" />
  240. <delete dir="dist" includes="**/*" />
  241. </target>
  242. <target
  243. name="cleanbuild"
  244. description="allows a clean build. You should call [ant cleanbuild] whenever you made changes to devices.xml, vendors.xml or groups.xml"
  245. depends="clean, j2mepolish"
  246. />
  247. <target name="debug" description="debugs the project" depends="enableDebug, test, j2mepolish" />
  248. <target name="localize" description="Activates localization in build process">
  249. <property name="localize" value="true"/>
  250. </target>
  251. <target name="release" depends="clean" description="Builds all release devices and adds localization automatically">
  252. <property name="release" value="true"/>
  253. <property name="localize" value="true"/>
  254. </target>
  255. </project>