chromium/third_party/blink/public/devtools_protocol/BUILD.gn

import("//third_party/inspector_protocol/inspector_protocol.gni")
import("//v8/gni/v8.gni")

_inspector_protocol_dir = "//third_party/inspector_protocol"
_protocol_out_dir = "$root_gen_dir/third_party/blink/public/devtools_protocol"

action("protocol_compatibility_check") {
  script = _inspector_protocol_dir + "/check_protocol_compatibility.py"

  inputs = [
    "browser_protocol.pdl",
    "browser_protocol-1.3.json",
    v8_inspector_js_protocol,
  ]
  _stamp = "$_protocol_out_dir/browser_protocol.stamp"
  outputs = [ _stamp ]

  args = [
    "--stamp",
    rebase_path(_stamp, root_build_dir),
    rebase_path("browser_protocol.pdl", root_build_dir),
    rebase_path(v8_inspector_js_protocol, root_build_dir),
  ]
}

action("protocol_version") {
  deps = [ ":protocol_compatibility_check" ]
  script = _inspector_protocol_dir + "/concatenate_protocols.py"

  inputs = [
    "browser_protocol.pdl",
    v8_inspector_js_protocol,
  ]
  output_file = "$_protocol_out_dir/protocol.json"
  outputs = [ output_file ]

  args = [
    rebase_path("browser_protocol.pdl", root_build_dir),
    rebase_path(v8_inspector_js_protocol, root_build_dir),
    rebase_path(output_file, root_build_dir),
  ]
}