Skip to content

Commit

Permalink
Merge branch 'stable-5.3' into stable-5.4
Browse files Browse the repository at this point in the history
* stable-5.3:
  Bazel: Use java_plugin and java_binary from @rules_java in jmh.bzl
  Bazel: Add missing newlines at end of BUILD files

Change-Id: I21878c42fd9abf7d858b534300df0fffe4bad431
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
  • Loading branch information
dpursehouse committed Nov 26, 2019
2 parents 155ed93 + 8393594 commit 3c78d62
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/jmh/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ java_library(
"@jopt//jar",
"@math3//jar",
],
)
)
2 changes: 1 addition & 1 deletion org.eclipse.jgit.benchmarks/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jmh_java_benchmarks(
deps = [
"//org.eclipse.jgit:jgit",
],
)
)
8 changes: 5 additions & 3 deletions tools/bzl/jmh.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,28 @@

# 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
specified as srcs. It takes the same arguments as java_binary,
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",
deps = deps + ["//lib/jmh:jmh"],
plugins = plugins + [plugin_name],
tags = tags,
**kwargs
)
)

0 comments on commit 3c78d62

Please sign in to comment.