From f4b9ff40b8f1612571cc711560177af240d034d0 Mon Sep 17 00:00:00 2001 From: dannark Date: Tue, 12 Jun 2018 09:28:45 -0700 Subject: Remap repository names inside load statements in BUILD files if the repository name is remapped. For example if main/WORKSPACE contains: local_repository( name = "a", path = "../a", repo_mapping = {"@x" : "@y"}, ) a/BUILD load("@x//:sample.bzl", "sample") Then the load in a/BUILD will be resolved as "@y//:sample.bzl" RELNOTES: None PiperOrigin-RevId: 200227431 --- src/test/shell/bazel/workspace_test.sh | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src/test/shell') diff --git a/src/test/shell/bazel/workspace_test.sh b/src/test/shell/bazel/workspace_test.sh index 7addf93a08..a308c2adb0 100755 --- a/src/test/shell/bazel/workspace_test.sh +++ b/src/test/shell/bazel/workspace_test.sh @@ -381,4 +381,41 @@ EOF expect_log "@flower//daisy:daisy" } +function test_repository_mapping_in_build_file_load() { + # Main repo assigns @x to @y within @a + mkdir -p main + cat > main/WORKSPACE < y/symbol.bzl < a/BUILD<