Skip to content

Commit 554a2d1

Browse files
committed
Return extension_metadata from protoc extension
This will help ensure that users remember to import the `rules_scala_protoc_toolchains` repo when using the precompiled protocol compiler toolchain module extension. - https://bazel.build/rules/lib/builtins/module_ctx#extension_metadata
1 parent 6710523 commit 554a2d1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scala/extensions/protoc.bzl

+7-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ load(
3838
"single_tag_values",
3939
)
4040

41+
_TOOLCHAINS_REPO = "rules_scala_protoc_toolchains"
42+
4143
_toolchains_defaults = {
4244
"platforms": [],
4345
}
@@ -71,9 +73,13 @@ def _scala_protoc_impl(module_ctx):
7173

7274
tags = root_module_tags(module_ctx, _tag_classes.keys())
7375
scala_protoc_toolchains(
74-
name = "rules_scala_protoc_toolchains",
76+
name = _TOOLCHAINS_REPO,
7577
**single_tag_values(module_ctx, tags.toolchains, _toolchains_defaults)
7678
)
79+
return module_ctx.extension_metadata(
80+
root_module_direct_deps = [],
81+
root_module_direct_dev_deps = [_TOOLCHAINS_REPO],
82+
)
7783

7884
scala_protoc = module_extension(
7985
implementation = _scala_protoc_impl,

0 commit comments

Comments
 (0)