diff --git a/closure/protobuf_drop_java_7_compatibility.patch b/closure/protobuf_drop_java_7_compatibility.patch new file mode 100644 index 0000000000..d5d1e3aa68 --- /dev/null +++ b/closure/protobuf_drop_java_7_compatibility.patch @@ -0,0 +1,39 @@ +diff --git a/BUILD b/BUILD.bazel +index efc3d8e..2f27833 100644 +--- a/BUILD ++++ b/BUILD.bazel +@@ -653,10 +653,7 @@ java_library( + ], + javacopts = select({ + "//:jdk9": ["--add-modules=jdk.unsupported"], +- "//conditions:default": [ +- "-source 7", +- "-target 7", +- ], ++ "//conditions:default": [], + }), + visibility = ["//visibility:public"], + ) +@@ -754,10 +751,7 @@ java_library( + ], + javacopts = select({ + "//:jdk9": ["--add-modules=jdk.unsupported"], +- "//conditions:default": [ +- "-source 7", +- "-target 7", +- ], ++ "//conditions:default": [], + }), + visibility = ["//visibility:public"], + ) +@@ -767,10 +761,6 @@ java_library( + srcs = glob([ + "java/util/src/main/java/com/google/protobuf/util/*.java", + ]), +- javacopts = [ +- "-source 7", +- "-target 7", +- ], + visibility = ["//visibility:public"], + deps = [ + "protobuf_java", diff --git a/closure/repositories.bzl b/closure/repositories.bzl index 99fd19e0df..cbd63cea1e 100644 --- a/closure/repositories.bzl +++ b/closure/repositories.bzl @@ -738,6 +738,10 @@ def com_google_jsinterop_annotations(): def com_google_protobuf(): http_archive( name = "com_google_protobuf", + patches = [ + "@io_bazel_rules_closure//closure:protobuf_drop_java_7_compatibility.patch", + ], + patch_args = ["-p1"], strip_prefix = "protobuf-3.10.0", sha256 = "758249b537abba2f21ebc2d02555bf080917f0f2f88f4cbe2903e0e28c4187ed", urls = [