From 6f6dc0259fb7dd065fc1dfca90a4ebac3adac797 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Mon, 4 Mar 2024 09:49:53 -0800 Subject: [PATCH] Tweak visibility attributes/defaults. (#310) (cherry picked from commit 979788e579b0f747768f1242886ce408592882d1) Co-authored-by: Thomas Van Lenten --- BUILD | 2 ++ lib/BUILD | 10 ++++------ rules/BUILD | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/BUILD b/BUILD index 3e989df..0bec7d4 100644 --- a/BUILD +++ b/BUILD @@ -23,6 +23,8 @@ filegroup( name = "for_bazel_tests", testonly = 1, srcs = [ + "BUILD", + "LICENSE", "WORKSPACE", "//configs:for_bazel_tests", "//constraints:for_bazel_tests", diff --git a/lib/BUILD b/lib/BUILD index 3a8767a..9171a51 100644 --- a/lib/BUILD +++ b/lib/BUILD @@ -2,6 +2,10 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") licenses(["notice"]) +package( + default_visibility = ["//visibility:public"], +) + # This target is mainly for use by rules_apple and rules_swift. # When this target is linked into an XCTest binary, and the # `BUILD_WORKSPACE_DIRECTORY` environment variable is set, the relative paths of @@ -19,7 +23,6 @@ objc_library( "@platforms//os:watchos": [], "//conditions:default": ["@platforms//:incompatible"], }), - visibility = ["//visibility:public"], alwayslink = True, ) @@ -27,7 +30,6 @@ objc_library( bzl_library( name = "apple_support", srcs = ["apple_support.bzl"], - visibility = ["//visibility:public"], deps = [ "@bazel_skylib//lib:types", ], @@ -36,7 +38,6 @@ bzl_library( bzl_library( name = "lipo", srcs = ["lipo.bzl"], - visibility = ["//visibility:public"], deps = [ ":apple_support", "@bazel_skylib//lib:shell", @@ -46,21 +47,18 @@ bzl_library( bzl_library( name = "transitions", srcs = ["transitions.bzl"], - visibility = ["//visibility:public"], ) # Public bzl_library for anything that needs to depend on xcode_support.bzl. bzl_library( name = "xcode_support", srcs = ["xcode_support.bzl"], - visibility = ["//visibility:public"], ) # Public bzl_library for anything that needs to depend on repositories.bzl. bzl_library( name = "repositories", srcs = ["repositories.bzl"], - visibility = ["//visibility:public"], ) # Consumed by bazel tests. diff --git a/rules/BUILD b/rules/BUILD index 7d3cc29..986f9d2 100644 --- a/rules/BUILD +++ b/rules/BUILD @@ -2,13 +2,16 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") licenses(["notice"]) +package( + default_visibility = ["//visibility:public"], +) + exports_files(["rules.doc.bzl"]) # Public bzl_library for anything that needs to depend on apple_genrule.bzl. bzl_library( name = "apple_genrule", srcs = ["apple_genrule.bzl"], - visibility = ["//visibility:public"], deps = [ "//rules/private:apple_genrule", ], @@ -17,13 +20,11 @@ bzl_library( bzl_library( name = "toolchain_substitution", srcs = ["toolchain_substitution.bzl"], - visibility = ["//visibility:public"], ) bzl_library( name = "universal_binary", srcs = ["universal_binary.bzl"], - visibility = ["//visibility:public"], deps = [ "//lib:apple_support", "//lib:lipo", @@ -35,7 +36,6 @@ bzl_library( bzl_library( name = "rules", srcs = ["rules.doc.bzl"], - visibility = ["//visibility:public"], deps = [ ":toolchain_substitution", ":universal_binary",