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'] |