1# Copyright 2014 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
5import("//third_party/inspector_protocol/inspector_protocol.gni")
6import("//third_party/protobuf/proto_library.gni")
7import("//tools/grit/grit_rule.gni")
8
9# Android and Fuchsia do not support DevTools front-end.
10if (!is_android && !is_fuchsia) {
11  grit("devtools_resources") {
12    source = "$root_gen_dir/devtools/devtools_resources.grd"
13
14    # Required because the .grd is generated.
15    enable_input_discovery_for_gn_analyze = false
16    use_brotli = true
17
18    outputs = [
19      "grit/devtools_resources.h",
20      "devtools_resources.pak",
21      "grit/devtools_resources_map.cc",
22      "grit/devtools_resources_map.h",
23    ]
24
25    grit_flags = [
26      "-E",
27      "protocol_file=" + rebase_path(
28              "$root_gen_dir/third_party/blink/public/devtools_protocol/protocol.json",
29              root_build_dir),
30    ]
31
32    deps = [
33      "//third_party/blink/public/devtools_protocol:protocol_version",
34
35      # This is the action that generates out .grd input file.
36      "//third_party/blink/public:blink_generate_devtools_grd",
37    ]
38  }
39}
40
41inspector_protocol_generate("protocol_sources") {
42  visibility = [ "//content/browser" ]
43  deps = [ "//third_party/blink/public/devtools_protocol:protocol_version" ]
44  _blink_protocol_path = rebase_path(
45          "$root_gen_dir/third_party/blink/public/devtools_protocol/protocol.json",
46          root_build_dir)
47
48  inspector_protocol_dir = "//third_party/inspector_protocol"
49  out_dir = target_gen_dir
50  config_file = "protocol_config.json"
51  config_values = [ "protocol.path=$_blink_protocol_path" ]
52
53  inputs = [
54    "$root_gen_dir/third_party/blink/public/devtools_protocol/protocol.json",
55    config_file,
56  ]
57
58  # These are relative to $target_gen_dir.
59  outputs = [
60    "protocol/audits.cc",
61    "protocol/audits.h",
62    "protocol/background_service.cc",
63    "protocol/background_service.h",
64    "protocol/base_string_adapter.cc",
65    "protocol/base_string_adapter.h",
66    "protocol/browser.cc",
67    "protocol/browser.h",
68    "protocol/dom.cc",
69    "protocol/dom.h",
70    "protocol/emulation.cc",
71    "protocol/emulation.h",
72    "protocol/fetch.cc",
73    "protocol/fetch.h",
74    "protocol/forward.h",
75    "protocol/input.cc",
76    "protocol/input.h",
77    "protocol/inspector.cc",
78    "protocol/inspector.h",
79    "protocol/io.cc",
80    "protocol/io.h",
81    "protocol/log.cc",
82    "protocol/log.h",
83    "protocol/memory.cc",
84    "protocol/memory.h",
85    "protocol/network.cc",
86    "protocol/network.h",
87    "protocol/overlay.cc",
88    "protocol/overlay.h",
89    "protocol/page.cc",
90    "protocol/page.h",
91    "protocol/protocol.cc",
92    "protocol/protocol.h",
93    "protocol/runtime.cc",
94    "protocol/runtime.h",
95    "protocol/schema.cc",
96    "protocol/schema.h",
97    "protocol/security.cc",
98    "protocol/security.h",
99    "protocol/service_worker.cc",
100    "protocol/service_worker.h",
101    "protocol/storage.cc",
102    "protocol/storage.h",
103    "protocol/system_info.cc",
104    "protocol/system_info.h",
105    "protocol/target.cc",
106    "protocol/target.h",
107    "protocol/tethering.cc",
108    "protocol/tethering.h",
109    "protocol/tracing.cc",
110    "protocol/tracing.h",
111    "protocol/web_authn.cc",
112    "protocol/web_authn.h",
113  ]
114}
115
116proto_library("devtools_background_services_proto") {
117  sources = [ "devtools_background_services.proto" ]
118}
119