blob: 1f94b46f0d3235515fb3ea9505c18f23b35dd01d [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 {
[email protected]fca567b2014-07-02 17:37:3420 # GN version: //extensions/generated_extensions_api.gni
[email protected]15f08dd2012-01-27 07:29:4821 'rule_name': 'genapi',
[email protected]4636c832013-01-11 02:10:1122 'msvs_external_rule': 1,
[email protected]15f08dd2012-01-27 07:29:4823 'extension': 'json',
24 'inputs': [
[email protected]cfe484902012-02-15 14:52:3225 '<(api_gen_dir)/cc_generator.py',
[email protected]15f08dd2012-01-27 07:29:4826 '<(api_gen_dir)/code.py',
27 '<(api_gen_dir)/compiler.py',
[email protected]32096af2013-02-06 01:29:3128 '<(api_gen_dir)/cpp_generator.py',
[email protected]15f08dd2012-01-27 07:29:4829 '<(api_gen_dir)/cpp_type_generator.py',
[email protected]750b8362012-03-07 02:33:3530 '<(api_gen_dir)/cpp_util.py',
[email protected]cfe484902012-02-15 14:52:3231 '<(api_gen_dir)/h_generator.py',
[email protected]750b8362012-03-07 02:33:3532 '<(api_gen_dir)/json_schema.py',
[email protected]cfe484902012-02-15 14:52:3233 '<(api_gen_dir)/model.py',
34 '<(api_gen_dir)/util.cc',
35 '<(api_gen_dir)/util.h',
36 '<(api_gen_dir)/util_cc_helper.py',
[email protected]25cbf6012012-02-28 05:51:4437 # TODO(calamity): uncomment this when gyp on windows behaves like other
38 # platforms. List expansions of filepaths in inputs expand to different
39 # things.
[email protected]4636c832013-01-11 02:10:1140 # '<@(schema_files)',
[email protected]15f08dd2012-01-27 07:29:4841 ],
42 'outputs': [
[email protected]c9fa3e62014-05-12 18:17:4443 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).cc',
44 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).h',
[email protected]15f08dd2012-01-27 07:29:4845 ],
46 'action': [
47 'python',
48 '<(api_gen)',
49 '<(RULE_INPUT_PATH)',
50 '--root=<(DEPTH)',
51 '--destdir=<(SHARED_INTERMEDIATE_DIR)',
52 '--namespace=<(root_namespace)',
[email protected]32096af2013-02-06 01:29:3153 '--generator=cpp',
[email protected]704a9002014-03-05 10:11:1954 '--impl-dir=<(impl_dir)'
[email protected]15f08dd2012-01-27 07:29:4855 ],
[email protected]750b8362012-03-07 02:33:3556 'message': 'Generating C++ code from <(RULE_INPUT_PATH) json files',
57 'process_outputs_as_sources': 1,
58 },
59 {
60 'rule_name': 'genapi_idl',
[email protected]ae33d322012-03-19 22:24:3561 'msvs_external_rule': 1,
[email protected]750b8362012-03-07 02:33:3562 'extension': 'idl',
63 'inputs': [
[email protected]750b8362012-03-07 02:33:3564 '<(api_gen_dir)/cc_generator.py',
65 '<(api_gen_dir)/code.py',
66 '<(api_gen_dir)/compiler.py',
[email protected]32096af2013-02-06 01:29:3167 '<(api_gen_dir)/cpp_generator.py',
[email protected]750b8362012-03-07 02:33:3568 '<(api_gen_dir)/cpp_type_generator.py',
69 '<(api_gen_dir)/cpp_util.py',
70 '<(api_gen_dir)/h_generator.py',
71 '<(api_gen_dir)/idl_schema.py',
72 '<(api_gen_dir)/model.py',
73 '<(api_gen_dir)/util.cc',
74 '<(api_gen_dir)/util.h',
75 '<(api_gen_dir)/util_cc_helper.py',
76 # TODO(calamity): uncomment this when gyp on windows behaves like other
77 # platforms. List expansions of filepaths in inputs expand to different
78 # things.
[email protected]4636c832013-01-11 02:10:1179 # '<@(schema_files)',
[email protected]750b8362012-03-07 02:33:3580 ],
81 'outputs': [
[email protected]c9fa3e62014-05-12 18:17:4482 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).cc',
83 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).h',
[email protected]750b8362012-03-07 02:33:3584 ],
85 'action': [
86 'python',
87 '<(api_gen)',
88 '<(RULE_INPUT_PATH)',
89 '--root=<(DEPTH)',
90 '--destdir=<(SHARED_INTERMEDIATE_DIR)',
91 '--namespace=<(root_namespace)',
[email protected]32096af2013-02-06 01:29:3192 '--generator=cpp',
[email protected]704a9002014-03-05 10:11:1993 '--impl-dir=<(impl_dir)'
[email protected]750b8362012-03-07 02:33:3594 ],
95 'message': 'Generating C++ code from <(RULE_INPUT_PATH) IDL files',
[email protected]15f08dd2012-01-27 07:29:4896 'process_outputs_as_sources': 1,
97 },
98 ],
99 'include_dirs': [
100 '<(SHARED_INTERMEDIATE_DIR)',
101 '<(DEPTH)',
102 ],
103 'dependencies':[
104 '<(DEPTH)/tools/json_schema_compiler/api_gen_util.gyp:api_gen_util',
105 ],
106 'direct_dependent_settings': {
107 'include_dirs': [
108 '<(SHARED_INTERMEDIATE_DIR)',
109 ]
110 },
111 # This target exports a hard dependency because it generates header
112 # files.
113 'hard_dependency': 1,
114}