blob: c4466032d4dcd7d5c493ec213214f38659040cca [file] [log] [blame]
[email protected]15f08dd2012-01-27 07:29:481# 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
3# found in the LICENSE file.
4
5{
6 'variables': {
7 # When including this gypi, the following variables must be set:
[email protected]4636c832013-01-11 02:10:118 # schema_files: a list of json or IDL files that comprise the api model.
[email protected]15f08dd2012-01-27 07:29:489 # cc_dir: path to generated files
10 # root_namespace: the C++ namespace that all generated files go under
[email protected]cfe484902012-02-15 14:52:3211 # Functions and namespaces can be excluded by setting "nocompile" to true.
[email protected]704a9002014-03-05 10:11:1912 # The default root path of API implementation sources is
13 # chrome/browser/extensions/api and can be overridden by setting "impl_dir".
[email protected]15f08dd2012-01-27 07:29:4814 'api_gen_dir': '<(DEPTH)/tools/json_schema_compiler',
15 'api_gen': '<(api_gen_dir)/compiler.py',
[email protected]704a9002014-03-05 10:11:1916 'impl_dir%': 'chrome/browser/extensions/api',
[email protected]15f08dd2012-01-27 07:29:4817 },
18 'rules': [
19 {
20 'rule_name': 'genapi',
[email protected]4636c832013-01-11 02:10:1121 'msvs_external_rule': 1,
[email protected]15f08dd2012-01-27 07:29:4822 'extension': 'json',
23 'inputs': [
[email protected]cfe484902012-02-15 14:52:3224 '<(api_gen_dir)/cc_generator.py',
[email protected]15f08dd2012-01-27 07:29:4825 '<(api_gen_dir)/code.py',
26 '<(api_gen_dir)/compiler.py',
[email protected]32096af2013-02-06 01:29:3127 '<(api_gen_dir)/cpp_generator.py',
[email protected]15f08dd2012-01-27 07:29:4828 '<(api_gen_dir)/cpp_type_generator.py',
[email protected]750b8362012-03-07 02:33:3529 '<(api_gen_dir)/cpp_util.py',
[email protected]cfe484902012-02-15 14:52:3230 '<(api_gen_dir)/h_generator.py',
[email protected]750b8362012-03-07 02:33:3531 '<(api_gen_dir)/json_schema.py',
[email protected]cfe484902012-02-15 14:52:3232 '<(api_gen_dir)/model.py',
33 '<(api_gen_dir)/util.cc',
34 '<(api_gen_dir)/util.h',
35 '<(api_gen_dir)/util_cc_helper.py',
[email protected]25cbf6012012-02-28 05:51:4436 # TODO(calamity): uncomment this when gyp on windows behaves like other
37 # platforms. List expansions of filepaths in inputs expand to different
38 # things.
[email protected]4636c832013-01-11 02:10:1139 # '<@(schema_files)',
[email protected]15f08dd2012-01-27 07:29:4840 ],
41 'outputs': [
42 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_ROOT).cc',
43 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_ROOT).h',
44 ],
45 'action': [
46 'python',
47 '<(api_gen)',
48 '<(RULE_INPUT_PATH)',
49 '--root=<(DEPTH)',
50 '--destdir=<(SHARED_INTERMEDIATE_DIR)',
51 '--namespace=<(root_namespace)',
[email protected]32096af2013-02-06 01:29:3152 '--generator=cpp',
[email protected]704a9002014-03-05 10:11:1953 '--impl-dir=<(impl_dir)'
[email protected]15f08dd2012-01-27 07:29:4854 ],
[email protected]750b8362012-03-07 02:33:3555 'message': 'Generating C++ code from <(RULE_INPUT_PATH) json files',
56 'process_outputs_as_sources': 1,
57 },
58 {
59 'rule_name': 'genapi_idl',
[email protected]ae33d322012-03-19 22:24:3560 'msvs_external_rule': 1,
[email protected]750b8362012-03-07 02:33:3561 'extension': 'idl',
62 'inputs': [
[email protected]750b8362012-03-07 02:33:3563 '<(api_gen_dir)/cc_generator.py',
64 '<(api_gen_dir)/code.py',
65 '<(api_gen_dir)/compiler.py',
[email protected]32096af2013-02-06 01:29:3166 '<(api_gen_dir)/cpp_generator.py',
[email protected]750b8362012-03-07 02:33:3567 '<(api_gen_dir)/cpp_type_generator.py',
68 '<(api_gen_dir)/cpp_util.py',
69 '<(api_gen_dir)/h_generator.py',
70 '<(api_gen_dir)/idl_schema.py',
71 '<(api_gen_dir)/model.py',
72 '<(api_gen_dir)/util.cc',
73 '<(api_gen_dir)/util.h',
74 '<(api_gen_dir)/util_cc_helper.py',
75 # TODO(calamity): uncomment this when gyp on windows behaves like other
76 # platforms. List expansions of filepaths in inputs expand to different
77 # things.
[email protected]4636c832013-01-11 02:10:1178 # '<@(schema_files)',
[email protected]750b8362012-03-07 02:33:3579 ],
80 'outputs': [
81 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_ROOT).cc',
82 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_ROOT).h',
83 ],
84 'action': [
85 'python',
86 '<(api_gen)',
87 '<(RULE_INPUT_PATH)',
88 '--root=<(DEPTH)',
89 '--destdir=<(SHARED_INTERMEDIATE_DIR)',
90 '--namespace=<(root_namespace)',
[email protected]32096af2013-02-06 01:29:3191 '--generator=cpp',
[email protected]704a9002014-03-05 10:11:1992 '--impl-dir=<(impl_dir)'
[email protected]750b8362012-03-07 02:33:3593 ],
94 'message': 'Generating C++ code from <(RULE_INPUT_PATH) IDL files',
[email protected]15f08dd2012-01-27 07:29:4895 'process_outputs_as_sources': 1,
96 },
97 ],
98 'include_dirs': [
99 '<(SHARED_INTERMEDIATE_DIR)',
100 '<(DEPTH)',
101 ],
102 'dependencies':[
103 '<(DEPTH)/tools/json_schema_compiler/api_gen_util.gyp:api_gen_util',
104 ],
105 'direct_dependent_settings': {
106 'include_dirs': [
107 '<(SHARED_INTERMEDIATE_DIR)',
108 ]
109 },
110 # This target exports a hard dependency because it generates header
111 # files.
112 'hard_dependency': 1,
113}