forked from rapidftr/RapidFTR---BlackBerry-Edition
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
187 lines (158 loc) · 6.83 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<project name="RapidFTR---BlackBerry-Edition" default="test">
<property environment="env"/>
<property file="${env.BUILD_PROPERTIES_OVERRIDE}"/>
<property file="build.properties"/>
<mkdir dir="${out.instr.dir}" />
<property name="emma.dir" value="RapidFTR-Blackberry-Tests/lib" />
<path id="emma.lib" >
<pathelement location="${emma.dir}/emma.jar" />
<pathelement location="${emma.dir}/emma_ant.jar" />
</path>
<taskdef resource="emma_ant.properties" classpathref="emma.lib" />
<taskdef resource="bb-ant-defs.xml" classpath="${bb-ant-tools-jar}"/>
<condition property="isMac">
<os family="mac"/>
</condition>
<condition property="isWindows">
<os family="windows"/>
</condition>
<condition property="isUnixButNotMacOsX">
<and>
<os family="unix"/>
<not>
<os family="mac"/>
</not>
</and>
</condition>
<condition property="verify.path" value="${jde.home}/bin-win">
<isset property="isWindows"/>
</condition>
<condition property="verify.path" value="${jde.home}/bin-OSX">
<isset property="isMac"/>
</condition>
<condition property="verify.path" value="${jde.home}/bin-linux">
<isset property="isUnixButNotMacOsX"/>
</condition>
<path id="build.classpath">
<fileset dir="RapidFTR-Blackberry-Tests\\lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${output.dir}">
<include name="*.jar"/>
</fileset>
</path>
<path id="test.classpath">
<path refid="build.classpath"/>
<fileset dir="RapidFTR-Blackberry-Tests/lib" includes="**/*.jar"/>
<pathelement path="${tests.build.dir}"/>
</path>
<target name="clean">
<delete failonerror="false">
<fileset dir="${output.dir}" includes="**/*"/>
<fileset dir="${report.dir}" includes="**/*"/>
<fileset dir="${tests.build.dir}" includes="**/*"/>
<fileset dir="${release.dir}" includes="**/*"/>
<fileset dir="${out.instr.dir}" includes="**/*"/>
<fileset dir="${coverage.dir}" includes="**/*"/>
</delete>
</target>
<target name="init" depends="clean">
<mkdir dir="${output.dir}"/>
<mkdir dir="${output.dir}/temp"/>
<mkdir dir="${release.dir}"/>
<mkdir dir="${tests.build.dir}"/>
<mkdir dir="${report.dir}"/>
</target>
<target name="compile" depends="init">
<rapc srcdir="${src.dir}" output="${output.file}" destdir="${output.dir}/temp" exepath="${verify.path}">
<jdp title="${app.title}" vendor="${app.vendor}" version="${app.version}" type="cldc" icon="../RapidFTR-Blackberry/src/res/cf68.png" ribbonposition="99"/>
</rapc>
<jar destfile="${output.dir}/temp/${output.file}.jar" update="true">
<fileset dir="${src.dir}">
<exclude name="**/Thumbs.db"/>
<exclude name="**/*.java"/>
</fileset>
</jar>
<copy file="${output.dir}/temp/${output.file}.jar" todir="${output.dir}"/>
<delete failonerror="true">
<fileset dir="${output.dir}/temp"/>
</delete>
<rapc srcdir="${output.dir}" output="${output.file}" destdir="${output.dir}" exepath="${verify.path}">
<jdp title="${app.title}" vendor="${app.vendor}" version="${app.version}" type="cldc" icon="../RapidFTR-Blackberry/src/res/cf68.png" ribbonposition="99"/>
</rapc>
</target>
<target name="sign" depends="test">
<echo message="${output.dir}"/>
<java jar="${signatureTool-jar}" fork="true" dir="${output.dir}" failonerror="true">
<arg line=" -a -p ${signing.code} -c -C RapidFTR.cod"/>
</java>
</target>
<target name="release" depends="sign">
<alx destdir="${release.dir}" filename="${output.file}.alx">
<application id="${app.id}" name="${app.title}" vendor="${app.vendor}" version="${app.version}">
<codset greaterthanequal="4.6.1">
<fileset dir="${output.dir}" includes="*.cod"/>
</codset>
</application>
</alx>
<jadtool input="${output.dir}/${output.file}.jad" destdir="${release.dir}">
<fileset dir="build" includes="*.cod"/>
</jadtool>
<echo file="${release.dir}/version.txt" message="${app.version}"/>
</target>
<!-- Load to device -->
<target name="load" depends="sign">
<exec executable="${jde.home}/bin/JavaLoader.exe" dir="." failonerror="true">
<arg value="-u"/>
<arg value="load"/>
<arg value="output/tocod/${output.file}.cod"/>
</exec>
</target>
<target name="compile-tests" depends="compile">
<javac srcdir="${tests.src.dir}" destdir="${tests.build.dir}" classpathref="test.classpath"/>
</target>
<target name="instrument">
<path id="srcjar">
<pathelement location="${output.dir}/${output.file}.jar"/>
</path>
<emma enabled="${emma.enabled}" >
<instr instrpathref="srcjar"
destdir="${out.instr.dir}"
metadatafile="${coverage.dir}/metadata.emma"
merge="true"
/>
</emma>
</target>
<target name="test" depends="compile-tests, instrument">
<junit printsummary="yes" haltonfailure="no" failureproperty="unit.tests.failed"
fork="yes" forkmode="once">
<classpath>
<pathelement location="${out.instr.dir}" />
<path refid="test.classpath"/>
<path refid="emma.lib" />
</classpath>
<formatter type="xml"/>
<batchtest todir="${report.dir}">
<fileset dir="${tests.src.dir}">
<include name="**/*Test*"/>
</fileset>
</batchtest>
<jvmarg value="-Demma.coverage.out.file=${coverage.dir}/coverage.emma" />
<jvmarg value="-Demma.coverage.out.merge=true" />
</junit>
<junitreport todir="${report.dir}">
<fileset dir="${report.dir}" includes="TEST-*.xml"/>
<report todir="${report.dir}"/>
</junitreport>
<emma enabled="${emma.enabled}" >
<report sourcepath="${src.dir}" >
<fileset dir="${coverage.dir}" >
<include name="*.emma" />
</fileset>
<txt outfile="${coverage.dir}/coverage.txt" />
<html outfile="${coverage.dir}/coverage.html" />
</report>
</emma>
<fail if="unit.tests.failed" message="Unit tests failed"/>
</target>
</project>