Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(761)

Side by Side Diff: build/android/ant/apk-package.xml

Issue 12963009: Split apk-build.xml into 3 steps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix webview Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 Copyright (C) 2005-2008 The Android Open Source Project
4
5 Licensed under the Apache License, Version 2.0 (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
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16 -->
17
18 <project default="-do-sign">
19 <property name="verbose" value="false" />
20 <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}" />
24 <property name="out.res.absolute.dir" location="${out.dir}/res" />
25 <property name="out.manifest.abs.file" location="${out.dir}/AndroidManifest.xm l" />
26
27 <!-- tools location -->
28 <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}" />
31 <property name="android.tools.dir" location="${sdk.dir}/tools" />
32 <property name="android.platform.tools.dir" location="${sdk.dir}/platform-tool s" />
33
34 <!-- jar file from where the tasks are loaded -->
35 <path id="android.antlibs">
36 <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
37 </path>
38
39 <!-- Custom tasks -->
40 <taskdef resource="anttasks.properties" classpathref="android.antlibs" />
41
42 <property name="configuration.name" value="${CONFIGURATION_NAME}" />
43 <condition property="build.target" value="release" else="debug">
44 <equals arg1="${CONFIGURATION_NAME}" arg2="Release" />
45 </condition>
46 <condition property="build.is.packaging.debug" value="true" else="false">
47 <equals arg1="build.target" arg2="debug" />
48 </condition>
49
50
51 <!-- Set the output directory for the final apk to the ${apks.dir}. -->
52 <property name="out.final.file" location="${APKS_DIR}/${APK_NAME}.apk" />
53
54 <!-- Disables automatic signing. -->
55 <property name="build.is.signing.debug" value="false"/>
56
57 <!-- SDK tools assume that out.packaged.file is signed and name it "...-unalig ned" -->
58 <property name="out.packaged.file" value="${out.dir}/${APK_NAME}-unsigned.apk" />
59 <property name="out.unaligned.file" value="${out.dir}/${APK_NAME}-unaligned.ap k" />
60
61 <property name="resource.dir" value="${RESOURCE_DIR}"/>
62 <property name="resource.absolute.dir" location="${resource.dir}"/>
63
64 <property name="asset.dir" value="${ASSET_DIR}" />
65 <property name="asset.absolute.dir" location="${asset.dir}" />
66
67 <property name="native.libs.absolute.dir" location="${out.dir}/libs" />
68
69 <property name="aapt" location="${android.platform.tools.dir}/aapt" />
70
71 <target name="-crunch">
72 <!-- Updates the pre-processed PNG cache -->
73 <exec executable="${aapt}" taskName="crunch">
74 <arg value="crunch" />
75 <arg value="-v" />
76 <arg value="-S" />
77 <arg path="${resource.absolute.dir}" />
78 <arg value="-C" />
79 <arg path="${out.res.absolute.dir}" />
80 </exec>
81 </target>
82
83 <property name="version.code" value="${APP_MANIFEST_VERSION_CODE}"/>
84 <property name="version.name" value="${APP_MANIFEST_VERSION_NAME}"/>
85
86 <property name="aapt.resource.filter" value="" />
87 <!-- 'aapt.ignore.assets' is the list of file patterns to ignore under /res an d /assets.
88 Default is "!.svn:!.git:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*.scc:* ~"
89
90 Overall patterns syntax is:
91 [!][<dir>|<file>][*suffix-match|prefix-match*|full-match]:more:patter ns...
92
93 - The first character flag ! avoids printing a warning.
94 - Pattern can have the flag "<dir>" to match only directories
95 or "<file>" to match only files. Default is to match both.
96 - Match is not case-sensitive.
97 -->
98 <property name="aapt.ignore.assets" value="" />
99
100 <!--
101 Include additional resource folders in the apk, e.g. content/.../res. We
102 list the res folders in project.library.res.folder.path and the
103 corresponding java packages in project.library.packages, which must be
104 semicolon-delimited while ADDITIONAL_RES_PACKAGES is space-delimited, henc e
105 the javascript task.
106 -->
107 <path id="project.library.res.folder.path">
108 <filelist files="${ADDITIONAL_RES_DIRS}"/>
109 </path>
110 <path id="project.library.bin.r.file.path">
111 <filelist files="${ADDITIONAL_R_TEXT_FILES}"/>
112 </path>
113 <script language="javascript">
114 var before = project.getProperty("ADDITIONAL_RES_PACKAGES");
115 project.setProperty("project.library.packages", before.replaceAll(" ", ";")) ;
116 </script>
117
118 <property name="build.packaging.nocrunch" value="true" />
119
120 <!-- Intermediate files -->
121 <property name="resource.package.file.name" value="${APK_NAME}.ap_" />
122
123 <target name="-package-resources" depends="-crunch">
124 <aapt
125 executable="${aapt}"
126 command="package"
127 versioncode="${version.code}"
128 versionname="${version.name}"
129 debug="${build.is.packaging.debug}"
130 manifest="${out.manifest.abs.file}"
131 assets="${asset.absolute.dir}"
132 androidjar="${project.target.android.jar}"
133 apkfolder="${out.absolute.dir}"
134 nocrunch="${build.packaging.nocrunch}"
135 resourcefilename="${resource.package.file.name}"
136 resourcefilter="${aapt.resource.filter}"
137 libraryResFolderPathRefid="project.library.res.folder.path"
138 libraryPackagesRefid="project.library.packages"
139 libraryRFileRefid="project.library.bin.r.file.path"
140 previousBuildType=""
141 buildType="${build.target}"
142 ignoreAssets="${aapt.ignore.assets}">
143 <res path="${out.res.absolute.dir}" />
144 <res path="${resource.absolute.dir}" />
145 <!-- <nocompress /> forces no compression on any files in assets or res/ra w -->
146 <!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets and res/raw -->
147 </aapt>
148 </target>
149
150 <property name="dex.file.name" value="classes.dex" />
151 <property name="intermediate.dex.file" location="${out.absolute.dir}/${dex.fil e.name}" />
152
153
154 <!-- Packages the application. -->
155 <target name="-package" depends="-package-resources">
156 <apkbuilder
157 outfolder="${out.absolute.dir}"
158 resourcefile="${resource.package.file.name}"
159 apkfilepath="${out.packaged.file}"
160 debugpackaging="${build.is.packaging.debug}"
161 debugsigning="${build.is.signing.debug}"
162 verbose="${verbose}"
163 hascode="${manifest.hasCode}"
164 previousBuildType="/"
165 buildType="${build.is.packaging.debug}/${build.is.signing.debug}">
166 <dex path="${intermediate.dex.file}"/>
167 <sourcefolder path="${source.absolute.dir}"/>
168 <nativefolder path="${native.libs.absolute.dir}" />
169 </apkbuilder>
170 </target>
171
172
173
174 <property name="key.store" value="${KEYSTORE_PATH}"/>
175 <property name="key.store.password" value="chromium"/>
176 <property name="key.alias" value="chromiumdebugkey"/>
177 <property name="key.alias.password" value="chromium"/>
178 <property name="zipalign" location="${android.tools.dir}/zipalign" />
179
180 <!-- Signs and zipaligns the apk. -->
181 <target name="-do-sign" depends="-package">
182 <sequential>
183 <echo level="info">Signing final apk...</echo>
184 <signapk
185 input="${out.packaged.file}"
186 output="${out.unaligned.file}"
187 keystore="${key.store}"
188 storepass="${key.store.password}"
189 alias="${key.alias}"
190 keypass="${key.alias.password}" />
191
192 <zipalign
193 executable="${zipalign}"
194 input="${out.unaligned.file}"
195 output="${out.final.file}"
196 verbose="${verbose}" />
197 <echo level="info">Release Package: ${out.final.file}</echo>
198 </sequential>
199 </target>
200 </project>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698