forked from higherkindness/rules_scala
-
Notifications
You must be signed in to change notification settings - Fork 6
/
MODULE.bazel
147 lines (127 loc) · 5.5 KB
/
MODULE.bazel
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
module(name = "rules_scala_annex")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "buildifier_prebuilt", version = "7.3.1", dev_dependency = True)
bazel_dep(name = "rules_java", version = "7.12.2")
bazel_dep(name = "rules_jvm_external", version = "6.5")
bazel_dep(name = "rules_pkg", version = "1.0.1", dev_dependency = True)
bazel_dep(name = "stardoc", version = "0.7.1", dev_dependency = True)
register_toolchains(
"//:annex_scalafmt",
"//:repository_default_toolchain_21_definition",
"//rules/scala_proto:scalapb_scala_proto_toolchain",
"//src/main/scala:annex_bootstrap_2_13",
"//src/main/scala:annex_bootstrap_3",
"//src/main/scala:annex_zinc_2_13",
"//src/main/scala:annex_zinc_3",
)
# Please ensure these stay up-to-date with the versions in `/rules/scala/versions.bzl`,
# `/tests/MODULE.bazel`, and `/MODULE.bazel`. Unfortunately, `MODULE.bazel` files can't call `load`,
# so we have to copy them here.
scala_2_12_version = "2.12.19"
scala_2_13_version = "2.13.15"
scala_3_version = "3.5.2"
scalapb_version = "0.11.17"
zinc_version = "1.10.4"
annex = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
annex.install(
name = "annex",
artifacts = [
"ch.epfl.scala:bloop-frontend_2.12:1.0.0",
"com.thesamet.scalapb:lenses_2.13:{}".format(scalapb_version),
"com.thesamet.scalapb:scalapb-runtime_2.13:{}".format(scalapb_version),
"net.sourceforge.argparse4j:argparse4j:0.8.1",
"org.jacoco:org.jacoco.core:0.7.5.201505241946",
"org.scala-lang:scala-compiler:{}".format(scala_2_13_version),
"org.scala-lang:scala-library:{}".format(scala_2_13_version),
"org.scala-lang:scala-reflect:{}".format(scala_2_13_version),
"org.scala-lang:scala3-compiler_3:{}".format(scala_3_version),
"org.scala-lang:scala3-library_3:{}".format(scala_3_version),
"org.scala-sbt:compiler-interface:{}".format(zinc_version),
"org.scala-sbt:io_2.13:1.10.1",
"org.scala-sbt:test-interface:1.0",
"org.scala-sbt:util-interface:{}".format(zinc_version),
"org.scala-sbt:util-logging_2.13:{}".format(zinc_version),
"org.scala-sbt:zinc_2.13:{}".format(zinc_version),
"org.scala-sbt:zinc-apiinfo_2.13:{}".format(zinc_version),
"org.scala-sbt:zinc-classpath_2.13:{}".format(zinc_version),
"org.scala-sbt:zinc-compile-core_2.13:{}".format(zinc_version),
"org.scala-sbt:zinc-core_2.13:{}".format(zinc_version),
"org.scala-sbt:zinc-persist_2.13:{}".format(zinc_version),
],
fetch_sources = True,
lock_file = "//:annex_install.json",
repositories = [
"https://repo.maven.apache.org/maven2",
"https://maven-central.storage-download.googleapis.com/maven2",
"https://mirror.bazel.build/repo1.maven.org/maven2",
],
)
# The compiler bridge has a dependency on compiler-interface, which has a dependency on the Scala 2
# library. We need to set this to neverlink = True to avoid this the Scala 2 library being pulled
# onto the Scala 3, and other Scala versions like 2.12, compiler classpath during runtime.
annex.artifact(
name = "annex",
artifact = "scala3-sbt-bridge",
group = "org.scala-lang",
neverlink = True,
version = scala_3_version,
)
# The compiler bridge has a dependency on compiler-interface, which has a dependency on the Scala 2
# library. We need to set this to neverlink = True to avoid this the Scala 2 library being pulled
# onto the Scala 3, and other Scala versions like 2.12, compiler classpath during runtime.
annex.artifact(
name = "annex",
artifact = "compiler-bridge_2.13",
group = "org.scala-sbt",
neverlink = True,
version = zinc_version,
)
use_repo(annex, "annex")
annex_scalafmt = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
annex_scalafmt.install(
name = "annex_scalafmt",
artifacts = [
"org.scalameta:parsers_2.13:4.9.7",
"org.scalameta:metaconfig-core_2.13:0.13.0",
"org.scalameta:scalafmt-core_2.13:3.8.2",
],
fetch_sources = True,
lock_file = "//:annex_scalafmt_install.json",
repositories = [
"https://repo.maven.apache.org/maven2",
"https://maven-central.storage-download.googleapis.com/maven2",
"https://mirror.bazel.build/repo1.maven.org/maven2",
],
)
use_repo(annex_scalafmt, "annex_scalafmt")
annex_proto = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
annex_proto.install(
name = "annex_proto",
artifacts = [
"com.github.os72:protoc-jar:3.11.4",
"com.thesamet.scalapb:compilerplugin_2.13:0.11.17",
"com.thesamet.scalapb:protoc-bridge_2.13:0.9.7",
],
fetch_sources = True,
lock_file = "//:annex_proto_install.json",
repositories = [
"https://repo.maven.apache.org/maven2",
"https://maven-central.storage-download.googleapis.com/maven2",
"https://mirror.bazel.build/repo1.maven.org/maven2",
],
)
use_repo(annex_proto, "annex_proto")
java_launcher_version = "7.4.1"
java_launcher_template_sha = "ee4aa47ae5e639632c67be5cc0ccbc4e941a67a1b884a1ce0c4329357a4b62b2"
java_stub_template_url = (
"raw.githubusercontent.com/bazelbuild/bazel/" +
java_launcher_version +
"/src/main/java/com/google/devtools/build/lib/bazel/rules/java/" +
"java_stub_template.txt"
)
http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
http_file(
name = "anx_java_stub_template",
sha256 = java_launcher_template_sha,
urls = ["https://%s" % java_stub_template_url],
)