OLD | NEW |
1 <?xml version="1.0" encoding="UTF-8"?> | 1 <?xml version="1.0" encoding="UTF-8"?> |
2 <!-- | 2 <!-- |
3 Copyright (C) 2005-2008 The Android Open Source Project | 3 Copyright (C) 2005-2008 The Android Open Source Project |
4 | 4 |
5 Licensed under the Apache License, Version 2.0 (the "License"); | 5 Licensed under the Apache License, Version 2.0 (the "License"); |
6 you may not use this file except in compliance with the License. | 6 you may not use this file except in compliance with the License. |
7 You may obtain a copy of the License at | 7 You may obtain a copy of the License at |
8 | 8 |
9 http://www.apache.org/licenses/LICENSE-2.0 | 9 http://www.apache.org/licenses/LICENSE-2.0 |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 <path refid="javac.custom.classpath"/> | 71 <path refid="javac.custom.classpath"/> |
72 </path> | 72 </path> |
73 | 73 |
74 <path id="native.libs.gdbserver"> | 74 <path id="native.libs.gdbserver"> |
75 <fileset file="${android.gdbserver}"/> | 75 <fileset file="${android.gdbserver}"/> |
76 </path> | 76 </path> |
77 | 77 |
78 <!-- Disables automatic signing. --> | 78 <!-- Disables automatic signing. --> |
79 <property name="build.is.signing.debug" value="false"/> | 79 <property name="build.is.signing.debug" value="false"/> |
80 | 80 |
81 <!-- ******************************************************* --> | 81 <!-- SDK tools assume that out.packaged.file is signed and name it "...-unal
igned" --> |
82 <!-- **************** Overridable Properties *************** --> | 82 <property name="out.packaged.file" |
83 <!-- ******************************************************* --> | 83 value="${apks.dir}/${ant.project.name}-unsigned.apk" /> |
84 | 84 <property name="out.unaligned.file" |
85 <!-- You can override these values in your build.xml or ant.properties. | 85 value="${apks.dir}/${ant.project.name}-unaligned.apk" /> |
86 Overriding any other properties may result in broken build. --> | |
87 | |
88 <!-- Tells adb which device to target. You can change this from the command
line | |
89 by invoking "ant -Dadb.device.arg=-d" for device "ant -Dadb.device.arg=
-e" for | |
90 the emulator. --> | |
91 <property name="adb.device.arg" value="" /> | |
92 | 86 |
93 <!-- fileset exclude patterns (space separated) to prevent | 87 <!-- fileset exclude patterns (space separated) to prevent |
94 files inside src/ from being packaged. --> | 88 files inside src/ from being packaged. --> |
95 <property name="android.package.excludes" value="" /> | 89 <property name="android.package.excludes" value="" /> |
96 | 90 |
97 <!-- set some properties used for filtering/override. If those weren't defin
ed | 91 <!-- set some properties used for filtering/override. If those weren't defin
ed |
98 before, then this will create them with empty values, which are then ig
nored | 92 before, then this will create them with empty values, which are then ig
nored |
99 by the custom tasks receiving them. --> | 93 by the custom tasks receiving them. --> |
100 <property-value name="version.code" value="${APP_MANIFEST_VERSION_CODE}"/> | 94 <property-value name="version.code" value="${APP_MANIFEST_VERSION_CODE}"/> |
101 <property-value name="version.name" value="${APP_MANIFEST_VERSION_NAME}"/> | 95 <property-value name="version.name" value="${APP_MANIFEST_VERSION_NAME}"/> |
102 | 96 |
103 <property name="aapt.resource.filter" value="" /> | 97 <property name="aapt.resource.filter" value="" /> |
104 <!-- 'aapt.ignore.assets' is the list of file patterns to ignore under /res
and /assets. | 98 <!-- 'aapt.ignore.assets' is the list of file patterns to ignore under /res
and /assets. |
105 Default is "!.svn:!.git:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*
~" | 99 Default is "!.svn:!.git:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*
~" |
106 | 100 |
107 Overall patterns syntax is: | 101 Overall patterns syntax is: |
108 [!][<dir>|<file>][*suffix-match|prefix-match*|full-match]:more:patter
ns... | 102 [!][<dir>|<file>][*suffix-match|prefix-match*|full-match]:more:patter
ns... |
109 | 103 |
110 - The first character flag ! avoids printing a warning. | 104 - The first character flag ! avoids printing a warning. |
111 - Pattern can have the flag "<dir>" to match only directories | 105 - Pattern can have the flag "<dir>" to match only directories |
112 or "<file>" to match only files. Default is to match both. | 106 or "<file>" to match only files. Default is to match both. |
113 - Match is not case-sensitive. | 107 - Match is not case-sensitive. |
114 --> | 108 --> |
115 <property name="aapt.ignore.assets" value="" /> | 109 <property name="aapt.ignore.assets" value="" /> |
116 | 110 |
117 <!-- dex force jumbo options, to be used when dex merging fails with | |
118 UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dx.util.DexException: Canno
t handle conversion to jumbo index! | |
119 at com.android.dx.merge.InstructionTransformer.jumboCheck(Instruction
Transformer.java:103) | |
120 ... | |
121 --> | |
122 <property name="dex.force.jumbo" value="false" /> | |
123 | |
124 <!-- compilation options --> | 111 <!-- compilation options --> |
125 <property name="java.encoding" value="UTF-8" /> | 112 <property name="java.encoding" value="UTF-8" /> |
126 <property name="java.target" value="1.5" /> | 113 <property name="java.target" value="1.5" /> |
127 <property name="java.source" value="1.5" /> | 114 <property name="java.source" value="1.5" /> |
128 <property name="java.compilerargs" value="" /> | 115 <property name="java.compilerargs" value="" /> |
129 | 116 |
130 <!-- manifest merger default value --> | 117 <!-- manifest merger default value --> |
131 <property name="manifestmerger.enabled" value="false" /> | 118 <property name="manifestmerger.enabled" value="false" /> |
132 | 119 |
133 <!-- Verbosity --> | 120 <!-- Verbosity --> |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 <property name="out.res.absolute.dir" location="${out.dir}/res" /> | 165 <property name="out.res.absolute.dir" location="${out.dir}/res" /> |
179 <property name="out.aidl.absolute.dir" location="${out.dir}/aidl" /> | 166 <property name="out.aidl.absolute.dir" location="${out.dir}/aidl" /> |
180 <property name="out.dexed.absolute.dir" location="${out.dir}/dexedLibs" /> | 167 <property name="out.dexed.absolute.dir" location="${out.dir}/dexedLibs" /> |
181 <property name="out.manifest.abs.file" location="${out.dir}/AndroidManifest.
xml" /> | 168 <property name="out.manifest.abs.file" location="${out.dir}/AndroidManifest.
xml" /> |
182 | 169 |
183 <!-- tools location --> | 170 <!-- tools location --> |
184 <property name="android.tools.dir" location="${sdk.dir}/tools" /> | 171 <property name="android.tools.dir" location="${sdk.dir}/tools" /> |
185 <property name="android.platform.tools.dir" location="${sdk.dir}/platform-to
ols" /> | 172 <property name="android.platform.tools.dir" location="${sdk.dir}/platform-to
ols" /> |
186 <property name="exe" value="" /> | 173 <property name="exe" value="" /> |
187 <property name="bat" value="" /> | 174 <property name="bat" value="" /> |
188 <property name="adb" location="${android.platform.tools.dir}/adb${exe}" /> | |
189 <property name="zipalign" location="${android.tools.dir}/zipalign${exe}" /> | 175 <property name="zipalign" location="${android.tools.dir}/zipalign${exe}" /> |
190 <property name="aidl" location="${android.platform.tools.dir}/aidl${exe}" /> | 176 <property name="aidl" location="${android.platform.tools.dir}/aidl${exe}" /> |
191 <property name="aapt" location="${android.platform.tools.dir}/aapt${exe}" /> | 177 <property name="aapt" location="${android.platform.tools.dir}/aapt${exe}" /> |
192 <property name="dx" location="${android.platform.tools.dir}/dx${bat}" /> | 178 <property name="dx" location="${android.platform.tools.dir}/dx${bat}" /> |
193 | 179 |
194 <!-- Intermediate files --> | 180 <!-- Intermediate files --> |
195 <property name="dex.file.name" value="classes.dex" /> | 181 <property name="dex.file.name" value="classes.dex" /> |
196 <property name="intermediate.dex.file" location="${out.absolute.dir}/${dex.f
ile.name}" /> | 182 <property name="intermediate.dex.file" location="${out.absolute.dir}/${dex.f
ile.name}" /> |
197 <property name="resource.package.file.name" value="${ant.project.name}.ap_"
/> | 183 <property name="resource.package.file.name" value="${ant.project.name}.ap_"
/> |
198 | 184 |
199 <!-- Build property file --> | 185 <!-- Build property file --> |
200 <property name="out.build.prop.file" location="${out.absolute.dir}/build.pro
p" /> | 186 <property name="out.build.prop.file" location="${out.absolute.dir}/build.pro
p" /> |
201 | 187 |
202 <!-- | 188 <!-- |
203 For debug builds, the Android SDK tools create a key in ~/.android and sig
n the build with it. | 189 For debug builds, the Android SDK tools create a key in ~/.android and sig
n the build with it. |
204 This has caused all kinds of issues. Instead, the debug build should be si
gned with a key in | 190 This has caused all kinds of issues. Instead, the debug build should be si
gned with a key in |
205 build/android/ant. The SDK tools do not provide any support for overriding
that behavior and so | 191 build/android/ant. The SDK tools do not provide any support for overriding
that behavior and so |
206 instead one must use the hack below. | 192 instead one must use the hack below. |
207 --> | 193 --> |
208 <property name="key.store" value="${CHROMIUM_SRC}/build/android/ant/chromium
-debug.keystore"/> | 194 <property name="key.store" value="${CHROMIUM_SRC}/build/android/ant/chromium
-debug.keystore"/> |
209 <property name="key.store.password" value="chromium"/> | 195 <property name="key.store.password" value="chromium"/> |
210 <property name="key.alias" value="chromiumdebugkey"/> | 196 <property name="key.alias" value="chromiumdebugkey"/> |
211 <property name="key.alias.password" value="chromium"/> | 197 <property name="key.alias.password" value="chromium"/> |
212 | 198 |
213 <!-- properties for packaging --> | 199 <!-- properties for packaging --> |
214 <property name="build.packaging.nocrunch" value="true" /> | 200 <property name="build.packaging.nocrunch" value="true" /> |
215 | 201 |
216 <!-- whether we need to fork javac. | 202 <property name="need.javac.fork" value="false" /> |
217 This is only needed on Windows when running Java < 7 --> | |
218 <condition else="false" property="need.javac.fork"> | |
219 <and> | |
220 <matches pattern="1\.[56]" string="${java.specification.version}"/> | |
221 <not> | |
222 <os family="unix"/> | |
223 </not> | |
224 </and> | |
225 </condition> | |
226 | 203 |
227 <!-- ******************************************************* --> | 204 <!-- ******************************************************* --> |
228 <!-- ******************** Build Targets ******************** --> | 205 <!-- ******************** Build Targets ******************** --> |
229 <!-- ******************************************************* --> | 206 <!-- ******************************************************* --> |
230 | 207 |
231 <!-- Basic Ant + SDK check --> | 208 <!-- Basic Ant + SDK check --> |
232 <target name="-check-env"> | 209 <target name="-check-env"> |
233 <checkenv /> | 210 <checkenv /> |
234 </target> | 211 </target> |
235 | 212 |
236 <!-- generic setup --> | 213 <!-- generic setup --> |
237 <target name="-setup" depends="-check-env"> | 214 <target name="-setup" depends="-check-env"> |
238 <echo level="info">Project Name: ${ant.project.name}</echo> | 215 <echo level="info">Project Name: ${ant.project.name}</echo> |
239 <gettype projectTypeOut="project.type" /> | 216 <gettype projectTypeOut="project.type" /> |
240 | 217 |
241 <!-- sets a few boolean based on project.type | 218 <!-- sets a few boolean based on project.type |
242 to make the if task easier --> | 219 to make the if task easier --> |
243 <condition property="project.is.library" value="true" else="false"> | |
244 <equals arg1="${project.type}" arg2="library" /> | |
245 </condition> | |
246 <condition property="project.is.test" value="true" else="false"> | |
247 <equals arg1="${project.type}" arg2="test" /> | |
248 </condition> | |
249 <condition property="project.is.testapp" value="true" else="false"> | 220 <condition property="project.is.testapp" value="true" else="false"> |
250 <equals arg1="${project.type}" arg2="test-app" /> | 221 <equals arg1="${project.type}" arg2="test-app" /> |
251 </condition> | 222 </condition> |
252 | 223 |
253 <!-- If a test project, resolve absolute path to tested project. --> | |
254 <if condition="${project.is.test}"> | |
255 <then> | |
256 <property name="tested.project.absolute.dir" location="${tested.
project.dir}" /> | |
257 </then> | |
258 </if> | |
259 | |
260 <!-- get the project manifest package --> | 224 <!-- get the project manifest package --> |
261 <xpath input="${manifest.abs.file}" | 225 <xpath input="${manifest.abs.file}" |
262 expression="/manifest/@package" output="project.app.package" /> | 226 expression="/manifest/@package" output="project.app.package" /> |
263 | |
264 </target> | |
265 | |
266 <!-- empty default pre-clean target. Create a similar target in | |
267 your build.xml and it'll be called instead of this one. --> | |
268 <target name="-pre-clean"/> | |
269 | |
270 <!-- clean target --> | |
271 <target name="clean" depends="-setup, -pre-clean" | |
272 description="Removes output files created by other targets."> | |
273 <delete dir="${out.absolute.dir}" verbose="${verbose}" /> | |
274 <delete dir="${gen.absolute.dir}" verbose="${verbose}" /> | |
275 | |
276 <!-- if we know about a tested project or libraries, we clean them too.
--> | |
277 <if condition="${project.is.test}"> | |
278 <then> | |
279 <property name="tested.project.absolute.dir" location="${tested.
project.dir}" /> | |
280 <subant failonerror="true"> | |
281 <fileset dir="${tested.project.absolute.dir}" includes="buil
d.xml" /> | |
282 <target name="clean" /> | |
283 </subant> | |
284 </then> | |
285 </if> | |
286 | |
287 </target> | 227 </target> |
288 | 228 |
289 <!-- Pre build setup --> | 229 <!-- Pre build setup --> |
290 <target name="-build-setup" depends="-setup"> | 230 <target name="-build-setup" depends="-setup"> |
291 | 231 |
292 <!-- read the previous build mode --> | 232 <!-- read the previous build mode --> |
293 <property file="${out.build.prop.file}" /> | 233 <property file="${out.build.prop.file}" /> |
294 | 234 |
295 <echo level="info">Resolving Build Target for ${ant.project.name}...</ec
ho> | 235 <echo level="info">Resolving Build Target for ${ant.project.name}...</ec
ho> |
296 <!-- load project properties, resolve Android target, library dependenci
es | 236 <!-- load project properties, resolve Android target, library dependenci
es |
297 and set some properties with the results. | 237 and set some properties with the results. |
298 All property names are passed as parameters ending in -Out --> | 238 All property names are passed as parameters ending in -Out --> |
299 <gettarget | 239 <gettarget |
300 androidJarFileOut="project.target.android.jar" | 240 androidJarFileOut="project.target.android.jar" |
301 androidAidlFileOut="project.target.framework.aidl" | 241 androidAidlFileOut="project.target.framework.aidl" |
302 bootClassPathOut="project.target.class.path" | 242 bootClassPathOut="project.target.class.path" |
303 targetApiOut="project.target.apilevel" | 243 targetApiOut="project.target.apilevel" |
304 minSdkVersionOut="project.minSdkVersion" /> | 244 minSdkVersionOut="project.minSdkVersion" /> |
305 | 245 |
306 <!-- Value of the hasCode attribute (Application node) extracted from ma
nifest file --> | 246 <property name="manifest.hasCode" value="true" /> |
307 <xpath input="${manifest.abs.file}" expression="/manifest/application/@a
ndroid:hasCode" | 247 |
308 output="manifest.hasCode" default="true"/> | |
309 | 248 |
310 <echo level="info">----------</echo> | 249 <echo level="info">----------</echo> |
311 <echo level="info">Creating output directories if needed...</echo> | 250 <echo level="info">Creating output directories if needed...</echo> |
312 <mkdir dir="${resource.absolute.dir}" /> | 251 <mkdir dir="${resource.absolute.dir}" /> |
313 <mkdir dir="${jar.libs.absolute.dir}" /> | 252 <mkdir dir="${jar.libs.absolute.dir}" /> |
314 <mkdir dir="${out.absolute.dir}" /> | 253 <mkdir dir="${out.absolute.dir}" /> |
315 <mkdir dir="${out.res.absolute.dir}" /> | 254 <mkdir dir="${out.res.absolute.dir}" /> |
316 <mkdir dir="${gen.absolute.dir}" /> | 255 <mkdir dir="${gen.absolute.dir}" /> |
317 <mkdir dir="${out.classes.absolute.dir}" /> | 256 <mkdir dir="${out.classes.absolute.dir}" /> |
318 <mkdir dir="${out.dexed.absolute.dir}" /> | 257 <mkdir dir="${out.dexed.absolute.dir}" /> |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 jarfile="${lib.java.dir}/${JAR_NAME}" | 381 jarfile="${lib.java.dir}/${JAR_NAME}" |
443 basedir="${out.classes.absolute.dir}" | 382 basedir="${out.classes.absolute.dir}" |
444 /> | 383 /> |
445 </target> | 384 </target> |
446 | 385 |
447 | 386 |
448 <!-- Obfuscate target | 387 <!-- Obfuscate target |
449 This is only active in release builds when proguard.config is defined | 388 This is only active in release builds when proguard.config is defined |
450 in default.properties. | 389 in default.properties. |
451 | 390 |
452 To replace Proguard with a different obfuscation engine: | |
453 Override the following targets in your build.xml, before the call to <se
tup> | |
454 -release-obfuscation-check | |
455 Check whether obfuscation should happen, and put the result in a
property. | |
456 -debug-obfuscation-check | |
457 Obfuscation should not happen. Set the same property to false. | |
458 -obfuscate | |
459 check if the property set in -debug/release-obfuscation-check is
set to true. | |
460 If true: | |
461 Perform obfuscation | |
462 Set property out.dex.input.absolute.dir to be the output of
the obfuscation | |
463 --> | 391 --> |
464 <!-- | 392 <!-- |
465 Override obfuscate target to pass javac.custom.classpath to Proguard. SDK
tools do not provide | 393 Override obfuscate target to pass javac.custom.classpath to Proguard. SDK
tools do not provide |
466 any way to pass custom class paths to Proguard. | 394 any way to pass custom class paths to Proguard. |
467 --> | 395 --> |
468 <target name="-obfuscate"> | 396 <target name="-obfuscate"> |
469 <if condition="${proguard.enabled}"> | 397 <if condition="${proguard.enabled}"> |
470 <then> | 398 <then> |
471 <property name="obfuscate.absolute.dir" location="${out.absolute.dir}/
proguard"/> | 399 <property name="obfuscate.absolute.dir" location="${out.absolute.dir}/
proguard"/> |
472 <property name="preobfuscate.jar.file" value="${obfuscate.absolute.dir
}/original.jar"/> | 400 <property name="preobfuscate.jar.file" value="${obfuscate.absolute.dir
}/original.jar"/> |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 </then> | 467 </then> |
540 </if> | 468 </if> |
541 </target> | 469 </target> |
542 | 470 |
543 <!-- Converts this project's .class files into .dex files --> | 471 <!-- Converts this project's .class files into .dex files --> |
544 <target name="-dex" depends="-compile, -post-compile, -obfuscate"> | 472 <target name="-dex" depends="-compile, -post-compile, -obfuscate"> |
545 <sequential> | 473 <sequential> |
546 <!-- sets the primary input for dex. If a pre-dex task sets it to | 474 <!-- sets the primary input for dex. If a pre-dex task sets it to |
547 something else this has no effect --> | 475 something else this has no effect --> |
548 <property name="out.dex.input.absolute.dir" value="${out.classes.abs
olute.dir}" /> | 476 <property name="out.dex.input.absolute.dir" value="${out.classes.abs
olute.dir}" /> |
| 477 <property name="dex.force.jumbo" value="false" /> |
549 | 478 |
550 <dex executable="${dx}" | 479 <dex executable="${dx}" |
551 output="${intermediate.dex.file}" | 480 output="${intermediate.dex.file}" |
552 dexedlibs="${out.dexed.absolute.dir}" | 481 dexedlibs="${out.dexed.absolute.dir}" |
553 nolocals="false" | 482 nolocals="false" |
554 forceJumbo="${dex.force.jumbo}" | 483 forceJumbo="${dex.force.jumbo}" |
555 verbose="${verbose}"> | 484 verbose="${verbose}"> |
556 <path path="${out.dex.input.absolute.dir}"/> | 485 <path path="${out.dex.input.absolute.dir}"/> |
557 <path refid="out.dex.jar.input.ref" /> | 486 <path refid="out.dex.jar.input.ref" /> |
558 </dex> | 487 </dex> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 ignoreAssets="${aapt.ignore.assets}"> | 526 ignoreAssets="${aapt.ignore.assets}"> |
598 <res path="${out.res.absolute.dir}" /> | 527 <res path="${out.res.absolute.dir}" /> |
599 <res path="${resource.absolute.dir}" /> | 528 <res path="${resource.absolute.dir}" /> |
600 <!-- <nocompress /> forces no compression on any files in assets or
res/raw --> | 529 <!-- <nocompress /> forces no compression on any files in assets or
res/raw --> |
601 <!-- <nocompress extension="xml" /> forces no compression on specifi
c file extensions in assets and res/raw --> | 530 <!-- <nocompress extension="xml" /> forces no compression on specifi
c file extensions in assets and res/raw --> |
602 </aapt> | 531 </aapt> |
603 </target> | 532 </target> |
604 | 533 |
605 <!-- Packages the application. --> | 534 <!-- Packages the application. --> |
606 <target name="-package" depends="-dex, -package-resources"> | 535 <target name="-package" depends="-dex, -package-resources"> |
607 <sequential> | 536 <apkbuilder |
608 <apkbuilder | 537 outfolder="${out.absolute.dir}" |
609 outfolder="${out.absolute.dir}" | 538 resourcefile="${resource.package.file.name}" |
610 resourcefile="${resource.package.file.name}" | 539 apkfilepath="${out.packaged.file}" |
611 apkfilepath="${out.packaged.file}" | 540 debugpackaging="${build.is.packaging.debug}" |
612 debugpackaging="${build.is.packaging.debug}" | 541 debugsigning="${build.is.signing.debug}" |
613 debugsigning="${build.is.signing.debug}" | 542 verbose="${verbose}" |
614 verbose="${verbose}" | 543 hascode="${manifest.hasCode}" |
615 hascode="${manifest.hasCode}" | 544 previousBuildType="/" |
616 previousBuildType="/" | 545 buildType="${build.is.packaging.debug}/${build.is.signing.debug}
"> |
617 buildType="${build.is.packaging.debug}/${build.is.signing.de
bug}"> | 546 <dex path="${intermediate.dex.file}"/> |
618 <dex path="${intermediate.dex.file}"/> | 547 <sourcefolder path="${source.absolute.dir}"/> |
619 <sourcefolder path="${source.absolute.dir}"/> | 548 <nativefolder path="${native.libs.absolute.dir}" /> |
620 <nativefolder path="${native.libs.absolute.dir}" /> | 549 </apkbuilder> |
621 </apkbuilder> | |
622 </sequential> | |
623 </target> | 550 </target> |
624 | 551 |
625 <target name="-post-package" /> | 552 <target name="-post-package" /> |
626 <target name="-post-build" /> | 553 <target name="-post-build" /> |
627 | 554 |
628 <target name="-set-mode-check"> | 555 <target name="-set-mode-check"> |
629 <fail if="build.is.mode.set" | |
630 message="Cannot run two different modes at the same time. If you
are running more than one debug/release/instrument type targets, call them from
different Ant calls." /> | |
631 </target> | 556 </target> |
632 | 557 |
633 <!-- ******************************************************* --> | 558 <!-- ******************************************************* --> |
634 <!-- **************** Debug specific targets *************** --> | 559 <!-- **************** Debug specific targets *************** --> |
635 <!-- ******************************************************* --> | 560 <!-- ******************************************************* --> |
636 | 561 |
637 <target name="-set-debug-files" depends="-set-mode-check"> | 562 <target name="-set-debug-files" depends="-set-mode-check"> |
638 | |
639 <property name="out.packaged.file" location="${out.absolute.dir}/${ant.p
roject.name}-debug-unaligned.apk" /> | |
640 <property name="out.final.file" location="${out.absolute.dir}/${ant.proj
ect.name}-debug.apk" /> | |
641 <property name="build.is.mode.set" value="true" /> | |
642 </target> | 563 </target> |
643 | 564 |
644 | 565 |
645 <target name="-set-debug-mode" depends="-setup"> | 566 <target name="-set-debug-mode" depends="-setup"> |
646 <!-- record the current build target --> | 567 <!-- record the current build target --> |
647 <property name="build.target" value="debug" /> | 568 <property name="build.target" value="debug" /> |
648 | 569 |
649 <property name="build.is.instrumented" value="false" /> | 570 <property name="build.is.instrumented" value="false" /> |
650 | 571 |
651 <!-- whether the build is a debug build. always set. --> | 572 <!-- whether the build is a debug build. always set. --> |
652 <property name="build.is.packaging.debug" value="true" /> | 573 <property name="build.is.packaging.debug" value="true" /> |
653 | 574 |
654 <!-- signing mode: debug --> | 575 <!-- signing mode: debug --> |
655 <property name="build.is.signing.debug" value="true" /> | 576 <property name="build.is.signing.debug" value="true" /> |
656 </target> | 577 </target> |
657 | 578 |
658 <target name="-debug-obfuscation-check"> | 579 <target name="-debug-obfuscation-check"> |
659 <!-- proguard is never enabled in debug mode --> | 580 <!-- proguard is never enabled in debug mode --> |
660 <property name="proguard.enabled" value="false"/> | 581 <property name="proguard.enabled" value="false"/> |
661 </target> | 582 </target> |
662 | 583 |
663 <!-- SDK tools assume that out.packaged.file is signed and name it "...-unal
igned" --> | 584 <!-- Signs and zipaligns the apk. --> |
664 <property name="out.packaged.file" | |
665 value="${apks.dir}/${ant.project.name}-unsigned.apk" /> | |
666 <property name="out.unaligned.file" | |
667 value="${apks.dir}/${ant.project.name}-unaligned.apk" /> | |
668 | |
669 <!-- By default, the SDK tools build only aligns the APK in the -do-debug ta
rget. --> | |
670 <!-- Builds debug output package --> | |
671 <target name="-do-sign" | 585 <target name="-do-sign" |
672 depends="-package, -post-package"> | 586 depends="-package, -post-package"> |
673 <sequential> | 587 <sequential> |
674 <!-- Signs the APK --> | |
675 <echo level="info">Signing final apk...</echo> | 588 <echo level="info">Signing final apk...</echo> |
676 <signapk | 589 <signapk |
677 input="${out.packaged.file}" | 590 input="${out.packaged.file}" |
678 output="${out.unaligned.file}" | 591 output="${out.unaligned.file}" |
679 keystore="${key.store}" | 592 keystore="${key.store}" |
680 storepass="${key.store.password}" | 593 storepass="${key.store.password}" |
681 alias="${key.alias}" | 594 alias="${key.alias}" |
682 keypass="${key.alias.password}"/> | 595 keypass="${key.alias.password}"/> |
683 | 596 |
684 <!-- Zip aligns the APK --> | |
685 <zipalign | 597 <zipalign |
686 executable="${zipalign}" | 598 executable="${zipalign}" |
687 input="${out.unaligned.file}" | 599 input="${out.unaligned.file}" |
688 output="${out.final.file}" | 600 output="${out.final.file}" |
689 verbose="${verbose}" /> | 601 verbose="${verbose}" /> |
690 <echo level="info">Release Package: ${out.final.file}</echo> | 602 <echo level="info">Release Package: ${out.final.file}</echo> |
691 </sequential> | 603 </sequential> |
692 </target> | 604 </target> |
693 | 605 |
694 <target name="-do-debug" | 606 <target name="-do-debug" |
(...skipping 21 matching lines...) Expand all Loading... |
716 <then> | 628 <then> |
717 <echo level="info">Proguard.config is enabled</echo> | 629 <echo level="info">Proguard.config is enabled</echo> |
718 <!-- Secondary dx input (jar files) is empty since all the | 630 <!-- Secondary dx input (jar files) is empty since all the |
719 jar files will be in the obfuscated jar --> | 631 jar files will be in the obfuscated jar --> |
720 <path id="out.dex.jar.input.ref" /> | 632 <path id="out.dex.jar.input.ref" /> |
721 </then> | 633 </then> |
722 </if> | 634 </if> |
723 </target> | 635 </target> |
724 | 636 |
725 <target name="-set-release-mode" depends="-set-mode-check"> | 637 <target name="-set-release-mode" depends="-set-mode-check"> |
726 <property name="out.packaged.file" location="${out.absolute.dir}/${ant.p
roject.name}-release-unsigned.apk" /> | |
727 <property name="out.final.file" location="${out.absolute.dir}/${ant.proj
ect.name}-release.apk" /> | |
728 <property name="build.is.mode.set" value="true" /> | |
729 | |
730 <!-- record the current build target --> | 638 <!-- record the current build target --> |
731 <property name="build.target" value="release" /> | 639 <property name="build.target" value="release" /> |
732 | 640 |
733 <property name="build.is.instrumented" value="false" /> | 641 <property name="build.is.instrumented" value="false" /> |
734 | 642 |
735 <!-- release mode is only valid if the manifest does not explicitly | 643 <!-- release mode is only valid if the manifest does not explicitly |
736 set debuggable to true. default is false. --> | 644 set debuggable to true. default is false. --> |
737 <xpath input="${manifest.abs.file}" expression="/manifest/application/@a
ndroid:debuggable" | 645 <xpath input="${manifest.abs.file}" expression="/manifest/application/@a
ndroid:debuggable" |
738 output="build.is.packaging.debug" default="false"/> | 646 output="build.is.packaging.debug" default="false"/> |
739 | 647 |
(...skipping 21 matching lines...) Expand all Loading... |
761 | 669 |
762 <!-- This runs -package-release first and then runs | 670 <!-- This runs -package-release first and then runs |
763 only if release-sign is true (set in -release-check, | 671 only if release-sign is true (set in -release-check, |
764 called by -release-no-sign)--> | 672 called by -release-no-sign)--> |
765 <target name="release" | 673 <target name="release" |
766 depends="-set-release-mode, -release-obfuscation-check, -package
, -post-package, -release-sign, -post-build" | 674 depends="-set-release-mode, -release-obfuscation-check, -package
, -post-package, -release-sign, -post-build" |
767 description="Builds the application in release mode."> | 675 description="Builds the application in release mode."> |
768 </target> | 676 </target> |
769 | 677 |
770 </project> | 678 </project> |
OLD | NEW |