Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override the version of JOPT Simple from scala_rules #6621

Merged
merged 3 commits into from
Jul 6, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,9 @@ load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")

scala_register_toolchains()

load("@io_bazel_rules_scala//jmh:jmh.bzl", "jmh_repositories")
load("//bazel_tools:scala.bzl", "da_jmh_repositories")

jmh_repositories()
da_jmh_repositories()

load("@io_bazel_rules_docker//repositories:repositories.bzl", container_repositories = "repositories")

Expand Down
22 changes: 22 additions & 0 deletions bazel_tools/scala.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ load(
"scala_test",
"scala_test_suite",
)
load(
"@io_bazel_rules_scala//scala:scala_maven_import_external.bzl",
"scala_maven_import_external",
)
load(
"@io_bazel_rules_scala//jmh:jmh.bzl",
"jmh_repositories",
"scala_benchmark_jmh",
)
load("//bazel_tools:pom_file.bzl", "pom_file")
Expand Down Expand Up @@ -572,3 +577,20 @@ def da_scala_test_suite(initial_heap_size = default_initial_heap_size, max_heap_
# just a matter of passing the flag in
def da_scala_benchmark_jmh(**kwargs):
_wrap_rule_no_plugins(scala_benchmark_jmh, **kwargs)

# We override the version of JOPT simple.
# JMH is built against version 4.6, but scala rules import version 5.0.3
def da_jmh_repositories(maven_servers = ["https://repo.maven.apache.org/maven2"]):
jmh_repositories(maven_servers)
scala_maven_import_external(
name = "io_bazel_rules_scala_net_sf_jopt_simple_jopt_simple",
artifact = "net.sf.jopt-simple:jopt-simple:4.6",
artifact_sha256 = "3fcfbe3203c2ea521bf7640484fd35d6303186ea2e08e72f032d640ca067ffda",
licenses = ["notice"],
server_urls = maven_servers,
)
native.bind(
name =
"io_bazel_rules_scala/dependency/jmh/net_sf_jopt_simple_jopt_simple",
actual = "@io_bazel_rules_scala_net_sf_jopt_simple_jopt_simple//jar",
)