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 |
11 Unless required by applicable law or agreed to in writing, software | 11 Unless required by applicable law or agreed to in writing, software |
12 distributed under the License is distributed on an "AS IS" BASIS, | 12 distributed under the License is distributed on an "AS IS" BASIS, |
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
14 See the License for the specific language governing permissions and | 14 See the License for the specific language governing permissions and |
15 limitations under the License. | 15 limitations under the License. |
16 --> | 16 --> |
17 | 17 |
18 <project default="-package"> | 18 <project default="-package"> |
19 <property name="verbose" value="false" /> | 19 <property name="verbose" value="false" /> |
20 <property name="out.dir" location="${OUT_DIR}" /> | 20 <property name="out.dir" location="${OUT_DIR}" /> |
21 <property name="out.absolute.dir" location="${out.dir}" /> | 21 <property name="out.absolute.dir" location="${out.dir}" /> |
22 | 22 |
23 <property name="sdk.dir" location="${ANDROID_SDK_ROOT}"/> | 23 <property name="sdk.dir" location="${ANDROID_SDK_ROOT}"/> |
24 | 24 |
| 25 <condition property="emma.enabled" value="true" else="false"> |
| 26 <equals arg1="${COVERAGE}" arg2="1"/> |
| 27 </condition> |
| 28 |
25 <!-- jar file from where the tasks are loaded --> | 29 <!-- jar file from where the tasks are loaded --> |
26 <path id="android.antlibs"> | 30 <path id="android.antlibs"> |
27 <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" /> | 31 <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" /> |
28 </path> | 32 </path> |
29 | 33 |
30 <!-- Custom tasks --> | 34 <!-- Custom tasks --> |
31 <taskdef resource="anttasks.properties" classpathref="android.antlibs" /> | 35 <taskdef resource="anttasks.properties" classpathref="android.antlibs" /> |
32 | 36 |
33 <condition property="build.target" value="release" else="debug"> | 37 <condition property="build.target" value="release" else="debug"> |
34 <equals arg1="${CONFIGURATION_NAME}" arg2="Release" /> | 38 <equals arg1="${CONFIGURATION_NAME}" arg2="Release" /> |
(...skipping 12 matching lines...) Expand all Loading... |
47 | 51 |
48 <!-- Intermediate files --> | 52 <!-- Intermediate files --> |
49 <property name="resource.package.file.name" value="${APK_NAME}.ap_" /> | 53 <property name="resource.package.file.name" value="${APK_NAME}.ap_" /> |
50 | 54 |
51 <property name="dex.file.name" value="classes.dex" /> | 55 <property name="dex.file.name" value="classes.dex" /> |
52 <property name="intermediate.dex.file" location="${out.absolute.dir}/${dex.fil
e.name}" /> | 56 <property name="intermediate.dex.file" location="${out.absolute.dir}/${dex.fil
e.name}" /> |
53 | 57 |
54 <property name="source.dir" value="${SOURCE_DIR}" /> | 58 <property name="source.dir" value="${SOURCE_DIR}" /> |
55 <property name="source.absolute.dir" location="${source.dir}" /> | 59 <property name="source.absolute.dir" location="${source.dir}" /> |
56 | 60 |
| 61 <!-- Macro that enables passing a variable list of external jar files |
| 62 to ApkBuilder. --> |
| 63 <macrodef name="package-helper"> |
| 64 <element name="extra-jars" optional="yes" /> |
| 65 <sequential> |
| 66 <apkbuilder |
| 67 outfolder="${out.absolute.dir}" |
| 68 resourcefile="${resource.package.file.name}" |
| 69 apkfilepath="${out.packaged.file}" |
| 70 debugpackaging="${build.is.packaging.debug}" |
| 71 debugsigning="${build.is.signing.debug}" |
| 72 verbose="${verbose}" |
| 73 hascode="true" |
| 74 previousBuildType="/" |
| 75 buildType="${build.is.packaging.debug}/${build.is.signing.debug}"> |
| 76 <dex path="${intermediate.dex.file}"/> |
| 77 <sourcefolder path="${source.absolute.dir}"/> |
| 78 <nativefolder path="${native.libs.absolute.dir}" /> |
| 79 <extra-jars/> |
| 80 </apkbuilder> |
| 81 </sequential> |
| 82 </macrodef> |
| 83 |
| 84 |
57 <!-- Packages the application. --> | 85 <!-- Packages the application. --> |
58 <target name="-package"> | 86 <target name="-package"> |
59 <apkbuilder | 87 <if condition="${emma.enabled}"> |
60 outfolder="${out.absolute.dir}" | 88 <then> |
61 resourcefile="${resource.package.file.name}" | 89 » <package-helper> |
62 apkfilepath="${out.packaged.file}" | 90 » <extra-jars> |
63 debugpackaging="${build.is.packaging.debug}" | 91 » <jarfile path="${sdk.dir}/tools/lib/emma_device.jar" /> |
64 debugsigning="${build.is.signing.debug}" | 92 » </extra-jars> |
65 verbose="${verbose}" | 93 » </package-helper> |
66 hascode="true" | 94 </then> |
67 previousBuildType="/" | 95 <else> |
68 buildType="${build.is.packaging.debug}/${build.is.signing.debug}"> | 96 » <package-helper /> |
69 <dex path="${intermediate.dex.file}"/> | 97 </else> |
70 <sourcefolder path="${source.absolute.dir}"/> | 98 </if> |
71 <nativefolder path="${native.libs.absolute.dir}" /> | |
72 </apkbuilder> | |
73 </target> | 99 </target> |
74 </project> | 100 </project> |
OLD | NEW |