From 8abadb0ab2bfca13e6a8fd7136e91f1a2614a8f6 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Fri, 9 Nov 2018 22:12:41 +0100 Subject: [PATCH] fix(bazel): theming bundle not exposed as sass_library * Expose the theming bundle as a `sass_library` that can be used to generate a custom theme with Bazel. --- tools/sass_bundle.bzl | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/sass_bundle.bzl b/tools/sass_bundle.bzl index a6f24509ca1f..abef0f92d63e 100644 --- a/tools/sass_bundle.bzl +++ b/tools/sass_bundle.bzl @@ -1,3 +1,5 @@ +load("@io_bazel_rules_sass//sass:sass.bzl", "SassInfo") + # Implementation of sass_bundle that performs an action def _sass_bundle(ctx): # Define arguments that will be passed to the underlying nodejs script. @@ -24,11 +26,15 @@ def _sass_bundle(ctx): arguments = [args], ) - # The return value describes what the rule is producing. - # In this case, we can use a `DefaultInfo`, since the rule only produces - # a single output file. - return [DefaultInfo(files = depset([ctx.outputs.output_name]))] + output_depset = depset([ctx.outputs.output_name]) + # The return value describes what the rule is producing. In this case we need to specify + # the "DefaultInfo" and "SassInfo" provider so that the given rule target acts like a filegroup + # and can be also used as sass_library. + return [ + DefaultInfo(files = output_depset), + SassInfo(transitive_sources = output_depset), + ] # Rule definition for sass_bundle that defines attributes and outputs. sass_bundle = rule(