Browse Source

Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Bazel: Use java_plugin and java_binary from @rules_java in jmh.bzl
  Bazel: Add missing newlines at end of BUILD files

Change-Id: Ic1dc84a6c4a1cf430d329627642583fd6e0d0eaa
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-5.2
David Pursehouse 5 years ago
parent
commit
da06f23c92
  1. 2
      lib/jmh/BUILD
  2. 2
      org.eclipse.jgit.benchmarks/BUILD
  3. 8
      tools/bzl/jmh.bzl

2
lib/jmh/BUILD

@ -9,4 +9,4 @@ java_library(
"@jopt//jar",
"@math3//jar",
],
)
)

2
org.eclipse.jgit.benchmarks/BUILD

@ -10,4 +10,4 @@ jmh_java_benchmarks(
deps = [
"//org.eclipse.jgit:jgit",
],
)
)

8
tools/bzl/jmh.bzl

@ -41,6 +41,8 @@
# Definitions to run jmh microbenchmarks
load("@rules_java//java:defs.bzl", "java_binary", "java_plugin")
def jmh_java_benchmarks(name, srcs, deps = [], tags = [], plugins = [], **kwargs):
"""Builds runnable JMH benchmarks.
This rule builds a runnable target for one or more JMH benchmarks
@ -48,14 +50,14 @@ def jmh_java_benchmarks(name, srcs, deps = [], tags = [], plugins = [], **kwargs
except for main_class.
"""
plugin_name = "_{}_jmh_annotation_processor".format(name)
native.java_plugin(
java_plugin(
name = plugin_name,
deps = ["//lib/jmh:jmh"],
processor_class = "org.openjdk.jmh.generators.BenchmarkProcessor",
visibility = ["//visibility:private"],
tags = tags,
)
native.java_binary(
java_binary(
name = name,
srcs = srcs,
main_class = "org.openjdk.jmh.Main",
@ -63,4 +65,4 @@ def jmh_java_benchmarks(name, srcs, deps = [], tags = [], plugins = [], **kwargs
plugins = plugins + [plugin_name],
tags = tags,
**kwargs
)
)

Loading…
Cancel
Save