Skip to content

Commit

Permalink
Recursive filegroups
Browse files Browse the repository at this point in the history
  • Loading branch information
achew22 committed Oct 22, 2020
1 parent 073384d commit 8077300
Show file tree
Hide file tree
Showing 25 changed files with 106 additions and 44 deletions.
14 changes: 12 additions & 2 deletions go/private/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,24 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library")

filegroup(
name = "all_rules",
srcs = glob(["**/*.bzl"]),
srcs = [
"//go/private/actions:all_rules",
"//go/private/rules:all_rules",
"//go/private/skylib/lib:all_rules",
"//go/private/tools:all_rules",
] + glob(["**/*.bzl"]),
visibility = ["//visibility:public"],
)

filegroup(
name = "all_files",
testonly = True,
srcs = glob(["**"]),
srcs = [
"//go/private/actions:all_files",
"//go/private/rules:all_files",
"//go/private/skylib/lib:all_files",
"//go/private/tools:all_files",
] + glob(["**"]),
visibility = ["//visibility:public"],
)

Expand Down
13 changes: 13 additions & 0 deletions go/private/actions/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")

filegroup(
name = "all_rules",
srcs = glob(["**/*.bzl"]),
visibility = ["//visibility:public"],
)

filegroup(
name = "all_files",
testonly = True,
srcs = glob(["**"]),
visibility = ["//visibility:public"],
)

