-
Notifications
You must be signed in to change notification settings - Fork 278
/
BUILD
52 lines (45 loc) · 1.55 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
load("//scala/scalafmt/toolchain:setup_scalafmt_toolchain.bzl", "setup_scalafmt_toolchains")
load("//scala/scalafmt/toolchain:toolchain.bzl", "export_scalafmt_deps")
load("//scala/scalafmt:phase_scalafmt_ext.bzl", "scalafmt_singleton")
load("//scala:scala.bzl", "scala_binary")
load("//scala:scala_cross_version.bzl", "version_suffix")
load("//scala:scala_cross_version_select.bzl", "select_for_scala_version")
load("@io_bazel_rules_scala_config//:config.bzl", "SCALA_VERSION")
filegroup(
name = "runner",
srcs = ["private/format.template.sh"],
visibility = ["//visibility:public"],
)
filegroup(
name = "testrunner",
srcs = ["private/format-test.template.sh"],
visibility = ["//visibility:public"],
)
scala_binary(
name = "scalafmt",
srcs = ["scalafmt/ScalafmtWorker.scala"] + select_for_scala_version(
before_2_12_0 = ["scalafmt/ScalafmtAdapter-2_11.scala"],
since_2_12_0 = ["scalafmt/ScalafmtAdapter.scala"],
),
main_class = "io.bazel.rules_scala.scalafmt.ScalafmtWorker",
visibility = ["//visibility:public"],
deps = [
":scalafmt_classpath",
"//src/java/io/bazel/rulesscala/worker",
],
)
scalafmt_singleton(
name = "phase_scalafmt",
visibility = ["//visibility:public"],
)
setup_scalafmt_toolchains()
# Alias for backward compatibility:
alias(
name = "scalafmt_toolchain",
actual = "scalafmt_toolchain" + version_suffix(SCALA_VERSION),
)
export_scalafmt_deps(
name = "scalafmt_classpath",
deps_id = "scalafmt_classpath",
visibility = ["//visibility:public"],
)