-
Notifications
You must be signed in to change notification settings - Fork 8
/
toolchains.bzl
31 lines (30 loc) · 1.13 KB
/
toolchains.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 _clojure_toolchain(ctx):
return [platform_common.ToolchainInfo(
runtime = ctx.attr.classpath,
scripts = {s.basename: s for s in ctx.files._scripts},
jdk = ctx.attr._jdk,
java = ctx.attr._jdk[java_common.JavaRuntimeInfo].java_executable_exec_path,
java_runfiles = ctx.attr._jdk[java_common.JavaRuntimeInfo].java_executable_runfiles_path,
files = struct(
runtime = ctx.files.classpath,
scripts = ctx.files._scripts,
jdk = ctx.files._jdk,
),
)]
clojure_toolchain = rule(
implementation = _clojure_toolchain,
attrs = {
"classpath": attr.label_list(
doc = "List of JavaInfo dependencies which will be implictly added to library/repl/test/binary classpath. Must contain clojure.jar",
providers = [JavaInfo],
),
"_scripts": attr.label(
default = "//scripts",
),
"_jdk": attr.label(
default = "@bazel_tools//tools/jdk:current_java_runtime",
providers = [java_common.JavaRuntimeInfo],
),
},
provides = [platform_common.ToolchainInfo],
)