Add `load()` statements for the builtin Bazel java rules

Loads are being added in preparation for moving the rules out of Bazel and into `rules_java`.

PiperOrigin-RevId: 621541265
pull/16377/head
Protobuf Team Bot 8 months ago committed by Copybara-Service
parent bc7a60c6d5
commit 1ebec9a4c3
  1. 7
      java/internal/testing.bzl

@ -2,6 +2,9 @@
Generates a side-car JUnit suite test runner class for each
input src.
"""
load("@rules_java//java:defs.bzl", "java_library", "java_test")
_template = """import org.junit.runners.Suite;
import org.junit.runner.RunWith;
@ -36,7 +39,7 @@ _gen_suite = rule(
def junit_tests(name, srcs, data = [], deps = [], package_name = "com.google.protobuf", test_prefix = None, **kwargs):
testlib_name = "%s_lib" % name
native.java_library(
java_library(
name = testlib_name,
srcs = srcs,
deps = deps,
@ -59,7 +62,7 @@ def junit_tests(name, srcs, data = [], deps = [], package_name = "com.google.pro
package_name = package_name,
outname = suite_name,
)
native.java_test(
java_test(
name = test_name,
test_class = suite_name,
srcs = [src] + [":" + suite_name],

Loading…
Cancel
Save