summaryrefslogtreecommitdiff
path: root/utils/codegen/ipc/mojo/public/tools/bindings/BUILD.gn
blob: eeca73ea3d56c1e1e6db5e5f6bc2bb80f29fdd7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Copyright 2016 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//mojo/public/tools/bindings/mojom.gni")
import("//third_party/jinja2/jinja2.gni")

action("precompile_templates") {
  sources = mojom_generator_sources
  sources += [
    "$mojom_generator_root/generators/cpp_templates/cpp_macros.tmpl",
    "$mojom_generator_root/generators/cpp_templates/enum_macros.tmpl",
    "$mojom_generator_root/generators/cpp_templates/enum_serialization_declaration.tmpl",
    "$mojom_generator_root/generators/cpp_templates/feature_declaration.tmpl",
    "$mojom_generator_root/generators/cpp_templates/feature_definition.tmpl",
    "$mojom_generator_root/generators/cpp_templates/interface_declaration.tmpl",
    "$mojom_generator_root/generators/cpp_templates/interface_definition.tmpl",
    "$mojom_generator_root/generators/cpp_templates/interface_feature_declaration.tmpl",
    "$mojom_generator_root/generators/cpp_templates/interface_macros.tmpl",
    "$mojom_generator_root/generators/cpp_templates/interface_proxy_declaration.tmpl",
    "$mojom_generator_root/generators/cpp_templates/interface_request_validator_declaration.tmpl",
    "$mojom_generator_root/generators/cpp_templates/interface_response_validator_declaration.tmpl",
    "$mojom_generator_root/generators/cpp_templates/interface_stub_declaration.tmpl",
    "$mojom_generator_root/generators/cpp_templates/module-features.h.tmpl",
    "$mojom_generator_root/generators/cpp_templates/module-forward.h.tmpl",
    "$mojom_generator_root/generators/cpp_templates/module-import-headers.h.tmpl",
    "$mojom_generator_root/generators/cpp_templates/module-params-data.h.tmpl",
    "$mojom_generator_root/generators/cpp_templates/module-shared-internal.h.tmpl",
    "$mojom_generator_root/generators/cpp_templates/module-shared-message-ids.h.tmpl",
    "$mojom_generator_root/generators/cpp_templates/module-shared.cc.tmpl",
    "$mojom_generator_root/generators/cpp_templates/module-shared.h.tmpl",
    "$mojom_generator_root/generators/cpp_templates/module-test-utils.h.tmpl",
    "$mojom_generator_root/generators/cpp_templates/module.cc.tmpl",
    "$mojom_generator_root/generators/cpp_templates/module.h.tmpl",
    "$mojom_generator_root/generators/cpp_templates/struct_data_view_declaration.tmpl",
    "$mojom_generator_root/generators/cpp_templates/struct_data_view_definition.tmpl",
    "$mojom_generator_root/generators/cpp_templates/struct_declaration.tmpl",
    "$mojom_generator_root/generators/cpp_templates/struct_definition.tmpl",
    "$mojom_generator_root/generators/cpp_templates/struct_macros.tmpl",
    "$mojom_generator_root/generators/cpp_templates/struct_serialization_declaration.tmpl",
    "$mojom_generator_root/generators/cpp_templates/struct_traits_declaration.tmpl",
    "$mojom_generator_root/generators/cpp_templates/struct_traits_definition.tmpl",
    "$mojom_generator_root/generators/cpp_templates/struct_unserialized_message_context.tmpl",
    "$mojom_generator_root/generators/cpp_templates/union_data_view_declaration.tmpl",
    "$mojom_generator_root/generators/cpp_templates/union_data_view_definition.tmpl",
    "$mojom_generator_root/generators/cpp_templates/union_declaration.tmpl",
    "$mojom_generator_root/generators/cpp_templates/union_definition.tmpl",
    "$mojom_generator_root/generators/cpp_templates/union_serialization_declaration.tmpl",
    "$mojom_generator_root/generators/cpp_templates/union_traits_declaration.tmpl",
    "$mojom_generator_root/generators/cpp_templates/union_traits_definition.tmpl",
    "$mojom_generator_root/generators/cpp_templates/validation_macros.tmpl",
    "$mojom_generator_root/generators/cpp_templates/wrapper_class_declaration.tmpl",
    "$mojom_generator_root/generators/cpp_templates/wrapper_class_definition.tmpl",
    "$mojom_generator_root/generators/cpp_templates/wrapper_class_template_definition.tmpl",
    "$mojom_generator_root/generators/cpp_templates/wrapper_union_class_declaration.tmpl",
    "$mojom_generator_root/generators/cpp_templates/wrapper_union_class_definition.tmpl",
    "$mojom_generator_root/generators/cpp_templates/wrapper_union_class_template_definition.tmpl",
    "$mojom_generator_root/generators/java_templates/constant_definition.tmpl",
    "$mojom_generator_root/generators/java_templates/constants.java.tmpl",
    "$mojom_generator_root/generators/java_templates/data_types_definition.tmpl",
    "$mojom_generator_root/generators/java_templates/enum.java.tmpl",
    "$mojom_generator_root/generators/java_templates/enum_definition.tmpl",
    "$mojom_generator_root/generators/java_templates/header.java.tmpl",
    "$mojom_generator_root/generators/java_templates/interface.java.tmpl",
    "$mojom_generator_root/generators/java_templates/interface_definition.tmpl",
    "$mojom_generator_root/generators/java_templates/interface_internal.java.tmpl",
    "$mojom_generator_root/generators/java_templates/struct.java.tmpl",
    "$mojom_generator_root/generators/java_templates/union.java.tmpl",
    "$mojom_generator_root/generators/js_templates/enum_definition.tmpl",
    "$mojom_generator_root/generators/js_templates/fuzzing.tmpl",
    "$mojom_generator_root/generators/js_templates/interface_definition.tmpl",
    "$mojom_generator_root/generators/js_templates/lite/enum_definition.tmpl",
    "$mojom_generator_root/generators/js_templates/lite/enum_definition_for_module.tmpl",
    "$mojom_generator_root/generators/js_templates/lite/interface_definition.tmpl",
    "$mojom_generator_root/generators/js_templates/lite/interface_definition_for_module.tmpl",
    "$mojom_generator_root/generators/js_templates/lite/module_definition.tmpl",
    "$mojom_generator_root/generators/js_templates/lite/mojom-lite.js.tmpl",
    "$mojom_generator_root/generators/js_templates/lite/mojom.m.js.tmpl",
    "$mojom_generator_root/generators/js_templates/lite/struct_definition.tmpl",
    "$mojom_generator_root/generators/js_templates/lite/struct_definition_for_module.tmpl",
    "$mojom_generator_root/generators/js_templates/lite/union_definition.tmpl",
    "$mojom_generator_root/generators/js_templates/lite/union_definition_for_module.tmpl",
    "$mojom_generator_root/generators/js_templates/module.amd.tmpl",
    "$mojom_generator_root/generators/js_templates/module_definition.tmpl",
    "$mojom_generator_root/generators/js_templates/struct_definition.tmpl",
    "$mojom_generator_root/generators/js_templates/union_definition.tmpl",
    "$mojom_generator_root/generators/js_templates/validation_macros.tmpl",
    "$mojom_generator_root/generators/mojolpm_templates/mojolpm.cc.tmpl",
    "$mojom_generator_root/generators/mojolpm_templates/mojolpm.h.tmpl",
    "$mojom_generator_root/generators/mojolpm_templates/mojolpm.proto.tmpl",
    "$mojom_generator_root/generators/mojolpm_templates/mojolpm_from_proto_macros.tmpl",
    "$mojom_generator_root/generators/mojolpm_templates/mojolpm_macros.tmpl",
    "$mojom_generator_root/generators/mojolpm_templates/mojolpm_to_proto_macros.tmpl",
    "$mojom_generator_root/generators/mojolpm_templates/mojolpm_traits_specialization_macros.tmpl",
    "$mojom_generator_root/generators/ts_templates/enum_definition.tmpl",
    "$mojom_generator_root/generators/ts_templates/interface_definition.tmpl",
    "$mojom_generator_root/generators/ts_templates/module_definition.tmpl",
    "$mojom_generator_root/generators/ts_templates/struct_definition.tmpl",
    "$mojom_generator_root/generators/ts_templates/union_definition.tmpl",
  ]
  script = mojom_generator_script

  inputs = jinja2_sources
  outputs = [
    "$target_gen_dir/cpp_templates.zip",
    "$target_gen_dir/java_templates.zip",
    "$target_gen_dir/js_templates.zip",
    "$target_gen_dir/mojolpm_templates.zip",
    "$target_gen_dir/ts_templates.zip",
  ]
  args = [
    "-o",
    rebase_path(target_gen_dir, root_build_dir),
    "--use_bundled_pylibs",
    "precompile",
  ]
}

group("tests") {
  data = [
    mojom_generator_script,
    "checks/mojom_attributes_check_unittest.py",
    "checks/mojom_interface_feature_check_unittest.py",
    "checks/mojom_restrictions_checks_unittest.py",
    "mojom_bindings_generator_unittest.py",
    "//tools/diagnosis/crbug_1001171.py",
    "//third_party/markupsafe/",
  ]
  data += mojom_generator_sources
  data += jinja2_sources
}