diff --git a/jmh/jmh.bzl b/jmh/jmh.bzl index 2bd8c6fba..58ac7fc3e 100644 --- a/jmh/jmh.bzl +++ b/jmh/jmh.bzl @@ -76,13 +76,9 @@ def jmh_repositories(maven_servers = ["http://central.maven.org/maven2"]): ) def _scala_construct_runtime_classpath(deps): - scala_targets = [d.scala for d in deps if hasattr(d, "scala")] - java_targets = [d.java for d in deps if hasattr(d, "java")] files = [] - for scala in scala_targets: - files.append(scala.transitive_runtime_jars) - for java in java_targets: - files.append(java.transitive_runtime_deps) + [files.append(target[JavaInfo].transitive_runtime_deps) for target in deps if JavaInfo in target] + return depset(transitive = files) def _scala_generate_benchmark(ctx): diff --git a/scala/private/common.bzl b/scala/private/common.bzl index 4b4aa84b5..e449178c6 100644 --- a/scala/private/common.bzl +++ b/scala/private/common.bzl @@ -42,10 +42,8 @@ def collect_plugin_paths(plugins): for p in plugins: if hasattr(p, "path"): paths.append(p) - elif hasattr(p, "scala"): - paths.extend([j.class_jar for j in p.scala.outputs.jars]) - elif hasattr(p, "java"): - paths.extend([j.class_jar for j in p.java.outputs.jars]) + elif JavaInfo in p: + paths.extend([j.class_jar for j in p[JavaInfo].outputs.jars]) # support http_file pointed at a jar. http_jar uses ijar, # which breaks scala macros