Skip to content

Commit

Permalink
Upgrade bazel to latest stable release (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
shrijeet-tesla authored Jun 2, 2022
1 parent a57223b commit c88ad31
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.4.1
5.1.1
91 changes: 56 additions & 35 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,22 +1,44 @@
# Maven
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("//3rdparty:workspace.bzl", "maven_dependencies")

#-- Skylib begin --#
http_archive(
name = "bazel_skylib",
sha256 = "f7be3474d42aae265405a592bb7da8e171919d74c16f082a5457840f06054728",
url = "https://github.com/bazelbuild/bazel-skylib/releases/download/1.2.1/bazel-skylib-1.2.1.tar.gz",
)

load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")

bazel_skylib_workspace()

load("@bazel_skylib//lib:versions.bzl", "versions")

versions.check(
# Maximum version is inclusive, so set the maximum minor version to 99.
# This allows us to freely switch between minor versions without touching the WORKSPACE file.
maximum_bazel_version = "5.99.0",
minimum_bazel_version = "5.0.0",
)
#-- Skylib end --#

#-- Maven start --#
maven_dependencies()

git_repository(
name = "com_github_johnynek_bazel_jar_jar",
commit = "171f268569384c57c19474b04aebe574d85fde0d",
remote = "git://github.com/johnynek/bazel_jar_jar.git",
remote = "https://github.com/johnynek/bazel_jar_jar.git",
shallow_since = "1594234634 -1000",
)

load("@com_github_johnynek_bazel_jar_jar//:jar_jar.bzl", "jar_jar_repositories")

jar_jar_repositories()
#-- Maven end --#

# Build tools
#-- Build tools start --#
http_file(
name = "buildifier_linux",
executable = True,
Expand All @@ -30,53 +52,52 @@ http_file(
sha256 = "677a4e6dd247bee0ea336e7bdc94bc0b62d8f92c9f6a2f367b9a3ae1468b27ac",
urls = ["https://github.com/bazelbuild/buildtools/releases/download/0.25.0/buildifier.mac"],
)
#-- Build tools end --#

#-- Scala begin --#
# version of the rules themselves, update this as needed to match the bazel version,
# based on https://github.com/bazelbuild/rules_scala#bazel-compatible-versions
rules_scala_version = "a2f5852902f5b9f0302c727eead52ca2c7b6c3e2" # update this as needed
RULES_SCALA_VERSION = "d789f0a4f1e2bd8b2be7ba2fe07473fcc6832c6f"

http_archive(
name = "io_bazel_rules_scala",
sha256 = "8c48283aeb70e7165af48191b0e39b7434b0368718709d1bced5c3781787d8e7",
strip_prefix = "rules_scala-%s" % rules_scala_version,
type = "zip",
url = "https://github.com/bazelbuild/rules_scala/archive/%s.zip" % rules_scala_version,
sha256 = "93bb60b8cfaadf2fa5d8211602cc096f6abc10793894497f96f02f992a8e222f",
strip_prefix = "rules_scala-%s" % RULES_SCALA_VERSION,
url = "https://github.com/bazelbuild/rules_scala/archive/%s.tar.gz" % RULES_SCALA_VERSION,
)

#-- Skylib begin --#
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@io_bazel_rules_scala//:scala_config.bzl", "scala_config")

http_archive(
name = "bazel_skylib",
sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
],
)
scala_config(scala_version = "2.11.12")

load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories")

bazel_skylib_workspace()
#-- Skylib end --#
scala_repositories()

# register default scala toolchain
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")

scala_register_toolchains()

load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories")
load("@io_bazel_rules_scala//testing:scalatest.bzl", "scalatest_repositories", "scalatest_toolchain")

scalatest_repositories()

scalatest_toolchain()
#-- Scala end --#

#-- Protobuf begin --#
RULES_PROTO_VERSION = "c0b62f2f46c85c16cb3b5e9e921f0d00e3101934"

http_archive(
name = "rules_proto",
sha256 = "84a2120575841cc99789353844623a2a7b51571a54194a54fc41fb0a51454069",
strip_prefix = "rules_proto-%s" % RULES_PROTO_VERSION,
url = "https://github.com/bazelbuild/rules_proto/archive/%s.zip" % RULES_PROTO_VERSION,
)

load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")

rules_proto_dependencies()

# Specific SHA256 version of scala from maven, eg. https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.11.12/,
# then get the JAR and run `sha256sum` to generate the SHA here. These are the current defaults, but are specified here
# against future upgrades and compatibility. See https://github.com/bazelbuild/rules_scala#selecting-scala-version for
# more details.
scala_repositories((
"2.11.12",
{
"scala_compiler": "3e892546b72ab547cb77de4d840bcfd05c853e73390fed7370a8f19acb0735a0",
"scala_library": "0b3d6fd42958ee98715ba2ec5fe221f4ca1e694d7c981b0ae0cd68e97baf6dce",
"scala_reflect": "6ba385b450a6311a15c918cf8688b9af9327c6104f0ecbd35933cfcd3095fe04",
},
))
rules_proto_toolchains()
#-- Protobuf end --#

0 comments on commit c88ad31

Please sign in to comment.