forked from higherkindness/rules_scala
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from lucidsoftware/bzlmod-migration
Migrate to Bzlmod
- Loading branch information
Showing
80 changed files
with
3,146 additions
and
2,452 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,147 @@ | ||
############################################################################### | ||
# Bazel now uses Bzlmod by default to manage external dependencies. | ||
# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. | ||
# | ||
# For more details, please check https://github.com/bazelbuild/bazel/issues/18958 | ||
############################################################################### | ||
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], | ||
) |
Oops, something went wrong.