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 # json_schema_files: an array of json files that comprise the api model. | 8 # json_schema_files: an array of json files that comprise the api model. |
9 # cc_dir: path to generated files | 9 # cc_dir: path to generated files |
10 # root_namespace: the C++ namespace that all generated files go under | 10 # root_namespace: the C++ namespace that all generated files go under |
11 # Functions and namespaces can be excluded by setting "nocompile" to true. | 11 # Functions and namespaces can be excluded by setting "nocompile" to true. |
12 'api_gen_dir': '<(DEPTH)/tools/json_schema_compiler', | 12 'api_gen_dir': '<(DEPTH)/tools/json_schema_compiler', |
13 'api_gen': '<(api_gen_dir)/compiler.py', | 13 'api_gen': '<(api_gen_dir)/compiler.py', |
14 }, | 14 }, |
15 'rules': [ | 15 'rules': [ |
16 { | 16 { |
17 'rule_name': 'genapi', | 17 'rule_name': 'genapi', |
18 'extension': 'json', | 18 'extension': 'json', |
19 'inputs': [ | 19 'inputs': [ |
20 '<(api_gen_dir)/cc_generator.py', | 20 '<(api_gen_dir)/cc_generator.py', |
21 '<(api_gen_dir)/code.py', | 21 '<(api_gen_dir)/code.py', |
22 '<(api_gen_dir)/compiler.py', | 22 '<(api_gen_dir)/compiler.py', |
23 '<(api_gen_dir)/cpp_util.py', | 23 '<(api_gen_dir)/cpp_util.py', |
24 '<(api_gen_dir)/cpp_type_generator.py', | 24 '<(api_gen_dir)/cpp_type_generator.py', |
25 '<(api_gen_dir)/h_generator.py', | 25 '<(api_gen_dir)/h_generator.py', |
26 '<(api_gen_dir)/model.py', | 26 '<(api_gen_dir)/model.py', |
27 '<(api_gen_dir)/util.cc', | 27 '<(api_gen_dir)/util.cc', |
28 '<(api_gen_dir)/util.h', | 28 '<(api_gen_dir)/util.h', |
29 '<(api_gen_dir)/util_cc_helper.py', | 29 '<(api_gen_dir)/util_cc_helper.py', |
| 30 # TODO(calamity): uncomment this when gyp on windows behaves like other |
| 31 # platforms. List expansions of filepaths in inputs expand to different |
| 32 # things. |
| 33 # '<@(json_schema_files)', |
30 ], | 34 ], |
31 'outputs': [ | 35 'outputs': [ |
32 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_ROOT).cc', | 36 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_ROOT).cc', |
33 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_ROOT).h', | 37 '<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_ROOT).h', |
34 ], | 38 ], |
35 'action': [ | 39 'action': [ |
36 'python', | 40 'python', |
37 '<(api_gen)', | 41 '<(api_gen)', |
38 '<(RULE_INPUT_PATH)', | 42 '<(RULE_INPUT_PATH)', |
39 '--root=<(DEPTH)', | 43 '--root=<(DEPTH)', |
40 '--destdir=<(SHARED_INTERMEDIATE_DIR)', | 44 '--destdir=<(SHARED_INTERMEDIATE_DIR)', |
41 '--namespace=<(root_namespace)', | 45 '--namespace=<(root_namespace)', |
42 '<@(json_schema_files)', | |
43 ], | 46 ], |
44 'message': 'Generating C++ code from <(RULE_INPUT_PATH) jsons', | 47 'message': 'Generating C++ code from <(RULE_INPUT_PATH) jsons', |
45 'process_outputs_as_sources': 1, | 48 'process_outputs_as_sources': 1, |
46 }, | 49 }, |
47 ], | 50 ], |
48 'include_dirs': [ | 51 'include_dirs': [ |
49 '<(SHARED_INTERMEDIATE_DIR)', | 52 '<(SHARED_INTERMEDIATE_DIR)', |
50 '<(DEPTH)', | 53 '<(DEPTH)', |
51 ], | 54 ], |
52 'dependencies':[ | 55 'dependencies':[ |
53 '<(DEPTH)/tools/json_schema_compiler/api_gen_util.gyp:api_gen_util', | 56 '<(DEPTH)/tools/json_schema_compiler/api_gen_util.gyp:api_gen_util', |
54 ], | 57 ], |
55 'direct_dependent_settings': { | 58 'direct_dependent_settings': { |
56 'include_dirs': [ | 59 'include_dirs': [ |
57 '<(SHARED_INTERMEDIATE_DIR)', | 60 '<(SHARED_INTERMEDIATE_DIR)', |
58 ] | 61 ] |
59 }, | 62 }, |
60 # This target exports a hard dependency because it generates header | 63 # This target exports a hard dependency because it generates header |
61 # files. | 64 # files. |
62 'hard_dependency': 1, | 65 'hard_dependency': 1, |
63 } | 66 } |
OLD | NEW |