Repository navigation
Expand file tree
/
Copy pathMODULE.bazel
More file actions
64 lines (59 loc) · 2.77 KB
/
Copy pathMODULE.bazel
File metadata and controls
64 lines (59 loc) · 2.77 KB
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
module(name = "bazel_tooling")
bazel_dep(name = "bazel_skylib", version = "1.8.2")
bazel_dep(name = "platforms", version = "1.1.0")
bazel_dep(name = "rules_scala", version = "7.2.5")
bazel_dep(name = "rules_java", version = "9.6.1")
scala_config = use_extension(
"@rules_scala//scala/extensions:config.bzl",
"scala_config",
)
use_repo(scala_config, "rules_scala_config")
# Scalafix (see //scalafix). Two separate maven universes are needed:
# - scalafix_cli_maven: everything needed to *run* the Scalafix CLI (includes the Scala 2.13 library).
# - scalafix_rules_maven: only what is needed to *compile* Scalafix rules with the Scala 3 toolchain.
# The Scala library must not be part of it, rules_scala provides the right one.
bazel_dep(name = "rules_jvm_external", version = "7.0")
SCALAFIX_VERSION = "0.14.9"
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
name = "scalafix_cli_maven",
artifacts = [
"ch.epfl.scala:scalafix-cli_2.13.18:{}".format(SCALAFIX_VERSION),
],
lock_file = "//:scalafix_cli_maven_install.json",
repositories = ["https://repo1.maven.org/maven2"],
)
maven.install(
name = "scalafix_rules_maven",
artifacts = [
"ch.epfl.scala:scalafix-core_2.13:{}".format(SCALAFIX_VERSION),
# The testkit is published per full Scala version. Only the Scala 3 version current at the scalafix
# release date exists (0.14.9 ships 3.3.8 and 3.8.4), so an exact match with our Scala version is generally
# unavailable. A patch mismatch is harmless: patches within a Scala 3 minor are binary/TASTy compatible.
# TODO: Revisit on a new Scala 3 minor.
"ch.epfl.scala:scalafix-testkit_3.8.4:{}".format(SCALAFIX_VERSION),
],
excluded_artifacts = [
"org.scala-lang:scala3-library_3",
"org.scala-lang:scala-library",
# The testkit is based on ScalaTest. Tests get it from rules_scala (scala_test) instead.
"org.scalatest:scalatest_3",
"org.scalatest:scalatest-core_3",
"org.scalatest:scalatest-diagrams_3",
"org.scalatest:scalatest-featurespec_3",
"org.scalatest:scalatest-flatspec_3",
"org.scalatest:scalatest-freespec_3",
"org.scalatest:scalatest-funspec_3",
"org.scalatest:scalatest-funsuite_3",
"org.scalatest:scalatest-matchers-core_3",
"org.scalatest:scalatest-mustmatchers_3",
"org.scalatest:scalatest-propspec_3",
"org.scalatest:scalatest-refspec_3",
"org.scalatest:scalatest-shouldmatchers_3",
"org.scalatest:scalatest-wordspec_3",
"org.scalactic:scalactic_3",
],
lock_file = "//:scalafix_rules_maven_install.json",
repositories = ["https://repo1.maven.org/maven2"],
)
use_repo(maven, "scalafix_cli_maven", "scalafix_rules_maven")