-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathMODULE.bazel
More file actions
137 lines (118 loc) · 5.09 KB
/
MODULE.bazel
File metadata and controls
137 lines (118 loc) · 5.09 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
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
module(name = "rules_twirl")
bazel_dep(name = "bazel_skylib", version = "1.8.1")
bazel_dep(name = "rules_java", version = "8.16.1")
bazel_dep(name = "rules_jvm_external", version = "6.9")
bazel_dep(name = "rules_scala_annex")
rules_scala_annex_version = "lucid_2025-10-03"
archive_override(
module_name = "rules_scala_annex",
integrity = "sha256-801JLX227kZgVc2QCzd1JZuQ3huVAOKOdYtCFiXQ/TI=",
strip_prefix = "rules_scala-{}".format(rules_scala_annex_version),
urls = ["https://github.com/lucidsoftware/rules_scala/archive/{}.zip".format(rules_scala_annex_version)],
)
bazel_dep(name = "buildifier_prebuilt", version = "8.2.1.1", dev_dependency = True)
bazel_dep(name = "rules_pkg", version = "1.1.0", dev_dependency = True)
bazel_dep(name = "stardoc", version = "0.8.0", dev_dependency = True)
register_toolchains(
"//:repository_default_toolchain_21_definition",
"//scala:zinc_2_13",
"//scala:zinc_3",
"//twirl-toolchain:twirl-2-13",
"//twirl-toolchain:twirl-3",
)
# Please ensure these stay up-to-date with the versions in `versions.bzl`. Unfortunately,
# `MODULE.bazel` files can't call `load`, so we have to copy them here.
scala_2_13_version = "2.13.18"
scala_3_version = "3.3.7"
twirl_version = "2.0.9"
protobuf_version = "4.33.2"
scopt_version = "4.1.0"
specs2_version = "4.23.0"
zinc_version = "1.11.0"
twirl_compiler_cli_2_13 = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
twirl_compiler_cli_2_13.install(
name = "twirl_compiler_cli_2_13",
artifacts = [
"com.github.scopt:scopt_2.13:{}".format(scopt_version),
"com.google.protobuf:protobuf-java:{}".format(protobuf_version),
"org.playframework.twirl:twirl-compiler_2.13:{}".format(twirl_version),
"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-sbt:compiler-interface:{}".format(zinc_version),
"org.scala-sbt:util-interface:{}".format(zinc_version),
"org.scala-sbt:zinc_2.13:{}".format(zinc_version),
],
fail_if_repin_required = True,
fetch_sources = True,
lock_file = "@rules_twirl//:twirl_compiler_cli_2_13_install.json",
repositories = ["https://repo.maven.apache.org/maven2"],
)
# Set neverlink = True to avoid Scala 2 library being pulled on to the wrong compiler classpath
twirl_compiler_cli_2_13.artifact(
name = "twirl_compiler_cli_2_13",
artifact = "compiler-bridge_2.13",
group = "org.scala-sbt",
neverlink = True,
version = zinc_version,
)
use_repo(twirl_compiler_cli_2_13, "twirl_compiler_cli_2_13")
twirl_compiler_cli_3 = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
twirl_compiler_cli_3.install(
name = "twirl_compiler_cli_3",
artifacts = [
"com.github.scopt:scopt_3:{}".format(scopt_version),
"com.google.protobuf:protobuf-java:{}".format(protobuf_version),
"org.playframework.twirl:twirl-compiler_3:{}".format(twirl_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:util-interface:{}".format(zinc_version),
"org.scala-sbt:zinc_2.13:{}".format(zinc_version),
],
fail_if_repin_required = True,
fetch_sources = True,
lock_file = "@rules_twirl//:twirl_compiler_cli_3_install.json",
repositories = ["https://repo.maven.apache.org/maven2"],
)
# Set neverlink = True to avoid Scala 2 library being pulled on to the compiler classpath
twirl_compiler_cli_3.artifact(
name = "twirl_compiler_cli_3",
artifact = "scala3-sbt-bridge",
group = "org.scala-lang",
neverlink = True,
version = scala_3_version,
)
use_repo(twirl_compiler_cli_3, "twirl_compiler_cli_3")
twirl_test_2_13_artifacts, twirl_test_3_artifacts = [
[
"org.playframework.twirl:twirl-api_{}:{}".format(scala_version, twirl_version),
"org.specs2:specs2-common_{}:{}".format(scala_version, specs2_version),
"org.specs2:specs2-core_{}:{}".format(scala_version, specs2_version),
"org.specs2:specs2-matcher_{}:{}".format(scala_version, specs2_version),
]
for scala_version in [
"2.13",
"3",
]
]
twirl_test_2_13 = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
twirl_test_2_13.install(
name = "twirl_test_2_13",
artifacts = twirl_test_2_13_artifacts,
fail_if_repin_required = True,
fetch_sources = True,
lock_file = "@rules_twirl//:twirl_test_2_13_install.json",
repositories = ["https://repo.maven.apache.org/maven2"],
)
use_repo(twirl_test_2_13, "twirl_test_2_13")
twirl_test_3 = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
twirl_test_3.install(
name = "twirl_test_3",
artifacts = twirl_test_3_artifacts,
fail_if_repin_required = True,
fetch_sources = True,
lock_file = "@rules_twirl//:twirl_test_3_install.json",
repositories = ["https://repo.maven.apache.org/maven2"],
)
use_repo(twirl_test_3, "twirl_test_3")