Index: build/android/gyp/write_build_config.py |
diff --git a/build/android/gyp/write_build_config.py b/build/android/gyp/write_build_config.py |
index 606b234f5588e1002c208600fdaf0d2dd1a36821..ab70a79056bfedf5a6a3f6bc4eae1e5dfc4bf6a2 100755 |
--- a/build/android/gyp/write_build_config.py |
+++ b/build/android/gyp/write_build_config.py |
@@ -69,9 +69,12 @@ def main(argv): |
'dependencies may not write build_config files. Missing build_config ' |
'files are handled differently based on the type of this target.') |
- # android_resources/apk options |
+ # android_resources options |
parser.add_option('--srcjar', help='Path to target\'s resources srcjar.') |
parser.add_option('--resources-zip', help='Path to target\'s resources zip.') |
+ parser.add_option('--package-name', |
+ help='Java package name for these resources.') |
+ parser.add_option('--android-manifest', help='Path to android manifest.') |
# android_library/apk options |
parser.add_option('--jar-path', help='Path to target\'s jar output.') |
@@ -121,9 +124,11 @@ def main(argv): |
all_deps_configs = [GetDepConfig(p) for p in all_deps_config_paths] |
direct_library_deps = DepsOfType('android_library', direct_deps_configs) |
- all_resources_deps = DepsOfType('android_resources', all_deps_configs) |
all_library_deps = DepsOfType('android_library', all_deps_configs) |
+ direct_resources_deps = DepsOfType('android_resources', direct_deps_configs) |
+ all_resources_deps = DepsOfType('android_resources', all_deps_configs) |
+ |
# Initialize some common config. |
config = { |
'deps_info': { |
@@ -142,21 +147,33 @@ def main(argv): |
config['javac'] = { |
'classpath': javac_classpath, |
} |
+ |
+ if options.type == 'android_library': |
# Only resources might have srcjars (normal srcjar targets are listed in |
# srcjar_deps). A resource's srcjar contains the R.java file for those |
# resources, and (like Android's default build system) we allow a library to |
# refer to the resources in any of its dependents. |
config['javac']['srcjars'] = [ |
- c['srcjar'] for c in all_resources_deps if 'srcjar' in c] |
+ c['srcjar'] for c in direct_resources_deps if 'srcjar' in c] |
- if options.type == 'android_resources' or options.type == 'android_apk': |
+ if options.type == 'android_apk': |
+ config['javac']['srcjars'] = [] |
+ |
+ |
+ if options.type == 'android_resources': |
deps_info['resources_zip'] = options.resources_zip |
if options.srcjar: |
deps_info['srcjar'] = options.srcjar |
+ if options.package_name: |
+ deps_info['package_name'] = options.package_name |
+ if options.type == 'android_resources' or options.type == 'android_apk': |
newt (away)
2014/09/15 18:44:25
or "in ['android_resources', 'android_apk']"
|
config['resources'] = {} |
config['resources']['dependency_zips'] = [ |
c['resources_zip'] for c in all_resources_deps] |
+ config['resources']['extra_package_names'] = [ |
+ c['package_name'] for c in all_resources_deps if 'package_name' in c] |
+ |
if options.type == 'android_apk': |
config['apk_dex'] = {} |