Skip to content

Commit

Permalink
Updated bzl_library targets to have a more discoverable name (bazel…
Browse files Browse the repository at this point in the history
  • Loading branch information
UebelAndre authored and cfredric committed Feb 16, 2022
1 parent 0b8ad50 commit 3d8f88e
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 29 deletions.
9 changes: 8 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@ load("//rust:defs.bzl", "capture_clippy_output", "error_format", "extra_rustc_fl
exports_files(["LICENSE"])

bzl_library(
name = "rules",
name = "bzl_lib",
srcs = [
":workspace.bzl",
],
visibility = ["//visibility:public"],
)

alias(
name = "rules",
actual = ":bzl_lib",
deprecation = "Please use the `@rules_rust//:bzl_lib` target instead",
visibility = ["//visibility:public"],
)

# This setting may be changed from the command line to generate machine readable errors.
error_format(
name = "error_format",
Expand Down
10 changes: 8 additions & 2 deletions bindgen/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ package(default_visibility = ["//visibility:public"])
toolchain_type(name = "bindgen_toolchain")

bzl_library(
name = "rules",
name = "bzl_lib",
srcs = glob(["**/*.bzl"]) + ["//bindgen/raze:crates.bzl"],
deps = ["//rust:rules"],
deps = ["//rust:bzl_lib"],
)

alias(
name = "rules",
actual = ":bzl_lib",
deprecation = "Please use the `@rules_rust//bindgen:bzl_lib` target instead",
)

rust_bindgen_toolchain(
Expand Down
8 changes: 7 additions & 1 deletion cargo/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
package(default_visibility = ["//visibility:public"])

bzl_library(
name = "rules",
name = "bzl_lib",
srcs = glob(["**/*.bzl"]),
deps = ["//cargo/private:bzl_lib"],
)

alias(
name = "rules",
actual = ":bzl_lib",
deprecation = "Please use the `@rules_rust//cargo:bzl_lib` target instead",
)
10 changes: 8 additions & 2 deletions crate_universe/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ exports_files([
])

bzl_library(
name = "rules",
name = "bzl_lib",
srcs = glob(["**/*.bzl"]),
deps = ["//crate_universe/private:bzl_srcs"],
deps = ["//crate_universe/private:bzl_lib"],
)

alias(
name = "rules",
actual = ":bzl_lib",
deprecation = "Please use the `@rules_rust//crate_universe:bzl_lib` target instead",
)

filegroup(
Expand Down
2 changes: 1 addition & 1 deletion crate_universe/private/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
package(default_visibility = ["//visibility:public"])

bzl_library(
name = "bzl_srcs",
name = "bzl_lib",
srcs = glob(["**/*.bzl"]),
)
14 changes: 7 additions & 7 deletions docs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ bzl_library(
name = "all_docs",
deps = [
":docs_deps",
"@rules_rust//:rules",
"@rules_rust//bindgen:rules",
"@rules_rust//cargo:rules",
"@rules_rust//crate_universe:rules",
"@rules_rust//proto:rules",
"@rules_rust//rust:rules",
"@rules_rust//wasm_bindgen:rules",
"@rules_rust//:bzl_lib",
"@rules_rust//bindgen:bzl_lib",
"@rules_rust//cargo:bzl_lib",
"@rules_rust//crate_universe:bzl_lib",
"@rules_rust//proto:bzl_lib",
"@rules_rust//rust:bzl_lib",
"@rules_rust//wasm_bindgen:bzl_lib",
],
)

Expand Down
8 changes: 7 additions & 1 deletion proto/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ toolchain(
rust_proto_toolchain(name = "default-proto-toolchain-impl")

bzl_library(
name = "rules",
name = "bzl_lib",
srcs = glob(["**/*.bzl"]) + ["//proto/raze:crates.bzl"],
)

alias(
name = "rules",
actual = ":bzl_lib",
deprecation = "Please use the `@rules_rust//proto:bzl_lib` target instead",
)
14 changes: 10 additions & 4 deletions rust/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@ toolchain_type(
)

bzl_library(
name = "rules",
name = "bzl_lib",
srcs = glob(["**/*.bzl"]),
deps = [
"//rust/platform:rules",
"//rust/private:rules",
"//rust/settings:rules",
"//rust/platform:bzl_lib",
"//rust/private:bzl_lib",
"//rust/settings:bzl_lib",
],
)

alias(
name = "rules",
actual = ":bzl_lib",
deprecation = "Please use the `@rules_rust//rust:bzl_lib` target instead",
)
9 changes: 8 additions & 1 deletion rust/platform/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ package_group(
)

bzl_library(
name = "rules",
name = "bzl_lib",
srcs = glob(["**/*.bzl"]),
visibility = ["//rust:__subpackages__"],
)

alias(
name = "rules",
actual = ":bzl_lib",
deprecation = "Please use the `@rules_rust//platform:bzl_lib` target instead",
visibility = ["//rust:__subpackages__"],
)
15 changes: 9 additions & 6 deletions rust/private/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ load("//rust/private:rust_analyzer.bzl", "rust_analyzer_detect_sysroot")
load("//rust/private:stamp.bzl", "stamp_build_setting")

bzl_library(
name = "bzl_lib",
srcs = glob(["**/*.bzl"]),
visibility = ["//rust:__subpackages__"],
deps = ["//rust/platform:bzl_lib"],
)

alias(
name = "rules",
srcs = glob(
["**/*.bzl"],
),
actual = ":bzl_lib",
deprecation = "Please use the `@rules_rust//private:bzl_lib` target instead",
visibility = ["//rust:__subpackages__"],
deps = [
"//rust/platform:rules",
],
)

stamp_build_setting(name = "stamp")
Expand Down
9 changes: 8 additions & 1 deletion rust/settings/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ string_flag(
)

bzl_library(
name = "rules",
name = "bzl_lib",
srcs = glob(["**/*.bzl"]),
)

alias(
name = "rules",
actual = ":bzl_lib",
deprecation = "Please use the `@rules_rust//settings:bzl_lib` target instead",
visibility = ["//rust:__subpackages__"],
)
10 changes: 8 additions & 2 deletions wasm_bindgen/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ package(default_visibility = ["//visibility:public"])
toolchain_type(name = "wasm_bindgen_toolchain")

bzl_library(
name = "rules",
name = "bzl_lib",
srcs = glob(["**/*.bzl"]) + ["//wasm_bindgen/raze:crates.bzl"],
deps = ["//rust:rules"],
deps = ["//rust:bzl_lib"],
)

alias(
name = "rules",
actual = ":bzl_lib",
deprecation = "Please use the `@rules_rust//wasm_bindgen:bzl_lib` target instead",
)

rust_wasm_bindgen_toolchain(
Expand Down

0 comments on commit 3d8f88e

Please sign in to comment.