forked from ProdriveTechnologies/bazel-pandoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoolchain.bzl
31 lines (28 loc) · 872 Bytes
/
toolchain.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
def _pandoc_toolchain_info_impl(ctx):
return [
platform_common.ToolchainInfo(
pandoc = ctx.attr.pandoc,
),
]
_pandoc_toolchain_info = rule(
attrs = {
"pandoc": attr.label(
allow_single_file = True,
cfg = "host",
executable = True,
),
},
implementation = _pandoc_toolchain_info_impl,
)
def pandoc_toolchain(platform, exec_compatible_with):
_pandoc_toolchain_info(
name = "pandoc_toolchain_info_%s" % platform,
pandoc = "@pandoc_bin_%s//:pandoc" % platform,
visibility = ["//visibility:public"],
)
native.toolchain(
name = "pandoc_toolchain_%s" % platform,
exec_compatible_with = exec_compatible_with,
toolchain = ":pandoc_toolchain_info_%s" % platform,
toolchain_type = ":pandoc_toolchain_type",
)