diff options
author | yoz <yoz@chromium.org> | 2014-08-26 20:32:58 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-08-27 03:33:52 +0000 |
commit | 774dcda2d369584b2e964fa4971dda71cf819677 (patch) | |
tree | f9e3058e383cb5bf00f263a03c48e44620b3bafd /build/json_schema_bundle_registration_compile.gypi | |
parent | 3f7aec31073c730a68ee221bbd10dca9a60e9a04 (diff) | |
download | chromium_src-774dcda2d369584b2e964fa4971dda71cf819677.zip chromium_src-774dcda2d369584b2e964fa4971dda71cf819677.tar.gz chromium_src-774dcda2d369584b2e964fa4971dda71cf819677.tar.bz2 |
Reland 596ff54335b2a1b393af10657bc4945114f3beed - Split API bundle generation steps
* Fixed in this version: dependencies for *_api_registration on *_api.
Split bundle generation steps so that API registration is generated in browser, not common.
We now have schema generation, schema bundle generation, and schema bundle registration generation; the last of these is generated in a separate build target and output to browser rather than common.
Fix a couple of dangling gyp issues also.
BUG=405226
TBR=scottmg@chromium.org,sky@chromium.org
Review URL: https://codereview.chromium.org/513633002
Cr-Commit-Position: refs/heads/master@{#292090}
Diffstat (limited to 'build/json_schema_bundle_registration_compile.gypi')
-rw-r--r-- | build/json_schema_bundle_registration_compile.gypi | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/build/json_schema_bundle_registration_compile.gypi b/build/json_schema_bundle_registration_compile.gypi new file mode 100644 index 0000000..5a013bc --- /dev/null +++ b/build/json_schema_bundle_registration_compile.gypi @@ -0,0 +1,78 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'variables': { + # When including this gypi, the following variables must be set: + # schema_files: + # An array of json or idl files that comprise the api model. + # impl_dir_: + # The root path of API implementations; also used for the + # output location. (N.B. Named as such to prevent gyp from + # expanding it as a relative path.) + # root_namespace: + # A Python string substituion pattern used to generate the C++ + # namespace for each API. Use %(namespace)s to replace with the API + # namespace, like "toplevel::%(namespace)s_api". + # + # Functions and namespaces can be excluded by setting "nocompile" to true. + 'api_gen_dir': '<(DEPTH)/tools/json_schema_compiler', + 'api_gen': '<(api_gen_dir)/compiler.py', + '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_registration', + 'inputs': [ + '<@(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, + # Avoid running MIDL compiler on IDL input files. + 'explicit_idl_action': 1, + }, + ], + 'include_dirs': [ + '<(SHARED_INTERMEDIATE_DIR)', + '<(DEPTH)', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + '<(SHARED_INTERMEDIATE_DIR)', + ] + }, + # This target exports a hard dependency because it generates header + # files. + 'hard_dependency': 1, +} |