OLD | NEW |
| (Empty) |
1 # Copyright 2016 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 # This template will generate inspector protocol source code. The code will | |
6 # not be compiled, use get_target_outputs(<name>) to compile them. | |
7 # | |
8 # Inputs | |
9 # | |
10 # config_file (required) | |
11 # Path to json file specifying inspector protocol configuration. | |
12 # | |
13 # out_dir (required) | |
14 # Path to put the generated files in. It must be inside output or | |
15 # generated file directory. | |
16 # | |
17 # outputs (required) | |
18 # Files generated. Relative to out_dir. | |
19 # | |
20 # inputs (optional) | |
21 # Extra inputs specified by the config file. | |
22 template("inspector_protocol_generate") { | |
23 assert(defined(invoker.config_file)) | |
24 assert(defined(invoker.out_dir)) | |
25 assert(defined(invoker.outputs)) | |
26 | |
27 inspector_protocol_dir = | |
28 "//third_party/WebKit/Source/platform/inspector_protocol" | |
29 | |
30 action(target_name) { | |
31 script = "$inspector_protocol_dir/CodeGenerator.py" | |
32 | |
33 inputs = [ | |
34 invoker.config_file, | |
35 "$inspector_protocol_dir/lib/Allocator_h.template", | |
36 "$inspector_protocol_dir/lib/Array_h.template", | |
37 "$inspector_protocol_dir/lib/BackendCallback_h.template", | |
38 "$inspector_protocol_dir/lib/Collections_h.template", | |
39 "$inspector_protocol_dir/lib/DispatcherBase_cpp.template", | |
40 "$inspector_protocol_dir/lib/DispatcherBase_h.template", | |
41 "$inspector_protocol_dir/lib/ErrorSupport_cpp.template", | |
42 "$inspector_protocol_dir/lib/ErrorSupport_h.template", | |
43 "$inspector_protocol_dir/lib/Forward_h.template", | |
44 "$inspector_protocol_dir/lib/FrontendChannel_h.template", | |
45 "$inspector_protocol_dir/lib/Maybe_h.template", | |
46 "$inspector_protocol_dir/lib/Object_cpp.template", | |
47 "$inspector_protocol_dir/lib/Object_h.template", | |
48 "$inspector_protocol_dir/lib/Parser_cpp.template", | |
49 "$inspector_protocol_dir/lib/Parser_h.template", | |
50 "$inspector_protocol_dir/lib/Protocol_cpp.template", | |
51 "$inspector_protocol_dir/lib/ValueConversions_h.template", | |
52 "$inspector_protocol_dir/lib/Values_cpp.template", | |
53 "$inspector_protocol_dir/lib/Values_h.template", | |
54 "$inspector_protocol_dir/templates/Exported_h.template", | |
55 "$inspector_protocol_dir/templates/Imported_h.template", | |
56 "$inspector_protocol_dir/templates/TypeBuilder_cpp.template", | |
57 "$inspector_protocol_dir/templates/TypeBuilder_h.template", | |
58 ] | |
59 if (defined(invoker.inputs)) { | |
60 inputs += invoker.inputs | |
61 } | |
62 | |
63 args = [ | |
64 "--jinja_dir", | |
65 rebase_path("//third_party/", root_build_dir), # jinja is in chromium's t
hird_party | |
66 "--output_base", | |
67 rebase_path(invoker.out_dir, root_build_dir), | |
68 "--config", | |
69 rebase_path(invoker.config_file, root_build_dir), | |
70 ] | |
71 | |
72 outputs = get_path_info(rebase_path(invoker.outputs, ".", invoker.out_dir), | |
73 "abspath") | |
74 | |
75 forward_variables_from(invoker, | |
76 [ | |
77 "visibility", | |
78 "deps", | |
79 "public_deps", | |
80 ]) | |
81 } | |
82 } | |
OLD | NEW |