OLD | NEW |
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. |
12 # root_namespace: | 12 # root_namespace: |
13 # A Python string substituion pattern used to generate the C++ | 13 # A Python string substituion pattern used to generate the C++ |
14 # namespace for each API. Use %(namespace)s to replace with the API | 14 # namespace for each API. Use %(namespace)s to replace with the API |
15 # namespace, like "toplevel::%(namespace)s_api". | 15 # namespace, like "toplevel::%(namespace)s_api". |
16 # | 16 # |
17 # Functions and namespaces can be excluded by setting "nocompile" to true. | 17 # Functions and namespaces can be excluded by setting "nocompile" to true. |
| 18 # The default root path of API implementation sources is |
| 19 # chrome/browser/extensions/api and can be overridden by setting "impl_dir". |
18 'api_gen_dir': '<(DEPTH)/tools/json_schema_compiler', | 20 'api_gen_dir': '<(DEPTH)/tools/json_schema_compiler', |
19 'api_gen': '<(api_gen_dir)/compiler.py', | 21 'api_gen': '<(api_gen_dir)/compiler.py', |
| 22 'impl_dir%': 'chrome/browser/extensions/api', |
20 }, | 23 }, |
21 'rules': [ | 24 'rules': [ |
22 { | 25 { |
23 # GN version: //extensions/generated_extensions_api.gni | 26 # GN version: //extensions/generated_extensions_api.gni |
24 'rule_name': 'genapi', | 27 'rule_name': 'genapi', |
25 'msvs_external_rule': 1, | 28 'msvs_external_rule': 1, |
26 'extension': 'json', | 29 'extension': 'json', |
27 'inputs': [ | 30 'inputs': [ |
28 '<(api_gen_dir)/cc_generator.py', | 31 '<(api_gen_dir)/cc_generator.py', |
29 '<(api_gen_dir)/code.py', | 32 '<(api_gen_dir)/code.py', |
(...skipping 17 matching lines...) Expand all Loading... |
47 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT
_ROOT).h', | 50 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT
_ROOT).h', |
48 ], | 51 ], |
49 'action': [ | 52 'action': [ |
50 'python', | 53 'python', |
51 '<(api_gen)', | 54 '<(api_gen)', |
52 '<(RULE_INPUT_PATH)', | 55 '<(RULE_INPUT_PATH)', |
53 '--root=<(DEPTH)', | 56 '--root=<(DEPTH)', |
54 '--destdir=<(SHARED_INTERMEDIATE_DIR)', | 57 '--destdir=<(SHARED_INTERMEDIATE_DIR)', |
55 '--namespace=<(root_namespace)', | 58 '--namespace=<(root_namespace)', |
56 '--generator=cpp', | 59 '--generator=cpp', |
| 60 '--impl-dir=<(impl_dir)' |
57 ], | 61 ], |
58 'message': 'Generating C++ code from <(RULE_INPUT_PATH) json files', | 62 'message': 'Generating C++ code from <(RULE_INPUT_PATH) json files', |
59 'process_outputs_as_sources': 1, | 63 'process_outputs_as_sources': 1, |
60 }, | 64 }, |
61 { | 65 { |
62 'rule_name': 'genapi_idl', | 66 'rule_name': 'genapi_idl', |
63 'msvs_external_rule': 1, | 67 'msvs_external_rule': 1, |
64 'extension': 'idl', | 68 'extension': 'idl', |
65 'inputs': [ | 69 'inputs': [ |
66 '<(api_gen_dir)/cc_generator.py', | 70 '<(api_gen_dir)/cc_generator.py', |
(...skipping 18 matching lines...) Expand all Loading... |
85 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT
_ROOT).h', | 89 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT
_ROOT).h', |
86 ], | 90 ], |
87 'action': [ | 91 'action': [ |
88 'python', | 92 'python', |
89 '<(api_gen)', | 93 '<(api_gen)', |
90 '<(RULE_INPUT_PATH)', | 94 '<(RULE_INPUT_PATH)', |
91 '--root=<(DEPTH)', | 95 '--root=<(DEPTH)', |
92 '--destdir=<(SHARED_INTERMEDIATE_DIR)', | 96 '--destdir=<(SHARED_INTERMEDIATE_DIR)', |
93 '--namespace=<(root_namespace)', | 97 '--namespace=<(root_namespace)', |
94 '--generator=cpp', | 98 '--generator=cpp', |
| 99 '--impl-dir=<(impl_dir)' |
95 ], | 100 ], |
96 'message': 'Generating C++ code from <(RULE_INPUT_PATH) IDL files', | 101 'message': 'Generating C++ code from <(RULE_INPUT_PATH) IDL files', |
97 'process_outputs_as_sources': 1, | 102 'process_outputs_as_sources': 1, |
98 }, | 103 }, |
99 ], | 104 ], |
100 'include_dirs': [ | 105 'include_dirs': [ |
101 '<(SHARED_INTERMEDIATE_DIR)', | 106 '<(SHARED_INTERMEDIATE_DIR)', |
102 '<(DEPTH)', | 107 '<(DEPTH)', |
103 ], | 108 ], |
104 'dependencies':[ | 109 'dependencies':[ |
105 '<(DEPTH)/tools/json_schema_compiler/api_gen_util.gyp:api_gen_util', | 110 '<(DEPTH)/tools/json_schema_compiler/api_gen_util.gyp:api_gen_util', |
106 ], | 111 ], |
107 'direct_dependent_settings': { | 112 'direct_dependent_settings': { |
108 'include_dirs': [ | 113 'include_dirs': [ |
109 '<(SHARED_INTERMEDIATE_DIR)', | 114 '<(SHARED_INTERMEDIATE_DIR)', |
110 ] | 115 ] |
111 }, | 116 }, |
112 # This target exports a hard dependency because it generates header | 117 # This target exports a hard dependency because it generates header |
113 # files. | 118 # files. |
114 'hard_dependency': 1, | 119 'hard_dependency': 1, |
115 } | 120 } |
OLD | NEW |