diff options
author | Jay Conrod <jayconrod@gmail.com> | 2018-06-12 10:40:47 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-12 10:40:47 -0400 |
commit | bd1c095bdf04385a412a57c2feb9cd6e8fbe89c0 (patch) | |
tree | 7671e4483ceaa8be4bc5d9fa0347ff6879c5c491 /tests/core/go_test/BUILD.bazel | |
parent | 8e247d31f6bf990b72d65e2c24fd9076a41cbd1a (diff) | |
download | bazelbuild-rules_go-bd1c095bdf04385a412a57c2feb9cd6e8fbe89c0.tar.gz |
Inherit importmap from embedded libraries (#1541)
This change allows Go rules to inherit the importmap attribute from
embedded libraries, the same way the importpath attribute is
inherited. This is particularly important for tests, which rely on an
embedded library under test to set the importpath. Test archives are
imported from the generated testmain, so their importmap does matter.
Fixes #1538
Diffstat (limited to 'tests/core/go_test/BUILD.bazel')
-rw-r--r-- | tests/core/go_test/BUILD.bazel | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/core/go_test/BUILD.bazel b/tests/core/go_test/BUILD.bazel index 3df9189d..2ebb60be 100644 --- a/tests/core/go_test/BUILD.bazel +++ b/tests/core/go_test/BUILD.bazel @@ -75,3 +75,25 @@ go_test( size = "small", srcs = ["only_testmain_test.go"], ) + +go_test( + name = "external_importmap_test", + size = "small", + srcs = ["external_importmap_test.go"], + embed = [":external_importmap_lib"], + deps = [":external_importmap_dep"], +) + +go_library( + name = "external_importmap_lib", + srcs = ["external_importmap_lib.go"], + importmap = "x/github.com/bazelbuild/rules_go/tests/core/go_test/external_importmap", + importpath = "github.com/bazelbuild/rules_go/tests/core/go_test/external_importmap", +) + +go_library( + name = "external_importmap_dep", + srcs = ["external_importmap_dep.go"], + importpath = "github.com/bazelbuild/rules_go/tests/core/go_test/external_importmap_dep", + deps = [":external_importmap_lib"], +) |