root/apps/blackberry/trunk/blackberry/build.xml
@
339
| Revision 339, 11.1 kB (checked in by nickBrunwin, 4 years ago) |
|---|
| Line | |
|---|---|
| 1 | <?xml version="1.0"?> |
| 2 | |
| 3 | <project name="DotTel-BB" default="build"> |
| 4 | |
| 5 | <property name="ver" value="1.2" /> |
| 6 | <property name="appname" value="Access .tel" /> |
| 7 | <property name="codename" value="DotTel-BB" /> |
| 8 | |
| 9 | <property name="tool.dir" value="../tools/" /> |
| 10 | <property name="midp.home" value="${tool.dir}midp/" /> |
| 11 | <property name="wtk.home" value="${midp.home}" /> |
| 12 | <property name="midp.lib" location="${midp.home}lib/" /> |
| 13 | |
| 14 | <property name="wtk.cldc.version" value="1.1" /> |
| 15 | <property name="wtk.midp.version" value="2.0" /> |
| 16 | |
| 17 | <!-- <property name="antenna.jar" value="${midp.lib}antenna-bin-0.9.14.jar"/> --> |
| 18 | <property name="antenna.jar" value="../tools/midp/lib/antenna-bin-0.9.14.jar" /> |
| 19 | |
| 20 | <taskdef resource="antenna.properties" classpath="${antenna.jar}" /> |
| 21 | |
| 22 | <taskdef name="rapc" classname="com.etaras.anttask.rapc.RAPC" classpath="../tools/lib/common/anttask-rapc-1.8.jar" /> |
| 23 | |
| 24 | <property name="jdehome" location="../tools/blackberry/" /> |
| 25 | <property name="bb.buildjars.home" location="../tools/blackberry/bin/" /> |
| 26 | <property name="net_rim_api.jar" value="../tools/blackberry/lib/net_rim_api.jar" /> |
| 27 | <property name="ksoap" value="../tools/midp/lib/ksoap2-j2me-core-2.1.2.jar" /> |
| 28 | |
| 29 | <property name="src" location="src" /> |
| 30 | <property name="src4.1" location="src4.1" /> |
| 31 | <property name="src4.2" location="src4.2" /> |
| 32 | <property name="resources" location="src/resources/" /> |
| 33 | <property name="unpreverified.classes" value="classes/unpreverified" /> |
| 34 | <property name="obfuscated.classes" value="classes/obfuscated" /> |
| 35 | <property name="final.classes" value="classes/final" /> |
| 36 | |
| 37 | <property name="name" value="Access .tel" /> |
| 38 | <property name="jad.template" value="template.jad" /> |
| 39 | <property name="jadfile" value="output/tojar/${name}.jad" /> |
| 40 | <property name="jarfile" value="output/tojar/${name}.jar" /> |
| 41 | |
| 42 | <property name="manifest.template" value="template.manifest" /> |
| 43 | <property name="manifestfile" value="MANIFEST.MF" /> |
| 44 | |
| 45 | <property name="temp.jar" value="output/tojar/${name}_t.jar" /> |
| 46 | <property name="obfuscated.jar" value="output/tojar/${name}_t_o.jar" /> |
| 47 | <property name="preverified.jar" value="output/tojar/${name}_p.jar" /> |
| 48 | <property name="final.jar" value="output/tojar/${name}.jar" /> |
| 49 | |
| 50 | |
| 51 | |
| 52 | <path id="class.path"> |
| 53 | <pathelement location="../tools/midp/lib/cldcapi11.jar" /> |
| 54 | <pathelement location="../tools/midp/lib/midpapi20.jar" /> |
| 55 | <pathelement location="C:\Program Files\Research In Motion\BlackBerry JDE 4.2.0\lib\net_rim_api.jar" /> |
| 56 | </path> |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | <taskdef name="wtkbuild" classname="de.pleumann.antenna.WtkBuild" classpath="${antenna.jar}" /> |
| 62 | <taskdef name="wtkpreverify" classname="de.pleumann.antenna.WtkPreverify" classpath="${antenna.jar}" /> |
| 63 | <taskdef name="wtkpackage" classname="de.pleumann.antenna.WtkPackage" classpath="${antenna.jar}" /> |
| 64 | <taskdef name="wtkrapc" classname="de.pleumann.antenna.WtkRapc" classpath="${antenna.jar}" /> |
| 65 | |
| 66 | <target name="init" depends="clean"> |
| 67 | <mkdir dir="classes" /> |
| 68 | <mkdir dir="${unpreverified.classes}" /> |
| 69 | <mkdir dir="${obfuscated.classes}" /> |
| 70 | <mkdir dir="${final.classes}" /> |
| 71 | <mkdir dir="output" /> |
| 72 | <mkdir dir="output/tojar" /> |
| 73 | <mkdir dir="output/tocod" /> |
| 74 | </target> |
| 75 | |
| 76 | <target name="clean"> |
| 77 | <delete file="${name}.jad" /> |
| 78 | <delete file="${name}.jar" /> |
| 79 | <delete file="${appname}.cod" /> |
| 80 | <delete file="${codename}.jdw" /> |
| 81 | <delete file="${appname}.lst" /> |
| 82 | <delete file="${appname}.csl" /> |
| 83 | <delete file="${appname}.cso" /> |
| 84 | <delete file="${appname}.rapc" /> |
| 85 | <delete> |
| 86 | <fileset dir="." includes="*.debug" /> |
| 87 | </delete> |
| 88 | <delete dir="classes" /> |
| 89 | <delete dir="output" /> |
| 90 | <delete dir="bin" /> |
| 91 | </target> |
| 92 | |
| 93 | <target name="javacompile4.1" depends="init"> |
| 94 | <wtkbuild srcdir="${src}:${src4.1}" destdir="${unpreverified.classes}" excludes="**/4.2/**" bootclasspath="${net_rim_api.jar}"/> |
| 95 | <!-- Preverify the compiled code --> |
| 96 | <wtkpreverify srcdir="${unpreverified.classes}" destdir="${final.classes}" classpath="${net_rim_api.jar}" /> |
| 97 | <!-- Version the MANIFEST --> |
| 98 | <filter token="buildVer" value="${ver}" /> |
| 99 | <filter token="midletName" value="${name}" /> |
| 100 | <copy file="${manifest.template}" tofile="${manifestfile}" filtering="true" overwrite="true" /> |
| 101 | |
| 102 | <!-- Version the JAD file --> |
| 103 | <filter token="buildVer" value="${ver}" /> |
| 104 | <filter token="midletName" value="${name}" /> |
| 105 | <filter token="jarName" value="${name}.jar" /> |
| 106 | <copy file="${jad.template}" tofile="${jadfile}" filtering="true" overwrite="true" /> |
| 107 | <!-- Package (JAR) the compiled classes. This also modifies the JAD file with JAR size information --> |
| 108 | <delete dir="${final.classes}/META-INF" /> |
| 109 | <wtkpackage jarfile="${final.jar}" jadfile="${jadfile}"> |
| 110 | <fileset dir="${final.classes}" /> |
| 111 | <fileset dir="${resources}" /> |
| 112 | <fileset file="${ksoap}" /> |
| 113 | </wtkpackage> |
| 114 | </target> |
| 115 | |
| 116 | <target name="javacompile4.2" depends="init"> |
| 117 | <wtkbuild srcdir="${src}:${src4.2}" destdir="${unpreverified.classes}" excludes="**/4.1/**" bootclasspath="${net_rim_api.jar}"/> |
| 118 | <!-- Preverify the compiled code --> |
| 119 | <wtkpreverify srcdir="${unpreverified.classes}" destdir="${final.classes}" classpath="${net_rim_api.jar}" /> |
| 120 | <!-- Version the MANIFEST --> |
| 121 | <filter token="buildVer" value="${ver}" /> |
| 122 | <filter token="midletName" value="${name}" /> |
| 123 | <copy file="${manifest.template}" tofile="${manifestfile}" filtering="true" overwrite="true" /> |
| 124 | |
| 125 | <!-- Version the JAD file --> |
| 126 | <filter token="buildVer" value="${ver}" /> |
| 127 | <filter token="midletName" value="${name}" /> |
| 128 | <filter token="jarName" value="${name}.jar" /> |
| 129 | <copy file="${jad.template}" tofile="${jadfile}" filtering="true" overwrite="true" /> |
| 130 | <!-- Package (JAR) the compiled classes. This also modifies the JAD file with JAR size information --> |
| 131 | <delete dir="${final.classes}/META-INF" /> |
| 132 | <wtkpackage jarfile="${final.jar}" jadfile="${jadfile}"> |
| 133 | <fileset dir="${final.classes}" /> |
| 134 | <fileset dir="${resources}" /> |
| 135 | <fileset file="${ksoap}" /> |
| 136 | </wtkpackage> |
| 137 | </target> |
| 138 | |
| 139 | <!-- Invoke the RAPC compiler. This step is based the RAPC's usage: rapc.exe import=RIM_APIs codename=Codename JAD-File JAR-File --> |
| 140 | <target name="rapc4.1" description="RIM COD Compiler" depends="javacompile4.1"> |
| 141 | <rapc jdehome="${jdehome}"> |
| 142 | <workspace src="DotTel-BB.jdw" build="true" update="true"> |
| 143 | <cldc src="cldc_project.jdp" title="${appname}" vendor="Telnic" version="2.1" |
| 144 | description="DotTel Application For BlackBerry OS" arguments="" systemmodule="false" |
| 145 | runonstartup="true" startuptier="7" output="${appname}" options="-quiet" |
| 146 | update="true" build="true"> |
| 147 | <files dir="."> |
| 148 | <include name="src/**/*.*" /> |
| 149 | <exclude name="src/**/TelnameAppResource.java" /> |
| 150 | <include name="src4.1/**/*.*" /> |
| 151 | </files> |
| 152 | <icons dir="."> |
| 153 | <include name="src/resources/tel32.png" /> |
| 154 | </icons> |
| 155 | </cldc> |
| 156 | |
| 157 | </workspace> |
| 158 | </rapc> |
| 159 | </target> |
| 160 | |
| 161 | <!-- Invoke the RAPC compiler. This step is based the RAPC's usage: rapc.exe import=RIM_APIs codename=Codename JAD-File JAR-File --> |
| 162 | <target name="rapc4.2" description="RIM COD Compiler" depends="javacompile4.2"> |
| 163 | <rapc jdehome="${jdehome}"> |
| 164 | <workspace src="DotTel-BB.jdw" build="true" update="true"> |
| 165 | <cldc src="cldc_project.jdp" title="${appname}" vendor="Telnic" version="2.1" |
| 166 | description="DotTel Application For BlackBerry OS" arguments="" systemmodule="false" |
| 167 | runonstartup="true" startuptier="7" output="${appname}" options="-quiet" |
| 168 | update="true" build="true"> |
| 169 | <files dir="."> |
| 170 | <include name="src/**/*.*" /> |
| 171 | <exclude name="src/**/TelnameAppResource.java" /> |
| 172 | <include name="src4.2/**/*.*" /> |
| 173 | </files> |
| 174 | <icons dir="."> |
| 175 | <include name="src/resources/tel32.png" /> |
| 176 | </icons> |
| 177 | </cldc> |
| 178 | |
| 179 | </workspace> |
| 180 | </rapc> |
| 181 | </target> |
| 182 | |
| 183 | <!-- Once the COD file has been generated, move generated file to output directory --> |
| 184 | <target name="build"> |
| 185 | <copy file="${appname}.cod" tofile="output/tocod/${appname}.cod" /> |
| 186 | <move file="${appname}.debug" tofile="output/tocod/${appname}.debug"/> |
| 187 | <move file="${appname}.cso" tofile="output/tocod/${appname}.cso"/> |
| 188 | <copy file="${codename}.alx" tofile="output/tocod/${codename}.alx" /> |
| 189 | <exec executable="C:\Python25\python.exe" dir="."> |
| 190 | <arg value="modifyalx.py" /> |
| 191 | <arg value="${ver}" /> |
| 192 | </exec> |
| 193 | </target> |
| 194 | |
| 195 | <!-- Sign the COD --> |
| 196 | <target name="sign" depends="build"> |
| 197 | |
| 198 | <java jar="${bb.buildjars.home}/SignatureTool.jar" fork="true" dir="output/tocod/" failonerror="true"> |
| 199 | <arg line=" -a -c -C *.cod" /> |
| 200 | </java> |
| 201 | </target> |
| 202 | |
| 203 | <!-- Load to device --> |
| 204 | <target name="load" depends="sign"> |
| 205 | |
| 206 | <exec executable="${bb.buildjars.home}/JavaLoader.exe" dir="." failonerror="true"> |
| 207 | <arg value="-u" /> |
| 208 | <arg value="load" /> |
| 209 | <arg value="output/tocod/${appname}.cod" /> |
| 210 | </exec> |
| 211 | </target> |
| 212 | |
| 213 | <!-- Load to device --> |
| 214 | <target name="OTA" depends="sign"> |
| 215 | <unzip src="output/tocod/${appname}.cod" dest="output/ota/" /> |
| 216 | |
| 217 | <move file="output/tocod/${appname}.cod" tofile="output/tocod/${codename}.cod"/> |
| 218 | <delete file="output/tocod/${appname}.cso"/> |
| 219 | <delete file="output/tocod/${appname}.debug"/> |
| 220 | <delete file="output/tocod/LogFile.txt"/> |
| 221 | |
| 222 | <copy file="${jadfile}" tofile="output/ota/${appname}.jad" /> |
| 223 | <exec executable="C:\Python25\python.exe" dir="."> |
| 224 | <arg value="gen-ota-jad.py" /> |
| 225 | </exec> |
| 226 | </target> |
| 227 | |
| 228 | |
| 229 | <!-- =================================================================== --> |
| 230 | <target name="checkstyle" description="=== Checks the Java Sources against the Coding Standard ==="> |
| 231 | |
| 232 | <antcall target="checkstyle.core"> |
| 233 | <param name="checkstyle.must.pass" value="false" /> |
| 234 | </antcall> |
| 235 | |
| 236 | <exec os="Windows XP,Windows 2000" executable="rundll32"> |
| 237 | <arg value="url.dll,FileProtocolHandler" /> |
| 238 | <arg value="checkstyle-report.html" /> |
| 239 | </exec> |
| 240 | |
| 241 | </target> |
| 242 | |
| 243 | <property name="checkstyle.must.pass" value="true" /> |
| 244 | <property name="checkstyle.chosen.package" value="telnic" /> |
| 245 | <!-- on the command line, you can supply (for example) |
| 246 | -Dcheckstyle.chosen.package=diagram |
| 247 | to select just the com.cwcom.oss.tnssr.client.diagram package --> |
| 248 | |
| 249 | <!-- =================================================================== --> |
| 250 | <target name="checkstyle.core" depends="javacompile4.2"> |
| 251 | <!-- see http://checkstyle.sourceforge.net/anttask.html --> |
| 252 | <taskdef resource="checkstyletask.properties" classpath="${tool.dir}lib/common/checkstyle-all-4.1.jar" /> |
| 253 | |
| 254 | <echo message="${app.name}: Checking **/${checkstyle.chosen.package}/**/*.java..." /> |
| 255 | <delete file="checkstyle-report.xml" quiet="true" /> |
| 256 | <delete file="checkstyle-report.html" quiet="true" /> |
| 257 | |
| 258 | <checkstyle config="${tool.dir}checkstyle/checkstyle4-settings.conf" failOnViolation="${checkstyle.must.pass}"> |
| 259 | <fileset dir="."> |
| 260 | <include name="**/${checkstyle.chosen.package}/**/*.java" /> |
| 261 | <exclude name="test/**/*.java" /> |
| 262 | </fileset> |
| 263 | <formatter type="xml" tofile="checkstyle-report.xml" /> |
| 264 | <classpath> |
| 265 | <path refid="class.path" /> |
| 266 | <pathelement path="${classes}" /> |
| 267 | </classpath> |
| 268 | </checkstyle> |
| 269 | |
| 270 | <style in="checkstyle-report.xml" out="checkstyle-report.html" style="${tool.dir}checkstyle/checkstyle-noframes-sorted.xsl" /> |
| 271 | </target> |
| 272 | </project> |
Note: See TracBrowser
for help on using the browser.








