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

Unified Diff: build/android/gyp/package_resources.py

Issue 507523002: Add content_shell_apk target (and a bunch of its dependencies) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix PageTransitionTypes.template path Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/gyp/javac.py ('k') | build/android/gyp/process_resources.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/package_resources.py
diff --git a/build/android/gyp/package_resources.py b/build/android/gyp/package_resources.py
index 1f0685028d5b92bbbf69a3e44895d683bc47d4a0..f34578f72e60e2ad137ef7feb433c6df474254df 100755
--- a/build/android/gyp/package_resources.py
+++ b/build/android/gyp/package_resources.py
@@ -88,6 +88,27 @@ def MoveImagesToNonMdpiFolders(res_root):
shutil.move(src_file, dst_file)
+def PackageArgsForExtractedZip(d):
+ """Returns the aapt args for an extracted resources zip.
+
+ A resources zip either contains the resources for a single target or for
+ multiple targets. If it is multiple targets merged into one, the actual
+ resource directories will be contained in the subdirectories 0, 1, 2, ...
+ """
+ res_dirs = []
+ subdirs = [os.path.join(d, s) for s in os.listdir(d)]
+ subdirs = sorted([s for s in subdirs if os.path.isdir(s)])
+ if subdirs and os.path.basename(subdirs[0]) == '0':
+ res_dirs = subdirs
+ else:
+ res_dirs = [d]
+ package_command = []
+ for d in res_dirs:
+ MoveImagesToNonMdpiFolders(d)
+ package_command += ['-S', d]
+ return package_command
+
+
def main():
options = ParseArgs()
android_jar = os.path.join(options.android_sdk, 'android.jar')
@@ -120,8 +141,7 @@ def main():
if os.path.exists(subdir):
raise Exception('Resource zip name conflict: ' + os.path.basename(z))
build_utils.ExtractAll(z, path=subdir)
- MoveImagesToNonMdpiFolders(subdir)
- package_command += ['-S', subdir]
+ package_command += PackageArgsForExtractedZip(subdir)
if 'Debug' in options.configuration_name:
package_command += ['--debug-mode']
« no previous file with comments | « build/android/gyp/javac.py ('k') | build/android/gyp/process_resources.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698