forked from bazelbuild/rules_scala
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD
119 lines (101 loc) · 3.77 KB
/
BUILD
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
load("@rules_java//java:defs.bzl", "java_import", "java_library")
load("//scala:providers.bzl", "declare_deps_provider")
load("//scala:scala.bzl", "setup_scala_toolchain")
load("@io_bazel_rules_scala_config//:config.bzl", "SCALA_MAJOR_VERSION")
toolchain_type(
name = "toolchain_type",
visibility = ["//visibility:public"],
)
_SCALA_COMPILE_CLASSPATH_DEPS = [
"@io_bazel_rules_scala_scala_compiler",
"@io_bazel_rules_scala_scala_library",
] + (["@io_bazel_rules_scala_scala_reflect"] if SCALA_MAJOR_VERSION.startswith("2") else [
"@io_bazel_rules_scala_scala_interfaces",
"@io_bazel_rules_scala_scala_tasty_core",
"@io_bazel_rules_scala_scala_asm",
"@io_bazel_rules_scala_scala_library_2",
])
_SCALA_LIBRARY_CLASSPATH_DEPS = [
"@io_bazel_rules_scala_scala_library",
] + (["@io_bazel_rules_scala_scala_reflect"] if SCALA_MAJOR_VERSION.startswith("2") else [
"@io_bazel_rules_scala_scala_library_2",
])
_SCALA_MACRO_CLASSPATH_DEPS = [
"@io_bazel_rules_scala_scala_library",
] + (["@io_bazel_rules_scala_scala_reflect"] if SCALA_MAJOR_VERSION.startswith("2") else [
"@io_bazel_rules_scala_scala_library_2",
])
_PARSER_COMBINATORS_DEPS = ["@io_bazel_rules_scala_scala_parser_combinators"]
_SCALA_XML_DEPS = ["@io_bazel_rules_scala_scala_xml"]
_SEMANTICDB_DEPS = ["@org_scalameta_semanticdb_scalac"] if SCALA_MAJOR_VERSION.startswith("2") else []
setup_scala_toolchain(
name = "default_toolchain",
scala_compile_classpath = _SCALA_COMPILE_CLASSPATH_DEPS,
scala_library_classpath = _SCALA_LIBRARY_CLASSPATH_DEPS,
scala_macro_classpath = _SCALA_MACRO_CLASSPATH_DEPS,
use_argument_file_in_runner = True,
)
setup_scala_toolchain(
name = "unused_dependency_checker_error_toolchain",
dependency_tracking_method = "ast-plus",
scala_compile_classpath = _SCALA_COMPILE_CLASSPATH_DEPS,
scala_library_classpath = _SCALA_LIBRARY_CLASSPATH_DEPS,
scala_macro_classpath = _SCALA_MACRO_CLASSPATH_DEPS,
unused_dependency_checker_mode = "error",
)
setup_scala_toolchain(
name = "minimal_direct_source_deps",
dependency_mode = "plus-one",
dependency_tracking_method = "ast",
scala_compile_classpath = _SCALA_COMPILE_CLASSPATH_DEPS,
scala_library_classpath = _SCALA_LIBRARY_CLASSPATH_DEPS,
scala_macro_classpath = _SCALA_MACRO_CLASSPATH_DEPS,
strict_deps_mode = "error",
unused_dependency_checker_mode = "error",
)
java_import(
name = "bazel_test_runner_deploy",
jars = ["@bazel_tools//tools/jdk:TestRunner_deploy.jar"],
visibility = ["//visibility:public"],
)
java_library(
name = "PlaceHolderClassToCreateEmptyJarForScalaImport",
srcs = ["PlaceHolderClassToCreateEmptyJarForScalaImport.java"],
visibility = ["//visibility:public"],
)
declare_deps_provider(
name = "scala_compile_classpath_provider",
deps_id = "scala_compile_classpath",
visibility = ["//visibility:public"],
deps = _SCALA_COMPILE_CLASSPATH_DEPS,
)
declare_deps_provider(
name = "scala_library_classpath_provider",
deps_id = "scala_library_classpath",
visibility = ["//visibility:public"],
deps = _SCALA_LIBRARY_CLASSPATH_DEPS,
)
declare_deps_provider(
name = "scala_macro_classpath_provider",
deps_id = "scala_macro_classpath",
visibility = ["//visibility:public"],
deps = _SCALA_MACRO_CLASSPATH_DEPS,
)
declare_deps_provider(
name = "scala_xml_provider",
deps_id = "scala_xml",
visibility = ["//visibility:public"],
deps = _SCALA_XML_DEPS,
)
declare_deps_provider(
name = "parser_combinators_provider",
deps_id = "parser_combinators",
visibility = ["//visibility:public"],
deps = _PARSER_COMBINATORS_DEPS,
)
declare_deps_provider(
name = "semanticdb_provider",
deps_id = "semanticdb",
visibility = ["//visibility:public"],
deps = _SEMANTICDB_DEPS,
)