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 e0b727b14badf14f147ce5d43146b9ec19854b2c..4913083915dd01db8c469740688f14d9b4d3aa9e 100755 |
--- a/build/android/gyp/write_build_config.py |
+++ b/build/android/gyp/write_build_config.py |
@@ -39,9 +39,10 @@ import write_ordered_libraries |
# Types that should never be used as a dependency of another build config. |
-_ROOT_TYPES = ('android_apk', 'deps_dex', 'java_binary', 'resource_rewriter') |
+_ROOT_TYPES = ('android_apk', 'deps_dex', 'java_binary', 'resource_rewriter', |
+ 'android_aar') |
# Types that should not allow code deps to pass through. |
-_RESOURCE_TYPES = ('android_assets', 'android_resources') |
+_RESOURCE_TYPES = ('android_assets', 'android_resources', 'android_aar') |
agrieve
2016/06/16 02:00:04
aar matches the name here, but not the comment. Th
|
class AndroidManifest(object): |
@@ -120,9 +121,12 @@ class Deps(object): |
return DepsOfType(wanted_type, self.all_deps_configs) |
def Direct(self, wanted_type=None): |
+ additional_deps = [] |
if wanted_type is None: |
return self.direct_deps_configs |
- return DepsOfType(wanted_type, self.direct_deps_configs) |
+ if wanted_type in ['java_library', 'android_resources']: |
agrieve
2016/06/16 02:00:03
an android_aar may or may not have resources / ass
|
+ additional_deps = DepsOfType('android_aar', self.direct_deps_configs) |
+ return additional_deps + DepsOfType(wanted_type, self.direct_deps_configs) |
def AllConfigPaths(self): |
return self.all_deps_config_paths |
@@ -258,6 +262,7 @@ def main(argv): |
'android_assets': ['build_config'], |
'android_resources': ['build_config', 'resources_zip'], |
'android_apk': ['build_config', 'jar_path', 'dex_path', 'resources_zip'], |
+ 'android_aar': ['build_config', 'jar_path', 'resources_zip'], |
'deps_dex': ['build_config', 'dex_path'], |
'resource_rewriter': ['build_config'], |
'group': ['build_config'], |
@@ -334,7 +339,7 @@ def main(argv): |
} |
deps_info = config['deps_info'] |
- if (options.type in ('java_binary', 'java_library') and |
+ if (options.type in ('java_binary', 'java_library', 'android_aar') and |
not options.bypass_platform_checks): |
deps_info['requires_android'] = options.requires_android |
deps_info['supports_android'] = options.supports_android |
@@ -352,7 +357,8 @@ def main(argv): |
raise Exception('Not all deps support the Android platform: ' + |
str(deps_not_support_android)) |
- if options.type in ('java_binary', 'java_library', 'android_apk'): |
+ if options.type in ('java_binary', 'java_library', 'android_apk', |
+ 'android_aar'): |
javac_classpath = [c['jar_path'] for c in direct_library_deps] |
java_full_classpath = [c['jar_path'] for c in all_library_deps] |
deps_info['resources_deps'] = [c['path'] for c in all_resources_deps] |
@@ -368,7 +374,7 @@ def main(argv): |
# Classpath values filled in below (after applying tested_apk_config). |
config['javac'] = {} |
- if options.type in ('java_binary', 'java_library'): |
+ if options.type in ('java_binary', 'java_library', 'android_aar'): |
# 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 |
@@ -377,7 +383,7 @@ def main(argv): |
c['srcjar'] for c in direct_resources_deps if 'srcjar' in c] |
# Used to strip out R.class for android_prebuilt()s. |
- if options.type == 'java_library': |
+ if options.type in ('java_library', 'android_aar'): |
config['javac']['resource_packages'] = [ |
c['package_name'] for c in all_resources_deps if 'package_name' in c] |
@@ -402,7 +408,7 @@ def main(argv): |
if options.disable_asset_compression: |
deps_info['assets']['disable_compression'] = True |
- if options.type == 'android_resources': |
+ if options.type in ('android_resources', 'android_aar'): |
agrieve
2016/06/16 02:00:03
Should probably update package_resources.py to not
|
deps_info['resources_zip'] = options.resources_zip |
if options.srcjar: |
deps_info['srcjar'] = options.srcjar |
@@ -416,7 +422,8 @@ def main(argv): |
if options.is_locale_resource: |
deps_info['is_locale_resource'] = True |
- if options.type in ('android_resources','android_apk', 'resource_rewriter'): |
+ if options.type in ('android_resources', 'android_apk', 'resource_rewriter', |
+ 'android_aar'): |
config['resources'] = {} |
config['resources']['dependency_zips'] = [ |
c['resources_zip'] for c in all_resources_deps] |
@@ -468,7 +475,8 @@ def main(argv): |
dex_config = config['final_dex'] |
dex_config['dependency_dex_files'] = deps_dex_files |
- if options.type in ('java_binary', 'java_library', 'android_apk'): |
+ if options.type in ('java_binary', 'java_library', 'android_apk', |
+ 'android_aar'): |
config['javac']['classpath'] = javac_classpath |
config['javac']['interface_classpath'] = [ |
_AsInterfaceJar(p) for p in javac_classpath] |