Merge pull request #8396 from Yannic/del-flag

[bazel] Remove deprecated way to depend on googletest
diff --git a/BUILD b/BUILD
index 1124321..07ee629 100644
--- a/BUILD
+++ b/BUILD
@@ -14,38 +14,6 @@
 # build configuration
 ################################################################################
 
-# TODO(yannic): Remove in 3.14.0.
-string_flag(
-    name = "incompatible_use_com_google_googletest",
-    build_setting_default = "true",
-    values = ["true", "false"]
-)
-
-config_setting(
-    name = "use_com_google_googletest",
-    flag_values = {
-        "//:incompatible_use_com_google_googletest": "true"
-    },
-)
-
-GTEST = select({
-    "//:use_com_google_googletest": [
-        "@com_google_googletest//:gtest",
-    ],
-    "//conditions:default": [
-        "//external:gtest",
-    ],
-})
-
-GTEST_MAIN = select({
-    "//:use_com_google_googletest": [
-        "@com_google_googletest//:gtest_main",
-    ],
-    "//conditions:default": [
-        "//external:gtest_main",
-    ],
-})
-
 ################################################################################
 # ZLIB configuration
 ################################################################################
@@ -571,6 +539,7 @@
 
 cc_binary(
     name = "test_plugin",
+    testonly = True,
     srcs = [
         # AUTOGEN(test_plugin_srcs)
         "src/google/protobuf/compiler/mock_code_generator.cc",
@@ -580,7 +549,8 @@
     deps = [
         ":protobuf",
         ":protoc_lib",
-    ] + GTEST,
+        "@com_google_googletest//:gtest",
+    ],
 )
 
 cc_test(
@@ -592,7 +562,9 @@
     ],
     deps = [
         ":protobuf_lite",
-    ] + GTEST_MAIN,
+        "@com_google_googletest//:gtest",
+        "@com_google_googletest//:gtest_main",
+    ],
 )
 
 cc_test(
@@ -695,7 +667,9 @@
         ":cc_test_protos",
         ":protobuf",
         ":protoc_lib",
-    ] + PROTOBUF_DEPS + GTEST_MAIN,
+        "@com_google_googletest//:gtest",
+        "@com_google_googletest//:gtest_main",
+    ] + PROTOBUF_DEPS,
 )
 
 ################################################################################
diff --git a/WORKSPACE b/WORKSPACE
index 5a767a9..d9ed7c8 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -29,18 +29,6 @@
     actual = "//util/python:python_headers",
 )
 
-# TODO(yannic): Remove in 3.14.0.
-bind(
-    name = "gtest",
-    actual = "@com_google_googletest//:gtest",
-)
-
-# TODO(yannic): Remove in 3.14.0.
-bind(
-    name = "gtest_main",
-    actual = "@com_google_googletest//:gtest_main",
-)
-
 jvm_maven_import_external(
     name = "guava_maven",
     artifact = "com.google.guava:guava:18.0",