Index: build/json_schema_bundle_compile.gypi |
diff --git a/build/json_schema_bundle_compile.gypi b/build/json_schema_bundle_compile.gypi |
index 7e712d7df49e45931305256e7342f98b02d3780e..4bf3c6c7612355b9d823c4a214ff0c93de6f1b48 100644 |
--- a/build/json_schema_bundle_compile.gypi |
+++ b/build/json_schema_bundle_compile.gypi |
@@ -8,7 +8,8 @@ |
# schema_files: |
# An array of json or idl files that comprise the api model. |
# cc_dir: |
- # The directory to put the generated code in. |
+ # The directory to put the generated code in (except for |
+ # API registration, which is put in impl_dir). |
# root_namespace: |
# A Python string substituion pattern used to generate the C++ |
# namespace for each API. Use %(namespace)s to replace with the API |
@@ -20,29 +21,55 @@ |
'api_gen_dir': '<(DEPTH)/tools/json_schema_compiler', |
'api_gen': '<(api_gen_dir)/compiler.py', |
'impl_dir%': 'chrome/browser/extensions/api', |
+ 'generator_files': [ |
+ '<(api_gen_dir)/cc_generator.py', |
+ '<(api_gen_dir)/code.py', |
+ '<(api_gen_dir)/compiler.py', |
+ '<(api_gen_dir)/cpp_bundle_generator.py', |
+ '<(api_gen_dir)/cpp_type_generator.py', |
+ '<(api_gen_dir)/cpp_util.py', |
+ '<(api_gen_dir)/h_generator.py', |
+ '<(api_gen_dir)/idl_schema.py', |
+ '<(api_gen_dir)/json_schema.py', |
+ '<(api_gen_dir)/model.py', |
+ '<(api_gen_dir)/util_cc_helper.py', |
+ ], |
}, |
'actions': [ |
{ |
# GN version: //extensions/generated_extensions_api.gni |
- 'action_name': 'genapi_bundle', |
+ 'action_name': 'genapi_bundle_registration', |
'inputs': [ |
- '<(api_gen_dir)/cc_generator.py', |
- '<(api_gen_dir)/code.py', |
- '<(api_gen_dir)/compiler.py', |
- '<(api_gen_dir)/cpp_bundle_generator.py', |
- '<(api_gen_dir)/cpp_type_generator.py', |
- '<(api_gen_dir)/cpp_util.py', |
- '<(api_gen_dir)/h_generator.py', |
- '<(api_gen_dir)/idl_schema.py', |
- '<(api_gen_dir)/json_schema.py', |
- '<(api_gen_dir)/model.py', |
- '<(api_gen_dir)/util_cc_helper.py', |
+ '<@(generator_files)', |
+ '<@(schema_files)', |
+ '<@(non_compiled_schema_files)', |
+ ], |
+ 'outputs': [ |
+ '<(SHARED_INTERMEDIATE_DIR)/<(impl_dir)/generated_api_registration.h', |
+ '<(SHARED_INTERMEDIATE_DIR)/<(impl_dir)/generated_api_registration.cc', |
+ ], |
+ 'action': [ |
+ 'python', |
+ '<(api_gen)', |
+ '--root=<(DEPTH)', |
+ '--destdir=<(SHARED_INTERMEDIATE_DIR)', |
+ '--namespace=<(root_namespace)', |
+ '--generator=cpp-bundle-registration', |
+ '--impl-dir=<(impl_dir)', |
+ '<@(schema_files)', |
+ '<@(non_compiled_schema_files)', |
+ ], |
+ 'message': 'Generating C++ API bundle code for function registration', |
+ 'process_outputs_as_sources': 1, |
+ }, |
+ { |
+ 'action_name': 'genapi_bundle_schema', |
+ 'inputs': [ |
+ '<@(generator_files)', |
'<@(schema_files)', |
'<@(non_compiled_schema_files)', |
], |
'outputs': [ |
- '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/generated_api.h', |
- '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/generated_api.cc', |
'<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/generated_schemas.h', |
'<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/generated_schemas.cc', |
], |
@@ -52,14 +79,14 @@ |
'--root=<(DEPTH)', |
'--destdir=<(SHARED_INTERMEDIATE_DIR)', |
'--namespace=<(root_namespace)', |
- '--generator=cpp-bundle', |
+ '--generator=cpp-bundle-schema', |
'--impl-dir=<(impl_dir)', |
'<@(schema_files)', |
'<@(non_compiled_schema_files)', |
], |
- 'message': 'Generating C++ API bundle code', |
+ 'message': 'Generating C++ API bundle code for schemas', |
'process_outputs_as_sources': 1, |
- } |
+ }, |
], |
'include_dirs': [ |
'<(SHARED_INTERMEDIATE_DIR)', |