Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: build/json_schema_bundle_compile.gypi

Issue 489153003: Split bundle generation steps so that API registration is generated in browser, not common. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 { 5 {
6 'variables': { 6 'variables': {
7 # When including this gypi, the following variables must be set: 7 # When including this gypi, the following variables must be set:
8 # schema_files: 8 # schema_files:
9 # An array of json or idl files that comprise the api model. 9 # An array of json or idl files that comprise the api model.
10 # cc_dir: 10 # cc_dir:
11 # The directory to put the generated code in. 11 # The directory to put the generated code in (except for
12 # API registration, which is put in impl_dir).
12 # root_namespace: 13 # root_namespace:
13 # A Python string substituion pattern used to generate the C++ 14 # A Python string substituion pattern used to generate the C++
14 # namespace for each API. Use %(namespace)s to replace with the API 15 # namespace for each API. Use %(namespace)s to replace with the API
15 # namespace, like "toplevel::%(namespace)s_api". 16 # namespace, like "toplevel::%(namespace)s_api".
16 # 17 #
17 # Functions and namespaces can be excluded by setting "nocompile" to true. 18 # Functions and namespaces can be excluded by setting "nocompile" to true.
18 # The default root path of API implementation sources is 19 # The default root path of API implementation sources is
19 # chrome/browser/extensions/api and can be overridden by setting "impl_dir". 20 # chrome/browser/extensions/api and can be overridden by setting "impl_dir".
20 'api_gen_dir': '<(DEPTH)/tools/json_schema_compiler', 21 'api_gen_dir': '<(DEPTH)/tools/json_schema_compiler',
21 'api_gen': '<(api_gen_dir)/compiler.py', 22 'api_gen': '<(api_gen_dir)/compiler.py',
22 'impl_dir%': 'chrome/browser/extensions/api', 23 'impl_dir%': 'chrome/browser/extensions/api',
24 'generator_files': [
25 '<(api_gen_dir)/cc_generator.py',
26 '<(api_gen_dir)/code.py',
27 '<(api_gen_dir)/compiler.py',
28 '<(api_gen_dir)/cpp_bundle_generator.py',
29 '<(api_gen_dir)/cpp_type_generator.py',
30 '<(api_gen_dir)/cpp_util.py',
31 '<(api_gen_dir)/h_generator.py',
32 '<(api_gen_dir)/idl_schema.py',
33 '<(api_gen_dir)/json_schema.py',
34 '<(api_gen_dir)/model.py',
35 '<(api_gen_dir)/util_cc_helper.py',
36 ],
23 }, 37 },
24 'actions': [ 38 'actions': [
25 { 39 {
26 # GN version: //extensions/generated_extensions_api.gni 40 # GN version: //extensions/generated_extensions_api.gni
27 'action_name': 'genapi_bundle', 41 'action_name': 'genapi_bundle_registration',
28 'inputs': [ 42 'inputs': [
29 '<(api_gen_dir)/cc_generator.py', 43 '<@(generator_files)',
30 '<(api_gen_dir)/code.py',
31 '<(api_gen_dir)/compiler.py',
32 '<(api_gen_dir)/cpp_bundle_generator.py',
33 '<(api_gen_dir)/cpp_type_generator.py',
34 '<(api_gen_dir)/cpp_util.py',
35 '<(api_gen_dir)/h_generator.py',
36 '<(api_gen_dir)/idl_schema.py',
37 '<(api_gen_dir)/json_schema.py',
38 '<(api_gen_dir)/model.py',
39 '<(api_gen_dir)/util_cc_helper.py',
40 '<@(schema_files)', 44 '<@(schema_files)',
41 '<@(non_compiled_schema_files)', 45 '<@(non_compiled_schema_files)',
42 ], 46 ],
43 'outputs': [ 47 'outputs': [
44 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/generated_api.h', 48 '<(SHARED_INTERMEDIATE_DIR)/<(impl_dir)/generated_api_registration.h',
45 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/generated_api.cc', 49 '<(SHARED_INTERMEDIATE_DIR)/<(impl_dir)/generated_api_registration.cc',
50 ],
51 'action': [
52 'python',
53 '<(api_gen)',
54 '--root=<(DEPTH)',
55 '--destdir=<(SHARED_INTERMEDIATE_DIR)',
56 '--namespace=<(root_namespace)',
57 '--generator=cpp-bundle-registration',
58 '--impl-dir=<(impl_dir)',
59 '<@(schema_files)',
60 '<@(non_compiled_schema_files)',
61 ],
62 'message': 'Generating C++ API bundle code for function registration',
63 'process_outputs_as_sources': 1,
64 },
65 {
66 'action_name': 'genapi_bundle_schema',
67 'inputs': [
68 '<@(generator_files)',
69 '<@(schema_files)',
70 '<@(non_compiled_schema_files)',
71 ],
72 'outputs': [
46 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/generated_schemas.h', 73 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/generated_schemas.h',
47 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/generated_schemas.cc', 74 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/generated_schemas.cc',
48 ], 75 ],
49 'action': [ 76 'action': [
50 'python', 77 'python',
51 '<(api_gen)', 78 '<(api_gen)',
52 '--root=<(DEPTH)', 79 '--root=<(DEPTH)',
53 '--destdir=<(SHARED_INTERMEDIATE_DIR)', 80 '--destdir=<(SHARED_INTERMEDIATE_DIR)',
54 '--namespace=<(root_namespace)', 81 '--namespace=<(root_namespace)',
55 '--generator=cpp-bundle', 82 '--generator=cpp-bundle-schema',
56 '--impl-dir=<(impl_dir)', 83 '--impl-dir=<(impl_dir)',
57 '<@(schema_files)', 84 '<@(schema_files)',
58 '<@(non_compiled_schema_files)', 85 '<@(non_compiled_schema_files)',
59 ], 86 ],
60 'message': 'Generating C++ API bundle code', 87 'message': 'Generating C++ API bundle code for schemas',
61 'process_outputs_as_sources': 1, 88 'process_outputs_as_sources': 1,
62 } 89 },
63 ], 90 ],
64 'include_dirs': [ 91 'include_dirs': [
65 '<(SHARED_INTERMEDIATE_DIR)', 92 '<(SHARED_INTERMEDIATE_DIR)',
66 '<(DEPTH)', 93 '<(DEPTH)',
67 ], 94 ],
68 'direct_dependent_settings': { 95 'direct_dependent_settings': {
69 'include_dirs': [ 96 'include_dirs': [
70 '<(SHARED_INTERMEDIATE_DIR)', 97 '<(SHARED_INTERMEDIATE_DIR)',
71 ] 98 ]
72 }, 99 },
73 # This target exports a hard dependency because it generates header 100 # This target exports a hard dependency because it generates header
74 # files. 101 # files.
75 'hard_dependency': 1, 102 'hard_dependency': 1,
76 } 103 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/chrome_extensions_browser_client.cc » ('j') | tools/json_schema_compiler/compiler.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698