Thanks for your replies!
I have not found a way forward on howto implement an "umbrella" module. I have experimented on creating an extension with tags that define attributes that depends the sub-module I want to facade.
However, I fail to get Bazel to download the submodule without explicit calls to the submodule extensions.
Something like the following (pseudo code):
umbrella repository, MODULE.bazel:
bazel_dep(name = "submodule_x", version = "0.0.1")
submodule_x = use_extension("@submodule_x//extensions.bzl", "submodule_x"),
use_repo(submodule_x, "submodule_x")
umbrella repository, extensions.bzl:
_attrs_submodule_x = {
"__submodule_x": attr.label(
default="@submodule_x//:anyfile.bzl",
allow_single_file=True,
),
}
umbrella = module_extension(
implementation = _umbrella_impl_,
tag_classes = {
"submodule_x": tag_class(
attrs = _attrs_submodule_x,
),
},
)
Root repository, MODULE.bazel:
bazel_dep(name = "umbrella", version = "0.0.1")
umbrella = use_extension("@umbrella//extensions.bzl", "umbrella"),
umbrella.submodule_x()
use_repo(umbrella, "submodule_x")
However, after calling the umbrella extension from the root repository, the submodule_x is not available in the externals and cannot be referenced. Do you think this should work?
Kind regards,
Jonas Hansson