Skip to content

Commit

Permalink
Remove all uses of the redundant flutter_root variable. (flutter#16311)
Browse files Browse the repository at this point in the history
This was only necessary when the Engine had to build in multiple buildroots
where the sources where checked out at different paths relative to the
buildroot. This is no longer the case and there are already cases GN rules
have been written that mix and match variable usage with the direct
specification of the path to the Flutter sources relative to the sole buildroot.
  • Loading branch information
chinmaygarde committed Feb 1, 2020
1 parent 65dbb9c commit f7b78e0
Show file tree
Hide file tree
Showing 63 changed files with 496 additions and 510 deletions.
66 changes: 33 additions & 33 deletions BUILD.gn
Expand Up @@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("$flutter_root/common/config.gni")
import("//flutter/common/config.gni")

if (is_fuchsia) {
import("//build/fuchsia/sdk.gni")
Expand All @@ -21,41 +21,41 @@ group("flutter") {

if (!(is_fuchsia && using_fuchsia_sdk)) {
public_deps += [
"$flutter_root/lib/snapshot:generate_snapshot_bin",
"$flutter_root/lib/snapshot:kernel_platform_files",
"//flutter/lib/snapshot:generate_snapshot_bin",
"//flutter/lib/snapshot:kernel_platform_files",
]
}

public_deps += [
"$flutter_root/shell/platform/embedder:flutter_engine",
"$flutter_root/sky",
"//flutter/shell/platform/embedder:flutter_engine",
"//flutter/sky",
]

if (current_toolchain == host_toolchain) {
public_deps += [ "$flutter_root/tools/font-subset" ]
public_deps += [ "//flutter/tools/font-subset" ]
}

if (current_toolchain == host_toolchain) {
public_deps += [ "$flutter_root/shell/testing" ]
public_deps += [ "//flutter/shell/testing" ]
public_deps += [ "//flutter/tools/const_finder" ]
}

if (is_fuchsia && using_fuchsia_sdk) {
public_deps += [
"$flutter_root/shell/platform/fuchsia",
"$flutter_root/shell/testing($host_toolchain)",
"//flutter/shell/platform/fuchsia",
"//flutter/shell/testing($host_toolchain)",
]
}

if (!is_fuchsia && !is_fuchsia_host) {
if (current_toolchain == host_toolchain) {
public_deps += [
"$flutter_root/flutter_frontend_server:frontend_server",
"//flutter/flutter_frontend_server:frontend_server",
"//third_party/dart:create_sdk",
]

if (full_dart_sdk) {
public_deps += [ "$flutter_root/web_sdk" ]
public_deps += [ "//flutter/web_sdk" ]
}
}
}
Expand All @@ -64,36 +64,36 @@ group("flutter") {
if (current_toolchain == host_toolchain) {
if (is_mac) {
public_deps += [
"$flutter_root/shell/platform/darwin:flutter_channels_unittests",
"$flutter_root/shell/platform/darwin/macos:flutter_desktop_darwin_unittests",
"//flutter/shell/platform/darwin:flutter_channels_unittests",
"//flutter/shell/platform/darwin/macos:flutter_desktop_darwin_unittests",
]
}

public_deps += [
"$flutter_root/flow:flow_unittests",
"$flutter_root/fml:fml_unittests",
"$flutter_root/lib/ui:ui_unittests",
"$flutter_root/runtime:runtime_unittests",
"$flutter_root/shell/common:shell_unittests",
"$flutter_root/shell/platform/common/cpp/client_wrapper:client_wrapper_unittests",
"$flutter_root/shell/platform/embedder:embedder_unittests",
"$flutter_root/shell/platform/glfw/client_wrapper:client_wrapper_glfw_unittests",
"$flutter_root/testing:testing_unittests",
"$flutter_root/third_party/txt:txt_unittests",
"//flutter/flow:flow_unittests",
"//flutter/fml:fml_unittests",
"//flutter/lib/ui:ui_unittests",
"//flutter/runtime:runtime_unittests",
"//flutter/shell/common:shell_unittests",
"//flutter/shell/platform/common/cpp/client_wrapper:client_wrapper_unittests",
"//flutter/shell/platform/embedder:embedder_unittests",
"//flutter/shell/platform/glfw/client_wrapper:client_wrapper_glfw_unittests",
"//flutter/testing:testing_unittests",
"//flutter/third_party/txt:txt_unittests",
]

if (is_win) {
public_deps += [
"$flutter_root/shell/platform/windows:flutter_windows_unittests",
"$flutter_root/shell/platform/windows/client_wrapper:client_wrapper_windows_unittests",
"//flutter/shell/platform/windows:flutter_windows_unittests",
"//flutter/shell/platform/windows/client_wrapper:client_wrapper_windows_unittests",
]
}

if (!is_win) {
public_deps += [
"$flutter_root/fml:fml_benchmarks",
"$flutter_root/shell/common:shell_benchmarks",
"$flutter_root/third_party/txt:txt_benchmarks",
"//flutter/fml:fml_benchmarks",
"//flutter/shell/common:shell_benchmarks",
"//flutter/third_party/txt:txt_benchmarks",
]
}
}
Expand All @@ -111,7 +111,7 @@ config("config") {
config("export_dynamic_symbols") {
if (is_linux || is_fuchsia) {
inputs = [
"$flutter_root/common/exported_symbols.sym",
"//flutter/common/exported_symbols.sym",
]
ldflags = [ "-Wl,--dynamic-list=" + rebase_path(inputs[0], root_build_dir) ]
}
Expand All @@ -121,7 +121,7 @@ group("dist") {
testonly = true

deps = [
"$flutter_root/sky/dist",
"//flutter/sky/dist",
]
}

Expand All @@ -133,9 +133,9 @@ if (is_fuchsia) {
testonly = true

deps = [
"$flutter_root/flow:flow_tests",
"$flutter_root/fml:fml_tests",
"$flutter_root/shell/platform/fuchsia/flutter:flutter_runner_tests",
"//flutter/flow:flow_tests",
"//flutter/fml:fml_tests",
"//flutter/shell/platform/fuchsia/flutter:flutter_runner_tests",
]
}
}
6 changes: 3 additions & 3 deletions assets/BUILD.gn
Expand Up @@ -12,9 +12,9 @@ source_set("assets") {
]

deps = [
"$flutter_root/common",
"$flutter_root/fml",
"//flutter/common",
"//flutter/fml",
]

public_configs = [ "$flutter_root:config" ]
public_configs = [ "//flutter:config" ]
}
4 changes: 2 additions & 2 deletions benchmarking/BUILD.gn
Expand Up @@ -15,12 +15,12 @@ source_set("benchmarking") {
]

public_deps = [
"$flutter_root/fml",
"//flutter/fml",
"//third_party/benchmark",
]

public_configs = [
"$flutter_root:config",
"//flutter:config",
":benchmark_config",
]
}
10 changes: 3 additions & 7 deletions build/dart/rules.gni
Expand Up @@ -44,8 +44,7 @@ template("dart_pkg_helper") {
sdk_ext_mappings += invoker.sdk_ext_mappings
}

script =
rebase_path("$flutter_root/build/dart/tools/dart_pkg.py", ".", "//")
script = rebase_path("//flutter/build/dart/tools/dart_pkg.py", ".", "//")

entrypoints = []
if (defined(invoker.apps)) {
Expand All @@ -62,8 +61,7 @@ template("dart_pkg_helper") {
if (defined(invoker.sources)) {
sources += invoker.sources
} else if (defined(invoker.pkg_dir)) {
list_script =
rebase_path("$flutter_root/build/dart/tools/ls.py", ".", "//")
list_script = rebase_path("//flutter/build/dart/tools/ls.py", ".", "//")
extra_flags += [ "--read_only" ]
ls_sources = exec_script(list_script,
[
Expand Down Expand Up @@ -115,9 +113,7 @@ template("dart_pkg") {
pubspec_yaml_path = rebase_path("pubspec.yaml")
}
dart_package_name_script =
rebase_path("$flutter_root/build/dart/tools/dart_package_name.py",
".",
"//")
rebase_path("//flutter/build/dart/tools/dart_package_name.py", ".", "//")
dart_package_name = exec_script(dart_package_name_script,
[
"--pubspec",
Expand Down
4 changes: 2 additions & 2 deletions common/BUILD.gn
Expand Up @@ -17,11 +17,11 @@ source_set("common") {
]

deps = [
"$flutter_root/fml",
"//flutter/fml",
]

public_configs = [
":flutter_config",
"$flutter_root:config",
"//flutter:config",
]
}
26 changes: 13 additions & 13 deletions flow/BUILD.gn
Expand Up @@ -4,9 +4,9 @@

if (is_fuchsia) {
import("//build/fuchsia/sdk.gni")
import("$flutter_root/tools/fuchsia/fuchsia_archive.gni")
import("//flutter/tools/fuchsia/fuchsia_archive.gni")
}
import("$flutter_root/testing/testing.gni")
import("//flutter/testing/testing.gni")

source_set("flow") {
sources = [
Expand Down Expand Up @@ -64,13 +64,13 @@ source_set("flow") {
"texture.h",
]

public_configs = [ "$flutter_root:config" ]
public_configs = [ "//flutter:config" ]

public_deps = []

deps = [
"$flutter_root/common",
"$flutter_root/fml",
"//flutter/common",
"//flutter/fml",
"//third_party/skia",
]

Expand Down Expand Up @@ -119,7 +119,7 @@ source_set("flow_testing") {

public_deps = [
":flow",
"$flutter_root/testing:skia",
"//flutter/testing:skia",
"//third_party/googletest:gtest",
]
}
Expand Down Expand Up @@ -160,9 +160,9 @@ executable("flow_unittests") {
":flow",
":flow_fixtures",
":flow_testing",
"$flutter_root/fml",
"$flutter_root/testing:skia",
"$flutter_root/testing:testing_lib",
"//flutter/fml",
"//flutter/testing:skia",
"//flutter/testing:testing_lib",
"//third_party/dart/runtime:libdart_jit", # for tracing
"//third_party/googletest:gtest",
"//third_party/skia",
Expand All @@ -181,23 +181,23 @@ if (is_fuchsia) {

libraries = common_libs

meta_dir = "$flutter_root/testing/fuchsia/meta"
meta_dir = "//flutter/testing/fuchsia/meta"
cmx_file = "$meta_dir/fuchsia_test.cmx"

resources = [
{
path = rebase_path(
"$flutter_root/testing/resources/performance_overlay_gold_60fps.png")
"//flutter/testing/resources/performance_overlay_gold_60fps.png")
dest = "flutter/testing/resources/performance_overlay_gold_60fps.png"
},
{
path = rebase_path(
"$flutter_root/testing/resources/performance_overlay_gold_90fps.png")
"//flutter/testing/resources/performance_overlay_gold_90fps.png")
dest = "flutter/testing/resources/performance_overlay_gold_90fps.png"
},
{
path = rebase_path(
"$flutter_root/testing/resources/performance_overlay_gold_120fps.png")
"//flutter/testing/resources/performance_overlay_gold_120fps.png")
dest = "flutter/testing/resources/performance_overlay_gold_120fps.png"
},
]
Expand Down
6 changes: 3 additions & 3 deletions flutter_frontend_server/BUILD.gn
Expand Up @@ -68,7 +68,7 @@ application_snapshot("frontend_server") {
main_dart = "bin/starter.dart"
deps = [
":package_incremental_compiler",
"$flutter_root/lib/snapshot:kernel_platform_files",
"//flutter/lib/snapshot:kernel_platform_files",
]
dot_packages = rebase_path(".packages")
flutter_patched_sdk = rebase_path("$root_out_dir/flutter_patched_sdk")
Expand All @@ -84,7 +84,7 @@ application_snapshot("frontend_server") {
# For flutter/flutter#36738 we make the source files available so that
# we can generate a local frontend_server snapshot in the tools cache.
action("package_incremental_compiler") {
script = "$flutter_root/flutter_frontend_server/package_incremental.py"
script = "//flutter/flutter_frontend_server/package_incremental.py"

inputs = frontend_server_files

Expand All @@ -101,6 +101,6 @@ action("package_incremental_compiler") {
args = [
"--input-root=" + rebase_path("//third_party/dart/pkg"),
"--output-root=" + rebase_path("$root_gen_dir/dart-pkg"),
"--frontend-server=" + rebase_path("$flutter_root"),
"--frontend-server=" + rebase_path("//flutter"),
]
}
22 changes: 11 additions & 11 deletions fml/BUILD.gn
Expand Up @@ -4,9 +4,9 @@

if (is_fuchsia) {
import("//build/fuchsia/sdk.gni")
import("$flutter_root/tools/fuchsia/fuchsia_archive.gni")
import("//flutter/tools/fuchsia/fuchsia_archive.gni")
}
import("$flutter_root/testing/testing.gni")
import("//flutter/testing/testing.gni")

source_set("fml") {
sources = [
Expand Down Expand Up @@ -96,8 +96,8 @@ source_set("fml") {
configs += [ "//third_party/icu:icu_config" ]

public_configs = [
"$flutter_root:config",
"$flutter_root/common:flutter_config",
"//flutter:config",
"//flutter/common:flutter_config",
]

libs = []
Expand Down Expand Up @@ -249,10 +249,10 @@ executable("fml_unittests") {

deps = [
":fml_fixtures",
"$flutter_root/fml",
"$flutter_root/fml/dart",
"$flutter_root/runtime:libdart",
"$flutter_root/testing",
"//flutter/fml",
"//flutter/fml/dart",
"//flutter/runtime:libdart",
"//flutter/testing",
]

if (is_fuchsia && using_fuchsia_sdk) {
Expand All @@ -278,8 +278,8 @@ executable("fml_benchmarks") {
]

deps = [
"$flutter_root/benchmarking",
"$flutter_root/fml",
"$flutter_root/runtime:libdart",
"//flutter/benchmarking",
"//flutter/fml",
"//flutter/runtime:libdart",
]
}
6 changes: 3 additions & 3 deletions fml/dart/BUILD.gn
Expand Up @@ -12,8 +12,8 @@ source_set("dart") {
]

public_deps = [
"$flutter_root/fml",
"$flutter_root/runtime:libdart",
"$flutter_root/third_party/tonic",
"//flutter/fml",
"//flutter/runtime:libdart",
"//flutter/third_party/tonic",
]
}

0 comments on commit f7b78e0

Please sign in to comment.