diff --git a/examples/sboms/BUILD b/examples/sboms/BUILD index 5d70e9c..6af210c 100644 --- a/examples/sboms/BUILD +++ b/examples/sboms/BUILD @@ -7,7 +7,7 @@ load("@rules_license//rules_gathering:generate_sbom.bzl", "generate_sbom") # which generates the SBOMs # See the output in bazel-bin/examples/sboms/write_sbom.txt generate_sbom( - name = "write_sbom_sbom", + name = "write_sbom", out = "write_sbom.txt", deps = ["//tools:write_sbom"], ) diff --git a/rules/compliance.bzl b/rules/compliance.bzl index ad46c74..c4010f0 100644 --- a/rules/compliance.bzl +++ b/rules/compliance.bzl @@ -67,8 +67,10 @@ def _check_license_impl(ctx): executable = ctx.executable._checker, arguments = [args], ) - outputs.append(licenses_file) # also make the json file available. - return [DefaultInfo(files = depset(outputs))] + return [ + DefaultInfo(files = depset(outputs)), + OutputGroupInfo(licenses_file = depset([licenses_file])), + ] _check_license = rule( implementation = _check_license_impl, diff --git a/rules_gathering/generate_sbom.bzl b/rules_gathering/generate_sbom.bzl index e6432f1..96947b6 100644 --- a/rules_gathering/generate_sbom.bzl +++ b/rules_gathering/generate_sbom.bzl @@ -46,8 +46,10 @@ def _generate_sbom_impl(ctx): executable = ctx.executable._sbom_generator, arguments = [args], ) - outputs.append(licenses_file) # also make the json file available. - return [DefaultInfo(files = depset(outputs))] + return [ + DefaultInfo(files = depset(outputs)), + OutputGroupInfo(licenses_file = depset([licenses_file])), + ] _generate_sbom = rule( implementation = _generate_sbom_impl,