From 01407c525aa0c6326049a4c9179d74188ef4f86b Mon Sep 17 00:00:00 2001 From: Martin Stjernholm Date: Wed, 13 May 2020 01:54:21 +0100 Subject: [PATCH] Don't print :__pkg__ for package rules, since that's the default. To reduce clutter a little. Test: m nothing Change-Id: I0d2d86f00c3d38e603d6f58c4b1dd9a4170bf819 --- android/visibility.go | 2 +- sdk/sdk_test.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/visibility.go b/android/visibility.go index 2cb00233d..6558e4622 100644 --- a/android/visibility.go +++ b/android/visibility.go @@ -140,7 +140,7 @@ func (r packageRule) matches(m qualifiedModuleName) bool { } func (r packageRule) String() string { - return fmt.Sprintf("//%s:__pkg__", r.pkg) + return fmt.Sprintf("//%s", r.pkg) // :__pkg__ is the default, so skip it. } // A subpackagesRule is a visibility rule that matches modules in a specific package (i.e. diff --git a/sdk/sdk_test.go b/sdk/sdk_test.go index ae1a4923a..eb514342b 100644 --- a/sdk/sdk_test.go +++ b/sdk/sdk_test.go @@ -155,14 +155,14 @@ func TestSnapshotVisibility(t *testing.T) { java_import { name: "mysdk_myjavalib@current", sdk_member_name: "myjavalib", - visibility: ["//other/foo:__pkg__"], + visibility: ["//other/foo"], jars: ["java/myjavalib.jar"], } java_import { name: "myjavalib", prefer: false, - visibility: ["//other/foo:__pkg__"], + visibility: ["//other/foo"], jars: ["java/myjavalib.jar"], } @@ -183,21 +183,21 @@ java_import { java_import { name: "mysdk_mydefaultedjavalib@current", sdk_member_name: "mydefaultedjavalib", - visibility: ["//other/bar:__pkg__"], + visibility: ["//other/bar"], jars: ["java/mydefaultedjavalib.jar"], } java_import { name: "mydefaultedjavalib", prefer: false, - visibility: ["//other/bar:__pkg__"], + visibility: ["//other/bar"], jars: ["java/mydefaultedjavalib.jar"], } sdk_snapshot { name: "mysdk@current", visibility: [ - "//other/foo:__pkg__", + "//other/foo", "//package:__subpackages__", ], java_header_libs: [