From 844b5d2dbc3ff1dda43d78b81a00c6323e4e8115 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Tue, 14 Mar 2023 13:23:14 -0700 Subject: [PATCH] Remove deprecated targets from jdk.BUILD. These have been deprecated for more than 4 years (fc8a927ea42d47535d4e4416cb123e6f7b936b13). Closes #17098. PiperOrigin-RevId: 516615484 Change-Id: Ia1db98a885a37aa6169847e54cf54ecbfcbe3179 --- tools/jdk/BUILD.tools | 29 -------- tools/jdk/jdk.BUILD | 161 +++--------------------------------------- 2 files changed, 11 insertions(+), 179 deletions(-) diff --git a/tools/jdk/BUILD.tools b/tools/jdk/BUILD.tools index 5dc0d6c17da84d..61aa9ff6962050 100644 --- a/tools/jdk/BUILD.tools +++ b/tools/jdk/BUILD.tools @@ -116,21 +116,6 @@ cc_library( }), ) -alias( - name = "java", - actual = "@local_jdk//:java", -) - -alias( - name = "jar", - actual = "@local_jdk//:jar", -) - -alias( - name = "javadoc", - actual = "@local_jdk//:javadoc", -) - [ ( alias( @@ -274,20 +259,6 @@ alias( actual = "@remote_java_tools//:proguard", ) -BOOTCLASS_JARS = [ - "rt.jar", - "resources.jar", - "jsse.jar", - "jce.jar", - "charsets.jar", -] - -# TODO(cushon): this isn't compatible with JDK 9 -alias( - name = "bootclasspath", - actual = "@local_jdk//:bootclasspath", -) - alias( name = "jre", actual = "@local_jdk//:jre", diff --git a/tools/jdk/jdk.BUILD b/tools/jdk/jdk.BUILD index 2e2745f8237bba..427da22cbb9086 100644 --- a/tools/jdk/jdk.BUILD +++ b/tools/jdk/jdk.BUILD @@ -1,157 +1,24 @@ -load("@rules_java//java:defs.bzl", "java_import", "java_runtime") +load("@rules_java//java:defs.bzl", "java_runtime") package(default_visibility = ["//visibility:public"]) exports_files(["BUILD.bazel"]) -DEPRECATION_MESSAGE = ("Don't depend on targets in the JDK workspace;" + - " use @bazel_tools//tools/jdk:current_java_runtime instead" + - " (see https://github.com/bazelbuild/bazel/issues/5594)") - -filegroup( - name = "jni_header", - srcs = ["include/jni.h"], - deprecation = DEPRECATION_MESSAGE, -) - -filegroup( - name = "jni_md_header-darwin", - srcs = ["include/darwin/jni_md.h"], - deprecation = DEPRECATION_MESSAGE, -) - -filegroup( - name = "jni_md_header-linux", - srcs = ["include/linux/jni_md.h"], - deprecation = DEPRECATION_MESSAGE, -) - -filegroup( - name = "jni_md_header-freebsd", - srcs = ["include/freebsd/jni_md.h"], - deprecation = DEPRECATION_MESSAGE, -) - -filegroup( - name = "jni_md_header-openbsd", - srcs = ["include/openbsd/jni_md.h"], - deprecation = DEPRECATION_MESSAGE, -) - -filegroup( - name = "jni_md_header-windows", - srcs = ["include/win32/jni_md.h"], - deprecation = DEPRECATION_MESSAGE, -) - -filegroup( - name = "java", - srcs = select({ - ":windows": ["bin/java.exe"], - "//conditions:default": ["bin/java"], - }), - data = [":jdk"], - deprecation = DEPRECATION_MESSAGE, -) - -filegroup( - name = "jar", - srcs = select({ - ":windows": ["bin/jar.exe"], - "//conditions:default": ["bin/jar"], - }), - data = [":jdk"], - deprecation = DEPRECATION_MESSAGE, -) - -filegroup( - name = "javac", - srcs = select({ - ":windows": ["bin/javac.exe"], - "//conditions:default": ["bin/javac"], - }), - data = [":jdk"], - deprecation = DEPRECATION_MESSAGE, -) - -filegroup( - name = "javadoc", - srcs = select({ - ":windows": ["bin/javadoc.exe"], - "//conditions:default": ["bin/javadoc"], - }), - data = [":jdk"], - deprecation = DEPRECATION_MESSAGE, -) - filegroup( - name = "xjc", - srcs = ["bin/xjc"], - deprecation = DEPRECATION_MESSAGE, -) - -filegroup( - name = "wsimport", - srcs = ["bin/wsimport"], - deprecation = DEPRECATION_MESSAGE, -) - -BOOTCLASS_JARS = [ - "rt.jar", - "resources.jar", - "jsse.jar", - "jce.jar", - "charsets.jar", -] - -# TODO(cushon): this isn't compatible with JDK 9 -filegroup( - name = "bootclasspath", - srcs = ["jre/lib/%s" % jar for jar in BOOTCLASS_JARS], - deprecation = DEPRECATION_MESSAGE, -) - -filegroup( - name = "jre-bin", - srcs = select({ + name = "jre", + srcs = glob( + [ + "jre/bin/**", + "jre/lib/**", + ], + allow_empty = True, # In some configurations, Java browser plugin is considered harmful and # common antivirus software blocks access to npjp2.dll interfering with Bazel, # so do not include it in JRE on Windows. - ":windows": glob( - ["jre/bin/**"], - allow_empty = True, - exclude = ["jre/bin/plugin2/**"], - ), - "//conditions:default": glob( - ["jre/bin/**"], - allow_empty = True, - ), - }), - deprecation = DEPRECATION_MESSAGE, -) - -filegroup( - name = "jre-lib", - srcs = glob( - ["jre/lib/**"], - allow_empty = True, + exclude = ["jre/bin/plugin2/**"], ), ) -filegroup( - name = "jre", - srcs = [":jre-default"], -) - -filegroup( - name = "jre-default", - srcs = [ - ":jre-bin", - ":jre-lib", - ], - deprecation = DEPRECATION_MESSAGE, -) - filegroup( name = "jdk-bin", srcs = glob( @@ -162,7 +29,7 @@ filegroup( ), ) -#This folder holds security policies +# This folder holds security policies. filegroup( name = "jdk-conf", srcs = glob( @@ -198,12 +65,6 @@ java_runtime( ":jdk-conf", ":jdk-include", ":jdk-lib", - ":jre-default", + ":jre", ], ) - -config_setting( - name = "windows", - constraint_values = ["@platforms//os:windows"], - visibility = ["//visibility:private"], -)