| 1 | <?xml version="1.0" encoding="UTF-8"?> |
|---|
| 2 | <!-- |
|---|
| 3 | Ant build file for the LogicMail tests |
|---|
| 4 | --> |
|---|
| 5 | <project name="LogicMailTests" default="build" basedir="."> |
|---|
| 6 | <!-- Properties --> |
|---|
| 7 | <property name="tests.dir" location="." /> |
|---|
| 8 | <property name="dist.dir" location="dist" /> |
|---|
| 9 | <property name="logicmail.dir" location="../LogicMail" /> |
|---|
| 10 | <property name="j2meunit.dir" location="../J2MEUnit" /> |
|---|
| 11 | <property file="../LogicMail/project.properties" /> |
|---|
| 12 | |
|---|
| 13 | <!-- Task definitions --> |
|---|
| 14 | <typedef resource="bb-ant-defs.xml" classpath="../lib/bb-ant-tools.jar" /> |
|---|
| 15 | <taskdef name="hammockmaker" |
|---|
| 16 | classname="com.hammingweight.hammockmaker.HammockMaker" |
|---|
| 17 | classpath="../lib/hammockmaker-2.1.0.jar" /> |
|---|
| 18 | |
|---|
| 19 | <!-- Generate mocks --> |
|---|
| 20 | <target name="mocks"> |
|---|
| 21 | <mkdir dir="${dist.dir}/prebuild"/> |
|---|
| 22 | <rapc output="${module.name}Prebuild" |
|---|
| 23 | destdir="${dist.dir}/prebuild" |
|---|
| 24 | jdehome="${jde450.home}" |
|---|
| 25 | defines="BLACKBERRY_4_5_0"> |
|---|
| 26 | <src> |
|---|
| 27 | <fileset dir="${logicmail.dir}"> |
|---|
| 28 | <include name="src/**/*.java" /> |
|---|
| 29 | <include name="res/**/*.rrc" /> |
|---|
| 30 | <include name="res/**/*.rrh" /> |
|---|
| 31 | </fileset> |
|---|
| 32 | </src> |
|---|
| 33 | </rapc> |
|---|
| 34 | <property name="prebuild.jar" value="${dist.dir}/prebuild/${module.name}Prebuild.jar" /> |
|---|
| 35 | <property name="mocks.classpath" value="${prebuild.jar};${jde450.home}/lib/net_rim_api.jar" /> |
|---|
| 36 | <hammockmaker usecldc11="true" dir="${tests.dir}/src" package="org.logicprobe.LogicMail.util" classpath="${mocks.classpath}"> |
|---|
| 37 | <mock class="org.logicprobe.LogicMail.util.Connection" /> |
|---|
| 38 | </hammockmaker> |
|---|
| 39 | <hammockmaker usecldc11="true" dir="${tests.dir}/src" package="org.logicprobe.LogicMail.mail" classpath="${mocks.classpath}"> |
|---|
| 40 | <mock class="org.logicprobe.LogicMail.mail.IncomingMailClient" /> |
|---|
| 41 | <mock class="org.logicprobe.LogicMail.mail.IncomingMailClientListener" /> |
|---|
| 42 | <mock class="org.logicprobe.LogicMail.mail.AbstractMailStore" /> |
|---|
| 43 | </hammockmaker> |
|---|
| 44 | <hammockmaker usecldc11="true" dir="${tests.dir}/src" package="org.logicprobe.LogicMail.mail.imap" classpath="${mocks.classpath}"> |
|---|
| 45 | <mock class="org.logicprobe.LogicMail.mail.imap.ImapProtocol" /> |
|---|
| 46 | </hammockmaker> |
|---|
| 47 | <delete dir="${dist.dir}/prebuild"/> |
|---|
| 48 | </target> |
|---|
| 49 | |
|---|
| 50 | <!-- Build the application tests --> |
|---|
| 51 | <target name="build"> |
|---|
| 52 | <mkdir dir="${dist.dir}"/> |
|---|
| 53 | <copy file="res/icons/logicmail-tests.png" todir="${dist.dir}"/> |
|---|
| 54 | <!-- Build the tests --> |
|---|
| 55 | <rapc output="${module.name}Tests" |
|---|
| 56 | destdir="${dist.dir}" |
|---|
| 57 | jdehome="${jde450.home}" |
|---|
| 58 | defines="BLACKBERRY_4_5_0" |
|---|
| 59 | generatesourcelist="true"> |
|---|
| 60 | <jdp title="${module.title}Tests" |
|---|
| 61 | vendor="${module.vendor}" |
|---|
| 62 | version="${module.version}.${module.build}" |
|---|
| 63 | type="cldc" |
|---|
| 64 | midletclass="org.logicprobe.LogicMail.LogicMailTests" |
|---|
| 65 | icon="logicmail-tests.png" /> |
|---|
| 66 | <src> |
|---|
| 67 | <fileset dir="${j2meunit.dir}"> |
|---|
| 68 | <include name="src/**/*.java" /> |
|---|
| 69 | <include name="res/**/*.png" /> |
|---|
| 70 | </fileset> |
|---|
| 71 | <fileset dir="${tests.dir}"> |
|---|
| 72 | <include name="src/**/*.java" /> |
|---|
| 73 | <include name="res/**/*.png" /> |
|---|
| 74 | </fileset> |
|---|
| 75 | <fileset dir="${logicmail.dir}"> |
|---|
| 76 | <include name="src/**/*.java" /> |
|---|
| 77 | <include name="res/**/*.png" /> |
|---|
| 78 | <include name="res/**/*.rrc" /> |
|---|
| 79 | <include name="res/**/*.rrh" /> |
|---|
| 80 | </fileset> |
|---|
| 81 | </src> |
|---|
| 82 | </rapc> |
|---|
| 83 | <delete file="${dist.dir}/logicmail-tests.png"/> |
|---|
| 84 | </target> |
|---|
| 85 | |
|---|
| 86 | <!-- Load the build output into the simulator --> |
|---|
| 87 | <target name="load-simulator" depends="build"> |
|---|
| 88 | <copy todir="${simulator.home}"> |
|---|
| 89 | <fileset dir="${dist.dir}" includes="*.cod,*.csl,*.cso,*.debug,*.jar"/> |
|---|
| 90 | </copy> |
|---|
| 91 | </target> |
|---|
| 92 | |
|---|
| 93 | <!-- Run the application tests in the simulator --> |
|---|
| 94 | <target name="run-simulator" depends="load-simulator"> |
|---|
| 95 | <exec |
|---|
| 96 | dir="${simulator.home}" |
|---|
| 97 | executable="${simulator.home}/${simulator.exec}" |
|---|
| 98 | spawn="true"/> |
|---|
| 99 | </target> |
|---|
| 100 | |
|---|
| 101 | <target name="clean"> |
|---|
| 102 | <delete dir="${dist.dir}"/> |
|---|
| 103 | </target> |
|---|
| 104 | </project> |
|---|