author | Da Risk <darisk972@gmail.com> |
Thu, 02 Apr 2009 19:00:23 +0200 | |
changeset 54 | dfbb0fbece57 |
parent 7 | c2941cee7327 |
child 105 | c6e4728ac9f7 |
permissions | -rw-r--r-- |
0 | 1 |
<?xml version="1.0" ?> |
2 |
<project name="Beem" default="debug"> |
|
3 |
||
4 |
<!-- The build.properties file can be created by you and is never touched |
|
5 |
by activitycreator. If you want to manually set properties, this is |
|
6 |
the best place to set them. --> |
|
7 |
<property file="build.properties"/> |
|
8 |
||
9 |
<!-- The default.properties file is created and updated by activitycreator. |
|
10 |
It will set any properties not already defined by build.properties. --> |
|
11 |
<property file="default.properties"/> |
|
12 |
||
13 |
<!-- ************************************************************************************* --> |
|
14 |
<!-- These settings were written by activitycreator. |
|
15 |
Do not change them unless you really know what you are doing. --> |
|
16 |
||
17 |
<!-- Application Package Name --> |
|
18 |
<property name="application-package" value="com.beem.project.beem" /> |
|
19 |
||
20 |
<!-- The intermediates directory, Eclipse uses "bin" |
|
21 |
for its own output, so we do the same. --> |
|
22 |
<property name="outdir" value="bin" /> |
|
23 |
||
24 |
<!-- ************************************************************************************* --> |
|
25 |
<!-- No user servicable parts below. --> |
|
26 |
||
27 |
<property name="android-tools" value="${sdk-folder}/tools" /> |
|
28 |
<property name="android-framework" value="${android-tools}/lib/framework.aidl" /> |
|
29 |
||
30 |
<!-- Input directories --> |
|
31 |
<property name="resource-dir" value="res" /> |
|
32 |
<property name="asset-dir" value="assets" /> |
|
33 |
<property name="srcdir" value="src" /> |
|
34 |
<condition property="srcdir-ospath" |
|
35 |
value="${basedir}\${srcdir}" |
|
36 |
else="${basedir}/${srcdir}" > |
|
37 |
<os family="windows"/> |
|
38 |
</condition> |
|
39 |
||
40 |
<!-- folder for the 3rd party java libraries --> |
|
41 |
<property name="external-libs" value="libs" /> |
|
42 |
<condition property="external-libs-ospath" |
|
43 |
value="${basedir}\${external-libs}" |
|
44 |
else="${basedir}/${external-libs}" > |
|
45 |
<os family="windows"/> |
|
46 |
</condition> |
|
47 |
||
48 |
<!-- folder for the native libraries --> |
|
49 |
<property name="native-libs" value="libs" /> |
|
50 |
<condition property="native-libs-ospath" |
|
51 |
value="${basedir}\${native-libs}" |
|
52 |
else="${basedir}/${native-libs}" > |
|
53 |
<os family="windows"/> |
|
54 |
</condition> |
|
55 |
||
56 |
<!-- Output directories --> |
|
57 |
<property name="outdir-classes" value="${outdir}/classes" /> |
|
58 |
<condition property="outdir-classes-ospath" |
|
59 |
value="${basedir}\${outdir-classes}" |
|
60 |
else="${basedir}/${outdir-classes}" > |
|
61 |
<os family="windows"/> |
|
62 |
</condition> |
|
63 |
||
64 |
<!-- Create R.java in the source directory --> |
|
65 |
<property name="outdir-r" value="src" /> |
|
66 |
||
67 |
<!-- Intermediate files --> |
|
68 |
<property name="dex-file" value="classes.dex" /> |
|
69 |
<property name="intermediate-dex" value="${outdir}/${dex-file}" /> |
|
70 |
<condition property="intermediate-dex-ospath" |
|
71 |
value="${basedir}\${intermediate-dex}" |
|
72 |
else="${basedir}/${intermediate-dex}" > |
|
73 |
<os family="windows"/> |
|
74 |
</condition> |
|
75 |
||
76 |
<!-- The final package file to generate --> |
|
77 |
<property name="resources-package" value="${outdir}/${ant.project.name}.ap_" /> |
|
78 |
<condition property="resources-package-ospath" |
|
79 |
value="${basedir}\${resources-package}" |
|
80 |
else="${basedir}/${resources-package}" > |
|
81 |
<os family="windows"/> |
|
82 |
</condition> |
|
83 |
||
84 |
<property name="out-debug-package" value="${outdir}/${ant.project.name}-debug.apk" /> |
|
85 |
<condition property="out-debug-package-ospath" |
|
86 |
value="${basedir}\${out-debug-package}" |
|
87 |
else="${basedir}/${out-debug-package}" > |
|
88 |
<os family="windows"/> |
|
89 |
</condition> |
|
90 |
||
91 |
<property name="out-unsigned-package" value="${outdir}/${ant.project.name}-unsigned.apk" /> |
|
92 |
<condition property="out-unsigned-package-ospath" |
|
93 |
value="${basedir}\${out-unsigned-package}" |
|
94 |
else="${basedir}/${out-unsigned-package}" > |
|
95 |
<os family="windows"/> |
|
96 |
</condition> |
|
97 |
||
98 |
<!-- Tools --> |
|
99 |
<condition property="aapt" value="${android-tools}/aapt.exe" else="${android-tools}/aapt" > |
|
100 |
<os family="windows"/> |
|
101 |
</condition> |
|
102 |
<condition property="aidl" value="${android-tools}/aidl.exe" else="${android-tools}/aidl" > |
|
103 |
<os family="windows"/> |
|
104 |
</condition> |
|
105 |
<condition property="adb" value="${android-tools}/adb.exe" else="${android-tools}/adb" > |
|
106 |
<os family="windows"/> |
|
107 |
</condition> |
|
108 |
<condition property="dx" value="${android-tools}/dx.bat" else="${android-tools}/dx" > |
|
109 |
<os family="windows"/> |
|
110 |
</condition> |
|
111 |
<condition property="apk-builder" value="${android-tools}/apkbuilder.bat" else="${android-tools}/apkbuilder" > |
|
112 |
<os family="windows"/> |
|
113 |
</condition> |
|
114 |
||
115 |
<property name="android-jar" value="${sdk-folder}/android.jar" /> |
|
116 |
||
54
dfbb0fbece57
Add a rule for building the javadoc
Da Risk <darisk972@gmail.com>
parents:
7
diff
changeset
|
117 |
<property name="javadoc-output" value="doc/javadoc" /> |
dfbb0fbece57
Add a rule for building the javadoc
Da Risk <darisk972@gmail.com>
parents:
7
diff
changeset
|
118 |
|
0 | 119 |
<!-- Rules --> |
120 |
||
121 |
<!-- Create the output directories if they don't exist yet. --> |
|
122 |
<target name="dirs"> |
|
123 |
<echo>Creating output directories if needed...</echo> |
|
124 |
<mkdir dir="${outdir}" /> |
|
125 |
<mkdir dir="${outdir-classes}" /> |
|
54
dfbb0fbece57
Add a rule for building the javadoc
Da Risk <darisk972@gmail.com>
parents:
7
diff
changeset
|
126 |
<mkdir dir="${javadoc-output}" /> |
0 | 127 |
</target> |
128 |
||
129 |
<!-- Generate the R.java file for this project's resources. --> |
|
130 |
<target name="resource-src" depends="dirs"> |
|
131 |
<echo>Generating R.java / Manifest.java from the resources...</echo> |
|
132 |
<exec executable="${aapt}" failonerror="true"> |
|
133 |
<arg value="package" /> |
|
134 |
<arg value="-m" /> |
|
135 |
<arg value="-J" /> |
|
136 |
<arg value="${outdir-r}" /> |
|
137 |
<arg value="-M" /> |
|
138 |
<arg value="AndroidManifest.xml" /> |
|
139 |
<arg value="-S" /> |
|
140 |
<arg value="${resource-dir}" /> |
|
141 |
<arg value="-I" /> |
|
142 |
<arg value="${android-jar}" /> |
|
143 |
</exec> |
|
144 |
</target> |
|
145 |
||
146 |
<!-- Generate java classes from .aidl files. --> |
|
147 |
<target name="aidl" depends="dirs"> |
|
148 |
<echo>Compiling aidl files into Java classes...</echo> |
|
149 |
<apply executable="${aidl}" failonerror="true"> |
|
150 |
<arg value="-p${android-framework}" /> |
|
54
dfbb0fbece57
Add a rule for building the javadoc
Da Risk <darisk972@gmail.com>
parents:
7
diff
changeset
|
151 |
<arg value="-p${basedir}/project.aidl"/> |
0 | 152 |
<arg value="-I${srcdir}" /> |
153 |
<fileset dir="${srcdir}"> |
|
154 |
<include name="**/*.aidl"/> |
|
155 |
</fileset> |
|
156 |
</apply> |
|
54
dfbb0fbece57
Add a rule for building the javadoc
Da Risk <darisk972@gmail.com>
parents:
7
diff
changeset
|
157 |
|
0 | 158 |
</target> |
159 |
||
160 |
<!-- Compile this project's .java files into .class files. --> |
|
161 |
<target name="compile" depends="dirs, resource-src, aidl"> |
|
162 |
<javac encoding="ascii" target="1.5" debug="true" extdirs="" |
|
163 |
srcdir="." |
|
164 |
destdir="${outdir-classes}" |
|
165 |
bootclasspath="${android-jar}"> |
|
166 |
<classpath> |
|
167 |
<fileset dir="${external-libs}" includes="*.jar"/> |
|
168 |
</classpath> |
|
169 |
</javac> |
|
170 |
</target> |
|
171 |
||
172 |
<!-- Convert this project's .class files into .dex files. --> |
|
173 |
<target name="dex" depends="compile"> |
|
174 |
<echo>Converting compiled files and external libraries into ${outdir}/${dex-file}...</echo> |
|
175 |
<apply executable="${dx}" failonerror="true" parallel="true"> |
|
176 |
<arg value="--dex" /> |
|
177 |
<arg value="--output=${intermediate-dex-ospath}" /> |
|
178 |
<arg path="${outdir-classes-ospath}" /> |
|
179 |
<fileset dir="${external-libs}" includes="*.jar"/> |
|
180 |
</apply> |
|
181 |
</target> |
|
182 |
||
183 |
<!-- Put the project's resources into the output package file. --> |
|
184 |
<target name="package-res-and-assets"> |
|
185 |
<echo>Packaging resources and assets...</echo> |
|
186 |
<exec executable="${aapt}" failonerror="true"> |
|
187 |
<arg value="package" /> |
|
188 |
<arg value="-f" /> |
|
189 |
<arg value="-M" /> |
|
190 |
<arg value="AndroidManifest.xml" /> |
|
191 |
<arg value="-S" /> |
|
192 |
<arg value="${resource-dir}" /> |
|
193 |
<arg value="-A" /> |
|
194 |
<arg value="${asset-dir}" /> |
|
195 |
<arg value="-I" /> |
|
196 |
<arg value="${android-jar}" /> |
|
197 |
<arg value="-F" /> |
|
198 |
<arg value="${resources-package}" /> |
|
199 |
</exec> |
|
200 |
</target> |
|
201 |
||
202 |
<!-- Same as package-res-and-assets, but without "-A ${asset-dir}" --> |
|
203 |
<target name="package-res-no-assets"> |
|
204 |
<echo>Packaging resources...</echo> |
|
205 |
<exec executable="${aapt}" failonerror="true"> |
|
206 |
<arg value="package" /> |
|
207 |
<arg value="-f" /> |
|
208 |
<arg value="-M" /> |
|
209 |
<arg value="AndroidManifest.xml" /> |
|
210 |
<arg value="-S" /> |
|
211 |
<arg value="${resource-dir}" /> |
|
212 |
<!-- No assets directory --> |
|
213 |
<arg value="-I" /> |
|
214 |
<arg value="${android-jar}" /> |
|
215 |
<arg value="-F" /> |
|
216 |
<arg value="${resources-package}" /> |
|
217 |
</exec> |
|
218 |
</target> |
|
219 |
||
220 |
<!-- Invoke the proper target depending on whether or not |
|
221 |
an assets directory is present. --> |
|
222 |
<!-- TODO: find a nicer way to include the "-A ${asset-dir}" argument |
|
223 |
only when the assets dir exists. --> |
|
224 |
<target name="package-res"> |
|
225 |
<available file="${asset-dir}" type="dir" |
|
226 |
property="res-target" value="and-assets" /> |
|
227 |
<property name="res-target" value="no-assets" /> |
|
228 |
<antcall target="package-res-${res-target}" /> |
|
229 |
</target> |
|
230 |
||
231 |
<!-- Package the application and sign it with a debug key. |
|
232 |
This is the default target when building. It is used for debug. --> |
|
233 |
<target name="debug" depends="dex, package-res"> |
|
234 |
<echo>Packaging ${out-debug-package}, and signing it with a debug key...</echo> |
|
235 |
<exec executable="${apk-builder}" failonerror="true"> |
|
236 |
<arg value="${out-debug-package-ospath}" /> |
|
237 |
<arg value="-z" /> |
|
238 |
<arg value="${resources-package-ospath}" /> |
|
239 |
<arg value="-f" /> |
|
240 |
<arg value="${intermediate-dex-ospath}" /> |
|
241 |
<arg value="-rf" /> |
|
242 |
<arg value="${srcdir-ospath}" /> |
|
243 |
<arg value="-rj" /> |
|
244 |
<arg value="${external-libs-ospath}" /> |
|
245 |
<arg value="-nf" /> |
|
246 |
<arg value="${native-libs-ospath}" /> |
|
247 |
</exec> |
|
248 |
</target> |
|
249 |
||
250 |
<!-- Package the application without signing it. |
|
251 |
This allows for the application to be signed later with an official publishing key. --> |
|
54
dfbb0fbece57
Add a rule for building the javadoc
Da Risk <darisk972@gmail.com>
parents:
7
diff
changeset
|
252 |
<target name="release" depends="dex, package-res" |
dfbb0fbece57
Add a rule for building the javadoc
Da Risk <darisk972@gmail.com>
parents:
7
diff
changeset
|
253 |
description="Package the application without signing it. |
dfbb0fbece57
Add a rule for building the javadoc
Da Risk <darisk972@gmail.com>
parents:
7
diff
changeset
|
254 |
This allows for the application to be signed later with an official publishing key."> |
0 | 255 |
<echo>Packaging ${out-unsigned-package} for release...</echo> |
256 |
<exec executable="${apk-builder}" failonerror="true"> |
|
257 |
<arg value="${out-unsigned-package-ospath}" /> |
|
258 |
<arg value="-u" /> |
|
259 |
<arg value="-z" /> |
|
260 |
<arg value="${resources-package-ospath}" /> |
|
261 |
<arg value="-f" /> |
|
262 |
<arg value="${intermediate-dex-ospath}" /> |
|
263 |
<arg value="-rf" /> |
|
264 |
<arg value="${srcdir-ospath}" /> |
|
265 |
<arg value="-rj" /> |
|
266 |
<arg value="${external-libs-ospath}" /> |
|
267 |
<arg value="-nf" /> |
|
268 |
<arg value="${native-libs-ospath}" /> |
|
269 |
</exec> |
|
270 |
<echo>It will need to be signed with jarsigner before being published.</echo> |
|
271 |
</target> |
|
272 |
||
273 |
<!-- Install the package on the default emulator --> |
|
54
dfbb0fbece57
Add a rule for building the javadoc
Da Risk <darisk972@gmail.com>
parents:
7
diff
changeset
|
274 |
<target name="install" depends="debug" |
dfbb0fbece57
Add a rule for building the javadoc
Da Risk <darisk972@gmail.com>
parents:
7
diff
changeset
|
275 |
description="Install the package on the default emulator"> |
0 | 276 |
<echo>Installing ${out-debug-package} onto default emulator...</echo> |
277 |
<exec executable="${adb}" failonerror="true"> |
|
278 |
<arg value="install" /> |
|
279 |
<arg value="${out-debug-package}" /> |
|
280 |
</exec> |
|
281 |
</target> |
|
282 |
||
283 |
<target name="reinstall" depends="debug"> |
|
284 |
<echo>Installing ${out-debug-package} onto default emulator...</echo> |
|
285 |
<exec executable="${adb}" failonerror="true"> |
|
286 |
<arg value="install" /> |
|
287 |
<arg value="-r" /> |
|
288 |
<arg value="${out-debug-package}" /> |
|
289 |
</exec> |
|
290 |
</target> |
|
291 |
||
54
dfbb0fbece57
Add a rule for building the javadoc
Da Risk <darisk972@gmail.com>
parents:
7
diff
changeset
|
292 |
<!-- Uninstall the package from the default emulator --> |
dfbb0fbece57
Add a rule for building the javadoc
Da Risk <darisk972@gmail.com>
parents:
7
diff
changeset
|
293 |
<target name="uninstall" |
dfbb0fbece57
Add a rule for building the javadoc
Da Risk <darisk972@gmail.com>
parents:
7
diff
changeset
|
294 |
description="Uninstall the package from the default emulator"> |
0 | 295 |
<echo>Uninstalling ${application-package} from the default emulator...</echo> |
296 |
<exec executable="${adb}" failonerror="true"> |
|
297 |
<arg value="uninstall" /> |
|
298 |
<arg value="${application-package}" /> |
|
6
be992d61ca32
Ajout d'une regle clean dans le build.xml
Da Risk <darisk972@gmail.com>
parents:
0
diff
changeset
|
299 |
</exec> |
0 | 300 |
</target> |
301 |
||
6
be992d61ca32
Ajout d'une regle clean dans le build.xml
Da Risk <darisk972@gmail.com>
parents:
0
diff
changeset
|
302 |
<target name="clean" |
be992d61ca32
Ajout d'une regle clean dans le build.xml
Da Risk <darisk972@gmail.com>
parents:
0
diff
changeset
|
303 |
description="Delete old build and dist directories"> |
7
c2941cee7327
Ajout de programme qui peuvent s'echanger des donnees jingle et negocier une
Da Risk <darisk972@gmail.com>
parents:
6
diff
changeset
|
304 |
<delete verbose="false" dir="${outdir}"/> |
6
be992d61ca32
Ajout d'une regle clean dans le build.xml
Da Risk <darisk972@gmail.com>
parents:
0
diff
changeset
|
305 |
</target> |
be992d61ca32
Ajout d'une regle clean dans le build.xml
Da Risk <darisk972@gmail.com>
parents:
0
diff
changeset
|
306 |
|
54
dfbb0fbece57
Add a rule for building the javadoc
Da Risk <darisk972@gmail.com>
parents:
7
diff
changeset
|
307 |
<target name="javadoc" depends="aidl" |
dfbb0fbece57
Add a rule for building the javadoc
Da Risk <darisk972@gmail.com>
parents:
7
diff
changeset
|
308 |
description="Build the javadoc"> |
dfbb0fbece57
Add a rule for building the javadoc
Da Risk <darisk972@gmail.com>
parents:
7
diff
changeset
|
309 |
<javadoc sourcepath="${srcdir}" destdir="${javadoc-output}"> |
dfbb0fbece57
Add a rule for building the javadoc
Da Risk <darisk972@gmail.com>
parents:
7
diff
changeset
|
310 |
<classpath> |
dfbb0fbece57
Add a rule for building the javadoc
Da Risk <darisk972@gmail.com>
parents:
7
diff
changeset
|
311 |
<fileset dir="${external-libs}" includes="*.jar" /> |
dfbb0fbece57
Add a rule for building the javadoc
Da Risk <darisk972@gmail.com>
parents:
7
diff
changeset
|
312 |
</classpath> |
dfbb0fbece57
Add a rule for building the javadoc
Da Risk <darisk972@gmail.com>
parents:
7
diff
changeset
|
313 |
</javadoc> |
dfbb0fbece57
Add a rule for building the javadoc
Da Risk <darisk972@gmail.com>
parents:
7
diff
changeset
|
314 |
</target> |
6
be992d61ca32
Ajout d'une regle clean dans le build.xml
Da Risk <darisk972@gmail.com>
parents:
0
diff
changeset
|
315 |
|
0 | 316 |
</project> |