From 7ca4c4ed03c781fe7b930a4062081aaab70873b4 Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Fri, 17 Apr 2020 11:05:52 +0200 Subject: [PATCH] Add LinkablePackageInfo provider to tsc target --- defs_1_1.bzl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/defs_1_1.bzl b/defs_1_1.bzl index 036b352..7b7327b 100644 --- a/defs_1_1.bzl +++ b/defs_1_1.bzl @@ -1,9 +1,24 @@ +load( + "@build_bazel_rules_nodejs//:providers.bzl", + "LinkablePackageInfo", +) load("@npm//typescript:index.bzl", "tsc") +def _paths_join(*paths): + return "/".join([p for p in paths if p]) + def _my_ts_library_impl(ctx): tsc = ctx.attr.tsc return [ tsc[DefaultInfo], + LinkablePackageInfo( + package_name = ctx.attr.module_name, + path = _paths_join( + ctx.bin_dir.path, + ctx.label.workspace_root, + ctx.label.package, + ), + ), ] _my_ts_library = rule(