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

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: Rebase 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
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..181ff861c5c562b07cfe225a51d463e922033b0d 100755
--- a/build/android/gyp/package_resources.py
+++ b/build/android/gyp/package_resources.py
@@ -88,6 +88,21 @@ def MoveImagesToNonMdpiFolders(res_root):
shutil.move(src_file, dst_file)
+def PrepareExtractedZip(d):
+ 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':
newt (away) 2014/09/02 23:41:30 I'd explain what's going on here (the two possible
cjhopman 2014/09/04 01:14:58 Done.
+ 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 +135,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 += PrepareExtractedZip(subdir)
if 'Debug' in options.configuration_name:
package_command += ['--debug-mode']

Powered by Google App Engine
This is Rietveld 408576698