Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions example/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module(name = "rules_runfiles_group_example")

bazel_dep(name = "rules_runfiles_group")
bazel_dep(name = "rules_go", version = "0.60.0")
bazel_dep(name = "hermetic_launcher", version = "0.0.5")
Expand All @@ -10,21 +12,21 @@ local_path_override(
path = "../",
)

local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "local_repository")
local_starlark_repository = use_repo_rule("//producer/repository_rules:local_starlark_repository.bzl", "local_starlark_repository")

local_repository(
local_starlark_repository(
name = "std",
path = "producer/stdlib_repo",
repo_file = "//producer:stdlib_repo/REPO.bazel",
)

local_repository(
local_starlark_repository(
name = "fizzbuzz",
path = "third_party/fizzbuzz",
repo_file = "//:third_party/fizzbuzz/REPO.bazel",
)

local_repository(
local_starlark_repository(
name = "stringutil",
path = "third_party/stringutil",
repo_file = "//:third_party/stringutil/REPO.bazel",
)

http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
Expand Down
Empty file added example/producer/BUILD.bazel
Empty file.
Empty file.
14 changes: 14 additions & 0 deletions example/producer/repository_rules/local_starlark_repository.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
def _local_starlark_repository_impl(rctx):
rctx.watch(rctx.attr.repo_file)
repo_root = rctx.path(rctx.attr.repo_file).dirname
rctx.watch(repo_root)
rctx.symlink(repo_root, ".")


local_starlark_repository = repository_rule(
implementation = _local_starlark_repository_impl,
attrs = {"repo_file": attr.label(
mandatory = True,
doc = "REPO.bazel of the local starlark repository",
)},
)
3 changes: 1 addition & 2 deletions example/producer/stdlib_repo/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# buildifier: disable=canonical-repository
load("@@//producer/rules:starlark_library.bzl", "starlark_library")
load("@rules_runfiles_group_example//producer/rules:starlark_library.bzl", "starlark_library")

starlark_library(
name = "std",
Expand Down
3 changes: 1 addition & 2 deletions example/producer/stdlib_repo/sha256/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# buildifier: disable=canonical-repository
load("@@//producer/rules:starlark_library.bzl", "starlark_library")
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
load("@rules_runfiles_group_example//producer/rules:starlark_library.bzl", "starlark_library")

copy_file(
name = "implementation_src",
Expand Down
3 changes: 1 addition & 2 deletions example/third_party/fizzbuzz/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# buildifier: disable=canonical-repository
load("@@//producer/rules:starlark_library.bzl", "starlark_library")
load("@rules_runfiles_group_example//producer/rules:starlark_library.bzl", "starlark_library")

starlark_library(
name = "fizzbuzz",
Expand Down
3 changes: 1 addition & 2 deletions example/third_party/stringutil/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# buildifier: disable=canonical-repository
load("@@//producer/rules:starlark_library.bzl", "starlark_library")
load("@rules_runfiles_group_example//producer/rules:starlark_library.bzl", "starlark_library")

starlark_library(
name = "stringutil",
Expand Down
Loading