Skip to content

Commit

Permalink
Reland "Integrate DevTools with Chrome branded builds"
Browse files Browse the repository at this point in the history
This is a reland of 959daef

Original change's description:
> Integrate DevTools with Chrome branded builds
>
> Bug: chromium:1220020
> Change-Id: I45ab238b68fdb3f6cc65481fffbc84938ef4b701
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3062838
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@google.com>
> Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#916361}

Cq-Include-Trybots: luci.chrome.try:linux-chromeos-chrome;luci.chromium.try:fuchsia-official
Bug: chromium:1220020, chromium:1244616, chromium:1244564
Change-Id: Id506aaa1e92b8738fdf88b0664cc3253f8495c33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3132460
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/main@{#918034}
  • Loading branch information
OrKoN authored and Chromium LUCI CQ committed Sep 3, 2021
1 parent e71c89c commit 5e0e1bc
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gn
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ default_args = {
angle_vulkan_tools_dir = "//third_party/vulkan-deps/vulkan-tools/src"
angle_vulkan_validation_layers_dir =
"//third_party/vulkan-deps/vulkan-validation-layers/src"

devtools_visibility = [ "*" ]
}

# These are the targets to skip header checking by default. The files in targets
Expand Down
23 changes: 21 additions & 2 deletions build/config/devtools.gni
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,36 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/chrome_build.gni")
import("//build_overrides/build.gni")

declare_args() {
if (build_with_chromium) {
# This argument is used in DevTools to resolve to the correct location
# devtools_location is used in DevTools to resolve to the correct location
# for any script/file referenced in the DevTools build scripts. Since
# DevTools supports both a standalone build and build integration with
# Chromium, we need to differentiate between the two versions.
devtools_location = "third_party/devtools-frontend/src/"
# devtools_location points to the Chromium version in both Chrome-branded
# and not Chrome-branded builds. devtools_root_location points to the root
# of the Chrome-branded version when is_chrome_branded is true and to the root
# of the Chromium version when is_chrome_branded is false.
# devtools_grd_location is the location of the GRD file listing all DevTools
# resources.
if (is_chrome_branded) {
devtools_root_location = "third_party/devtools-frontend-internal"
devtools_location = "$devtools_root_location/devtools-frontend/"
devtools_grd_location =
"$devtools_root_location/chrome_devtools_resources.grd"
} else {
devtools_root_location = "third_party/devtools-frontend/src"
devtools_location = "third_party/devtools-frontend/src/"
devtools_grd_location =
"$devtools_root_location/front_end/devtools_resources.grd"
}
} else {
# DevTools is building a standalone version
devtools_location = ""
devtools_root_location = ""
devtools_grd_location = ""
}
}
3 changes: 2 additions & 1 deletion content/browser/devtools/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/devtools.gni")
import("//components/viz/common/debugger/viz_debugger.gni")
import("//third_party/inspector_protocol/inspector_protocol.gni")
import("//third_party/protobuf/proto_library.gni")
Expand All @@ -10,7 +11,7 @@ import("//tools/grit/grit_rule.gni")
# Android does not support DevTools front-end.
if (!is_android) {
grit("devtools_resources") {
source = "$root_gen_dir/third_party/devtools-frontend/src/front_end/devtools_resources.grd"
source = "$root_gen_dir/$devtools_grd_location"

# Required because the .grd is generated.
enable_input_discovery_for_gn_analyze = false
Expand Down
14 changes: 11 additions & 3 deletions third_party/blink/public/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import("//build/buildflag_header.gni")
import("//build/config/dcheck_always_on.gni")
import("//build/config/devtools.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//third_party/blink/public/public_features.gni")
import("//third_party/blink/renderer/config.gni")
Expand Down Expand Up @@ -473,7 +474,7 @@ source_set("blink_headers") {
]
}

devtools_frontend_path = "//third_party/devtools-frontend/src"
devtools_frontend_path = "//$devtools_root_location"

group("blink_devtools_frontend_resources") {
public_deps = [ "$devtools_frontend_path:devtools_frontend_resources" ]
Expand Down Expand Up @@ -514,8 +515,15 @@ grit("devtools_inspector_resources") {
"inspector_overlay_resources.pak",
]

defines =
[ "SHARED_INTERMEDIATE_DIR=" + rebase_path(root_out_dir, root_build_dir) ]
_shared_intermediate_dir = rebase_path(root_out_dir, root_build_dir)
_devtools_grd_path = "$shared_intermediate_dir/$devtools_grd_location"
_devtools_grd_path_no_ext = get_path_info(_devtools_grd_path, "dir") + "/" +
get_path_info(_devtools_grd_path, "name")

defines = [
"SHARED_INTERMEDIATE_DIR=" + _shared_intermediate_dir,
"DEVTOOLS_GRD_PATH=" + _devtools_grd_path_no_ext,
]

deps = [
"$devtools_frontend_path:generate_devtools_inspector_overlay_resources",
Expand Down
10 changes: 9 additions & 1 deletion tools/grit/grit_defines.gni
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,23 @@
import("//build/config/chrome_build.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/crypto.gni")
import("//build/config/devtools.gni")
import("//build/config/ui.gni")

shared_intermediate_dir = rebase_path(root_gen_dir, root_build_dir)
devtools_grd_path = "$shared_intermediate_dir/$devtools_grd_location"
devtools_grd_path_no_ext = get_path_info(devtools_grd_path, "dir") + "/" +
get_path_info(devtools_grd_path, "name")

grit_defines = [
"-E",
"root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir),
"-E",
"root_src_dir=" + rebase_path("//", root_build_dir),
"-D",
"SHARED_INTERMEDIATE_DIR=" + rebase_path(root_gen_dir, root_build_dir),
"SHARED_INTERMEDIATE_DIR=" + shared_intermediate_dir,
"-D",
"DEVTOOLS_GRD_PATH=" + devtools_grd_path_no_ext,
]

if (is_mac || is_win || is_linux || is_chromeos || is_ios) {
Expand Down
3 changes: 2 additions & 1 deletion tools/gritsettings/resource_ids.spec
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,8 @@
},

# This file is generated during the build.
"<(SHARED_INTERMEDIATE_DIR)/third_party/devtools-frontend/src/front_end/devtools_resources.grd": {
# .grd extension is required because it's checked before var interpolation.
"<(DEVTOOLS_GRD_PATH).grd": {
# In debug build, devtools frontend sources are not bundled and therefore
# includes a lot of individual resources
"META": {"sizes": {"includes": [2000],}},
Expand Down

0 comments on commit 5e0e1bc

Please sign in to comment.