File tree 5 files changed +69
-1
lines changed
src/scala/io/bazel/rules_scala/tut_support
5 files changed +69
-1
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ scala_library(
8
8
"//scala/private/toolchain_deps:scala_compile_classpath" ,
9
9
],
10
10
deps = [
11
- "//external:io_bazel_rules_scala/dependency/tut/tut_core" ,
12
11
"//src/java/io/bazel/rulesscala/io_utils" ,
12
+ "@io_bazel_rules_scala//tut_rule:tut_core" ,
13
13
],
14
14
)
15
15
Original file line number Diff line number Diff line change
1
+ load ("@io_bazel_rules_scala//scala:providers.bzl" , "declare_deps_provider" )
2
+ load ("@io_bazel_rules_scala//tut_rule/toolchain:toolchain.bzl" , "export_tut_deps" , "tut_toolchain" )
3
+
4
+ tut_toolchain (
5
+ name = "tut_toolchain_impl" ,
6
+ visibility = ["//visibility:public" ],
7
+ )
8
+
9
+ toolchain (
10
+ name = "tut_toolchain" ,
11
+ toolchain = ":tut_toolchain_impl" ,
12
+ toolchain_type = "//tut_rule/toolchain:tut_toolchain_type" ,
13
+ )
14
+
15
+ declare_deps_provider (
16
+ name = "tut_core_provider" ,
17
+ deps_id = "tut_core" ,
18
+ deps = ["//external:io_bazel_rules_scala/dependency/tut/tut_core" ],
19
+ )
20
+
21
+ export_tut_deps (
22
+ name = "tut_core" ,
23
+ deps_id = "tut_core" ,
24
+ visibility = ["//visibility:public" ],
25
+ )
Original file line number Diff line number Diff line change
1
+ toolchain_type (
2
+ name = "tut_toolchain_type" ,
3
+ visibility = ["//visibility:public" ],
4
+ )
Original file line number Diff line number Diff line change
1
+ load ("@io_bazel_rules_scala//scala:providers.bzl" , _DepsInfo = "DepsInfo" )
2
+ load ("//scala/private/toolchain_deps:toolchain_deps.bzl" , "expose_toolchain_deps" )
3
+
4
+ def _tut_toolchain_impl (ctx ):
5
+ toolchain = platform_common .ToolchainInfo (
6
+ dep_providers = ctx .attr .dep_providers ,
7
+ )
8
+
9
+ return [toolchain ]
10
+
11
+ tut_toolchain = rule (
12
+ _tut_toolchain_impl ,
13
+ attrs = {
14
+ "dep_providers" : attr .label_list (
15
+ default = [
16
+ "@io_bazel_rules_scala//tut_rule:tut_core_provider" ,
17
+ ],
18
+ providers = [_DepsInfo ],
19
+ ),
20
+ },
21
+ )
22
+
23
+ def _export_tut_deps (ctx ):
24
+ return expose_toolchain_deps (
25
+ ctx ,
26
+ "@io_bazel_rules_scala//tut_rule/toolchain:tut_toolchain_type" ,
27
+ )
28
+
29
+ export_tut_deps = rule (
30
+ _export_tut_deps ,
31
+ attrs = {
32
+ "deps_id" : attr .string (
33
+ mandatory = True ,
34
+ ),
35
+ },
36
+ toolchains = ["@io_bazel_rules_scala//tut_rule/toolchain:tut_toolchain_type" ],
37
+ )
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ def tut_repositories(
40
40
actual = "@io_bazel_rules_scala_org_tpolecat_tut_core" ,
41
41
)
42
42
43
+ native .register_toolchains ("@io_bazel_rules_scala//tut_rule:tut_toolchain" )
44
+
43
45
def scala_tut_doc (** kw ):
44
46
name = kw ["name" ]
45
47
deps = kw .get ("deps" , [])
You can’t perform that action at this time.
0 commit comments