From 4024fe154aa437c32789b1b83ef65315d5087cf9 Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Thu, 1 Sep 2016 13:35:44 -0700 Subject: [PATCH] GN: Relativize occurrances of //dart The Dart root in the Dart tree is at //, not //dart. But in the Dart tree we can refer to the root with a relative path. R=asiva@google.com Review URL: https://codereview.chromium.org/2301833003 . --- runtime/bin/BUILD.gn | 2 +- runtime/observatory/BUILD.gn | 16 ++++++++-------- sdk/lib/rules.gni | 6 ++++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/runtime/bin/BUILD.gn b/runtime/bin/BUILD.gn index f101b364b4c..50db7e92c2b 100644 --- a/runtime/bin/BUILD.gn +++ b/runtime/bin/BUILD.gn @@ -31,7 +31,7 @@ action("gen_resources_cc") { # the Dart runtime to gn, this path might need to be updated. sources = rebase_path(resources_sources_gypi.sources, "", - "//dart/runtime/bin/vmservice/") + "../bin/vmservice/") outputs = [ "$target_gen_dir/resources_gen.cc" ] args = [ "--output", diff --git a/runtime/observatory/BUILD.gn b/runtime/observatory/BUILD.gn index 98cfe319f5e..c0903ea4972 100644 --- a/runtime/observatory/BUILD.gn +++ b/runtime/observatory/BUILD.gn @@ -17,9 +17,9 @@ declare_args() { observatory_sources_gypi = exec_script("../../tools/gypi_to_gn.py", [ rebase_path( - "//dart/runtime/observatory/observatory_sources.gypi") ], + "../observatory/observatory_sources.gypi") ], "scope", - [ "//dart/runtime/observatory/observatory_sources.gypi" ]) + [ "../observatory/observatory_sources.gypi" ]) copy("copy_observatory") { sources = rebase_path(observatory_sources_gypi.sources, @@ -49,11 +49,11 @@ action("write_observatory_pubspec_yaml") { rebase_path("$root_gen_dir/observatory_copy/dart/runtime/observatory/"), "--command", "rewrite", - rebase_path("//dart/runtime/observatory/pubspec.yaml"), + rebase_path("../observatory/pubspec.yaml"), rebase_path( "$root_gen_dir/observatory_copy/dart/runtime/observatory/pubspec.yaml"), "../../third_party/", - rebase_path("../../../dart/third_party/"), + rebase_path("../../third_party/"), ] outputs = [ @@ -66,7 +66,7 @@ action("copy_observatory_deps") { ":write_observatory_pubspec_yaml", ] - script = "//dart/tools/observatory_tool.py" + script = "../../tools/observatory_tool.py" inputs = [ script, @@ -101,7 +101,7 @@ action("pub_build_observatory") { ":copy_observatory_deps", ] - script = "//dart/tools/observatory_tool.py" + script = "../../tools/observatory_tool.py" inputs = [ script, @@ -130,7 +130,7 @@ action("deploy_observatory") { ":pub_build_observatory", ] - script = "//dart/tools/observatory_tool.py" + script = "../../tools/observatory_tool.py" inputs = [ script, @@ -157,7 +157,7 @@ action("archive_observatory") { ":deploy_observatory", ] - script = "//dart/runtime/tools/create_archive.py" + script = "../tools/create_archive.py" inputs = [ script, diff --git a/sdk/lib/rules.gni b/sdk/lib/rules.gni index 0aa80f87006..27779ea97ff 100644 --- a/sdk/lib/rules.gni +++ b/sdk/lib/rules.gni @@ -2,6 +2,8 @@ # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. +default_dart_root = rebase_path("../..") + # This build rule will copy the source for one Dart SDK library. # # Required arguments: @@ -13,7 +15,7 @@ # Base path to copy sources. Default value is "$root_gen_dir/dart_sdk". # # dart_root -# Path to the Dart SDK source root. Default value is "//dart". +# Path to the Dart SDK source root. Default value is "../..". # # The sources will be copied into $root_gen_dir/dart_sdk/$sdk_lib_name/. # @@ -22,7 +24,7 @@ template("dart_sdk_lib_copy") { if (defined(invoker.dart_root)) { dart_root = rebase_path(invoker.dart_root) } else { - dart_root = rebase_path("//dart") + dart_root = default_dart_root } if (defined(invoker.destination)) { destination = invoker.destination