bzl_library(
name = "archive",
srcs = ["archive.bzl"],
Expand Down
10 changes: 5 additions & 5 deletions go/private/actions/archive.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,29 @@
# limitations under the License.

load(
"@io_bazel_rules_go//go/private:common.bzl",
"//go/private:common.bzl",
"as_tuple",
"split_srcs",
)
load(
"@io_bazel_rules_go//go/private:mode.bzl",
"//go/private:mode.bzl",
"LINKMODE_C_ARCHIVE",
"LINKMODE_C_SHARED",
"mode_string",
)
load(
"@io_bazel_rules_go//go/private:providers.bzl",
"//go/private:providers.bzl",
"GoArchive",
"GoArchiveData",
"effective_importpath_pkgpath",
"get_archive",
)
load(
"@io_bazel_rules_go//go/private/rules:cgo.bzl",
"//go/private/rules:cgo.bzl",
"cgo_configure",
)
load(
"@io_bazel_rules_go//go/private/actions:compilepkg.bzl",
"//go/private/actions:compilepkg.bzl",
"emit_compilepkg",
)

Expand Down
2 changes: 1 addition & 1 deletion go/private/actions/asm.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

load(
"@io_bazel_rules_go//go/private:mode.bzl",
"//go/private:mode.bzl",
"link_mode_args",
)

Expand Down
4 changes: 2 additions & 2 deletions go/private/actions/binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
# limitations under the License.

load(
"@io_bazel_rules_go//go/private:mode.bzl",
"//go/private:mode.bzl",
"LINKMODE_C_ARCHIVE",
"LINKMODE_C_SHARED",
"LINKMODE_PLUGIN",
)
load(
"@io_bazel_rules_go//go/private:common.bzl",
"//go/private:common.bzl",
"ARCHIVE_EXTENSION",
"has_shared_lib_extension",
)
Expand Down
2 changes: 1 addition & 1 deletion go/private/actions/compile.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

load(
"@io_bazel_rules_go//go/private:mode.bzl",
"//go/private:mode.bzl",
"link_mode_args",
)

Expand Down
2 changes: 1 addition & 1 deletion go/private/actions/compilepkg.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

load(
"@io_bazel_rules_go//go/private:mode.bzl",
"//go/private:mode.bzl",
"link_mode_args",
)
load(
Expand Down
2 changes: 1 addition & 1 deletion go/private/actions/cover.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

load(
"@io_bazel_rules_go//go/private:providers.bzl",
"//go/private:providers.bzl",
"GoSource",
"effective_importpath_pkgpath",
)
Expand Down
4 changes: 2 additions & 2 deletions go/private/actions/link.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
# limitations under the License.

load(
"@io_bazel_rules_go//go/private:common.bzl",
"//go/private:common.bzl",
"as_set",
"has_shared_lib_extension",
)
load(
"@io_bazel_rules_go//go/private:mode.bzl",
"//go/private:mode.bzl",
"LINKMODE_NORMAL",
"LINKMODE_PLUGIN",
"extld_from_cc_toolchain",
Expand Down
4 changes: 2 additions & 2 deletions go/private/actions/stdlib.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
# limitations under the License.

load(
"@io_bazel_rules_go//go/private:providers.bzl",
"//go/private:providers.bzl",
"GoStdLib",
)
load(
"@io_bazel_rules_go//go/private:mode.bzl",
"//go/private:mode.bzl",
"LINKMODE_NORMAL",
"extldflags_from_cc_toolchain",
"link_mode_args",
Expand Down
2 changes: 1 addition & 1 deletion go/private/nogo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

DEFAULT_NOGO = "@io_bazel_rules_go//:default_nogo"
DEFAULT_NOGO = "//:default_nogo"

def _go_register_nogo_impl(ctx):
ctx.template(
Expand Down
13 changes: 13 additions & 0 deletions go/private/rules/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")

filegroup(
name = "all_rules",
srcs = glob(["**/*.bzl"]),
visibility = ["//visibility:public"],
)

filegroup(
name = "all_files",
testonly = True,
srcs = glob(["**"]),
visibility = ["//visibility:public"],
)

bzl_library(
name = "binary",
srcs = ["binary.bzl"],
Expand Down
4 changes: 2 additions & 2 deletions go/private/rules/binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

load(
"@io_bazel_rules_go//go/private:context.bzl",
"//go/private:context.bzl",
"go_context",
)
load(
Expand All @@ -32,7 +32,7 @@ load(
"go_transition_rule",
)
load(
"@io_bazel_rules_go//go/private:mode.bzl",
"//go/private:mode.bzl",
"LINKMODE_PLUGIN",
"LINKMODE_SHARED",
)
Expand Down
4 changes: 2 additions & 2 deletions go/private/rules/cgo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
# limitations under the License.

load(
"@io_bazel_rules_go//go/private:common.bzl",
"//go/private:common.bzl",
"as_iterable",
"has_simple_shared_lib_extension",
"has_versioned_shared_lib_extension",
)
load(
"@io_bazel_rules_go//go/private:mode.bzl",
"//go/private:mode.bzl",
"LINKMODE_C_ARCHIVE",
"LINKMODE_C_SHARED",
"LINKMODE_NORMAL",
Expand Down
6 changes: 3 additions & 3 deletions go/private/rules/library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
# limitations under the License.

load(
"@io_bazel_rules_go//go/private:common.bzl",
"//go/private:common.bzl",
"asm_exts",
"cgo_exts",
"go_exts",
)
load(
"@io_bazel_rules_go//go/private:context.bzl",
"//go/private:context.bzl",
"go_context",
)
load(
"@io_bazel_rules_go//go/private:providers.bzl",
"//go/private:providers.bzl",
"GoLibrary",
"INFERRED_PATH",
)
Expand Down
6 changes: 3 additions & 3 deletions go/private/rules/nogo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
# limitations under the License.

load(
"@io_bazel_rules_go//go/private:context.bzl",
"//go/private:context.bzl",
"go_context",
)
load(
"@io_bazel_rules_go//go/private:providers.bzl",
"//go/private:providers.bzl",
"EXPORT_PATH",
"GoArchive",
"GoLibrary",
"get_archive",
)
load(
"@io_bazel_rules_go//go/private/rules:transition.bzl",
"//go/private/rules:transition.bzl",
"go_reset_transition",
)

Expand Down
2 changes: 1 addition & 1 deletion go/private/rules/sdk.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

load(
"@io_bazel_rules_go//go/private:providers.bzl",
"//go/private:providers.bzl",
"GoSDK",
)

Expand Down
4 changes: 2 additions & 2 deletions go/private/rules/source.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
# limitations under the License.

load(
"@io_bazel_rules_go//go/private:context.bzl",
"//go/private:context.bzl",
"go_context",
)
load(
"@io_bazel_rules_go//go/private:providers.bzl",
"//go/private:providers.bzl",
"GoLibrary",
)

Expand Down
2 changes: 1 addition & 1 deletion go/private/rules/stdlib.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

load(
"@io_bazel_rules_go//go/private:context.bzl",
"//go/private:context.bzl",
"go_context",
)
load(
Expand Down
4 changes: 2 additions & 2 deletions go/private/rules/test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

load(
"@io_bazel_rules_go//go/private:context.bzl",
"//go/private:context.bzl",
"go_context",
)
load(
Expand Down Expand Up @@ -41,7 +41,7 @@ load(
"go_transition_rule",
)
load(
"@io_bazel_rules_go//go/private:mode.bzl",
"//go/private:mode.bzl",
"LINKMODE_NORMAL",
)
load(
Expand Down
6 changes: 3 additions & 3 deletions go/private/rules/transition.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
# limitations under the License.

load(
"@io_bazel_rules_go//go/private:mode.bzl",
"//go/private:mode.bzl",
"LINKMODES",
"LINKMODE_NORMAL",
)
load(
"@io_bazel_rules_go//go/private:platforms.bzl",
"//go/private:platforms.bzl",
"CGO_GOOS_GOARCH",
"GOOS_GOARCH",
)
Expand All @@ -29,7 +29,7 @@ load(
"GoSource",
)
load(
"@io_bazel_rules_go_name_hack//:def.bzl",
"//:def.bzl",
"IS_RULES_GO",
)

Expand Down
10 changes: 5 additions & 5 deletions go/private/sdk.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@
# limitations under the License.

load(
"@io_bazel_rules_go//go/private:common.bzl",
"//go/private:common.bzl",
"executable_path",
)
load(
"@io_bazel_rules_go//go/private:nogo.bzl",
"//go/private:nogo.bzl",
"go_register_nogo",
)
load(
"@io_bazel_rules_go//go/private:sdk_list.bzl",
"//go/private:sdk_list.bzl",
"DEFAULT_VERSION",
"MIN_SUPPORTED_VERSION",
"SDK_REPOSITORIES",
)
load(
"@io_bazel_rules_go//go/private:platforms.bzl",
"//go/private:platforms.bzl",
"generate_toolchain_names",
)
load(
"@io_bazel_rules_go//go/private/skylib/lib:versions.bzl",
"//go/private/skylib/lib:versions.bzl",
"versions",
)

Expand Down
13 changes: 13 additions & 0 deletions go/private/skylib/lib/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")

filegroup(
name = "all_rules",
srcs = glob(["**/*.bzl"]),
visibility = ["//visibility:public"],
)

filegroup(
name = "all_files",
testonly = True,
srcs = glob(["**"]),
visibility = ["//visibility:public"],
)

bzl_library(
name = "versions",
srcs = ["versions.bzl"],
Expand Down

0 comments on commit 8077300

Please sign in to comment.