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-resources"> |
19 <property name="verbose" value="false" /> | |
20 <property name="out.dir" location="${OUT_DIR}" /> | 19 <property name="out.dir" location="${OUT_DIR}" /> |
21 <!-- Output directories --> | |
22 <property name="out.dir" value="bin" /> | |
23 <property name="out.absolute.dir" location="${out.dir}" /> | 20 <property name="out.absolute.dir" location="${out.dir}" /> |
24 <property name="out.res.absolute.dir" location="${out.dir}/res" /> | 21 <property name="out.res.absolute.dir" location="${out.dir}/res" /> |
25 <property name="out.manifest.abs.file" location="${out.dir}/AndroidManifest.xm
l" /> | 22 <property name="out.manifest.abs.file" location="${out.dir}/AndroidManifest.xm
l" /> |
26 | 23 |
27 <!-- tools location --> | 24 <!-- tools location --> |
28 <property name="sdk.dir" location="${ANDROID_SDK_ROOT}"/> | 25 <property name="sdk.dir" location="${ANDROID_SDK_ROOT}"/> |
29 <property name="target" value="android-${ANDROID_SDK_VERSION}"/> | |
30 <property name="project.target.android.jar" location="${ANDROID_SDK_JAR}" /> | 26 <property name="project.target.android.jar" location="${ANDROID_SDK_JAR}" /> |
31 <property name="android.tools.dir" location="${sdk.dir}/tools" /> | 27 <property name="android.tools.dir" location="${sdk.dir}/tools" /> |
32 <property name="android.platform.tools.dir" location="${sdk.dir}/platform-tool
s" /> | 28 <property name="android.platform.tools.dir" location="${sdk.dir}/platform-tool
s" /> |
33 | 29 |
34 <!-- jar file from where the tasks are loaded --> | 30 <!-- jar file from where the tasks are loaded --> |
35 <path id="android.antlibs"> | 31 <path id="android.antlibs"> |
36 <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" /> | 32 <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" /> |
37 </path> | 33 </path> |
38 | 34 |
39 <!-- Custom tasks --> | 35 <!-- Custom tasks --> |
40 <taskdef resource="anttasks.properties" classpathref="android.antlibs" /> | 36 <taskdef resource="anttasks.properties" classpathref="android.antlibs" /> |
41 | 37 |
42 <condition property="build.target" value="release" else="debug"> | 38 <condition property="build.target" value="release" else="debug"> |
43 <equals arg1="${CONFIGURATION_NAME}" arg2="Release" /> | 39 <equals arg1="${CONFIGURATION_NAME}" arg2="Release" /> |
44 </condition> | 40 </condition> |
45 <condition property="build.is.packaging.debug" value="true" else="false"> | 41 <condition property="build.is.packaging.debug" value="true" else="false"> |
46 <equals arg1="build.target" arg2="debug" /> | 42 <equals arg1="build.target" arg2="debug" /> |
47 </condition> | 43 </condition> |
48 | 44 |
49 <!-- Disables automatic signing. --> | |
50 <property name="build.is.signing.debug" value="false"/> | |
51 | |
52 <!-- SDK tools assume that out.packaged.file is signed and name it "...-unalig
ned" --> | |
53 <property name="out.packaged.file" value="${UNSIGNED_APK_PATH}" /> | |
54 | |
55 <property name="resource.dir" value="${RESOURCE_DIR}"/> | 45 <property name="resource.dir" value="${RESOURCE_DIR}"/> |
56 <property name="resource.absolute.dir" location="${resource.dir}"/> | 46 <property name="resource.absolute.dir" location="${resource.dir}"/> |
57 | 47 |
58 <property name="asset.dir" value="${ASSET_DIR}" /> | 48 <property name="asset.dir" value="${ASSET_DIR}" /> |
59 <property name="asset.absolute.dir" location="${asset.dir}" /> | 49 <property name="asset.absolute.dir" location="${asset.dir}" /> |
60 | 50 |
61 <property name="native.libs.absolute.dir" location="${NATIVE_LIBS_DIR}" /> | |
62 | |
63 <property name="aapt" location="${android.platform.tools.dir}/aapt" /> | 51 <property name="aapt" location="${android.platform.tools.dir}/aapt" /> |
64 | 52 |
65 <target name="-crunch"> | |
66 <!-- Updates the pre-processed PNG cache --> | |
67 <exec executable="${aapt}" taskName="crunch"> | |
68 <arg value="crunch" /> | |
69 <arg value="-v" /> | |
70 <arg value="-S" /> | |
71 <arg path="${resource.absolute.dir}" /> | |
72 <arg value="-C" /> | |
73 <arg path="${out.res.absolute.dir}" /> | |
74 </exec> | |
75 </target> | |
76 | |
77 <property name="version.code" value="${APP_MANIFEST_VERSION_CODE}"/> | 53 <property name="version.code" value="${APP_MANIFEST_VERSION_CODE}"/> |
78 <property name="version.name" value="${APP_MANIFEST_VERSION_NAME}"/> | 54 <property name="version.name" value="${APP_MANIFEST_VERSION_NAME}"/> |
79 | 55 |
80 <property name="aapt.resource.filter" value="" /> | 56 <property name="aapt.resource.filter" value="" /> |
81 <!-- 'aapt.ignore.assets' is the list of file patterns to ignore under /res an
d /assets. | 57 <!-- 'aapt.ignore.assets' is the list of file patterns to ignore under /res an
d /assets. |
82 Default is "!.svn:!.git:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*
~" | 58 Default is "!.svn:!.git:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*
~" |
83 | 59 |
84 Overall patterns syntax is: | 60 Overall patterns syntax is: |
85 [!][<dir>|<file>][*suffix-match|prefix-match*|full-match]:more:patter
ns... | 61 [!][<dir>|<file>][*suffix-match|prefix-match*|full-match]:more:patter
ns... |
86 | 62 |
(...skipping 20 matching lines...) Expand all Loading... |
107 <script language="javascript"> | 83 <script language="javascript"> |
108 var before = project.getProperty("ADDITIONAL_RES_PACKAGES"); | 84 var before = project.getProperty("ADDITIONAL_RES_PACKAGES"); |
109 project.setProperty("project.library.packages", before.replaceAll(" ", ";"))
; | 85 project.setProperty("project.library.packages", before.replaceAll(" ", ";"))
; |
110 </script> | 86 </script> |
111 | 87 |
112 <property name="build.packaging.nocrunch" value="true" /> | 88 <property name="build.packaging.nocrunch" value="true" /> |
113 | 89 |
114 <!-- Intermediate files --> | 90 <!-- Intermediate files --> |
115 <property name="resource.package.file.name" value="${APK_NAME}.ap_" /> | 91 <property name="resource.package.file.name" value="${APK_NAME}.ap_" /> |
116 | 92 |
| 93 <target name="-crunch"> |
| 94 <!-- Updates the pre-processed PNG cache --> |
| 95 <exec executable="${aapt}" taskName="crunch"> |
| 96 <arg value="crunch" /> |
| 97 <arg value="-v" /> |
| 98 <arg value="-S" /> |
| 99 <arg path="${resource.absolute.dir}" /> |
| 100 <arg value="-C" /> |
| 101 <arg path="${out.res.absolute.dir}" /> |
| 102 </exec> |
| 103 </target> |
| 104 |
117 <target name="-package-resources" depends="-crunch"> | 105 <target name="-package-resources" depends="-crunch"> |
118 <aapt | 106 <aapt |
119 executable="${aapt}" | 107 executable="${aapt}" |
120 command="package" | 108 command="package" |
121 versioncode="${version.code}" | 109 versioncode="${version.code}" |
122 versionname="${version.name}" | 110 versionname="${version.name}" |
123 debug="${build.is.packaging.debug}" | 111 debug="${build.is.packaging.debug}" |
124 manifest="${out.manifest.abs.file}" | 112 manifest="${out.manifest.abs.file}" |
125 assets="${asset.absolute.dir}" | 113 assets="${asset.absolute.dir}" |
126 androidjar="${project.target.android.jar}" | 114 androidjar="${project.target.android.jar}" |
127 apkfolder="${out.absolute.dir}" | 115 apkfolder="${out.absolute.dir}" |
128 nocrunch="${build.packaging.nocrunch}" | 116 nocrunch="${build.packaging.nocrunch}" |
129 resourcefilename="${resource.package.file.name}" | 117 resourcefilename="${resource.package.file.name}" |
130 resourcefilter="${aapt.resource.filter}" | 118 resourcefilter="${aapt.resource.filter}" |
131 libraryResFolderPathRefid="project.library.res.folder.path" | 119 libraryResFolderPathRefid="project.library.res.folder.path" |
132 libraryPackagesRefid="project.library.packages" | 120 libraryPackagesRefid="project.library.packages" |
133 libraryRFileRefid="project.library.bin.r.file.path" | 121 libraryRFileRefid="project.library.bin.r.file.path" |
134 previousBuildType="" | 122 previousBuildType="" |
135 buildType="${build.target}" | 123 buildType="${build.target}" |
136 ignoreAssets="${aapt.ignore.assets}"> | 124 ignoreAssets="${aapt.ignore.assets}"> |
137 <res path="${out.res.absolute.dir}" /> | 125 <res path="${out.res.absolute.dir}" /> |
138 <res path="${resource.absolute.dir}" /> | 126 <res path="${resource.absolute.dir}" /> |
139 <!-- <nocompress /> forces no compression on any files in assets or res/ra
w --> | 127 <!-- <nocompress /> forces no compression on any files in assets or res/ra
w --> |
140 <!-- <nocompress extension="xml" /> forces no compression on specific file
extensions in assets and res/raw --> | 128 <!-- <nocompress extension="xml" /> forces no compression on specific file
extensions in assets and res/raw --> |
141 </aapt> | 129 </aapt> |
142 </target> | |
143 | 130 |
144 <property name="dex.file.name" value="classes.dex" /> | 131 <touch file="${STAMP}" /> |
145 <property name="intermediate.dex.file" location="${out.absolute.dir}/${dex.fil
e.name}" /> | |
146 <property name="source.dir" value="${SOURCE_DIR}" /> | |
147 <property name="source.absolute.dir" location="${source.dir}" /> | |
148 | |
149 | |
150 <!-- Packages the application. --> | |
151 <target name="-package" depends="-package-resources"> | |
152 <apkbuilder | |
153 outfolder="${out.absolute.dir}" | |
154 resourcefile="${resource.package.file.name}" | |
155 apkfilepath="${out.packaged.file}" | |
156 debugpackaging="${build.is.packaging.debug}" | |
157 debugsigning="${build.is.signing.debug}" | |
158 verbose="${verbose}" | |
159 hascode="true" | |
160 previousBuildType="/" | |
161 buildType="${build.is.packaging.debug}/${build.is.signing.debug}"> | |
162 <dex path="${intermediate.dex.file}"/> | |
163 <sourcefolder path="${source.absolute.dir}"/> | |
164 <nativefolder path="${native.libs.absolute.dir}" /> | |
165 </apkbuilder> | |
166 </target> | 132 </target> |
167 </project> | 133 </project> |
OLD | NEW |