Skip to content

Commit

Permalink
Remove deprecated targets from jdk.BUILD.
Browse files Browse the repository at this point in the history
These have been deprecated for more than 4 years (fc8a927).

Closes bazelbuild#17098.

PiperOrigin-RevId: 516615484
Change-Id: Ia1db98a885a37aa6169847e54cf54ecbfcbe3179
  • Loading branch information
benjaminp authored and copybara-github committed Mar 14, 2023
1 parent 96d73da commit 844b5d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 179 deletions.
29 changes: 0 additions & 29 deletions tools/jdk/BUILD.tools
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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",
Expand Down
161 changes: 11 additions & 150 deletions tools/jdk/jdk.BUILD
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -162,7 +29,7 @@ filegroup(
),
)

#This folder holds security policies
# This folder holds security policies.
filegroup(
name = "jdk-conf",
srcs = glob(
Expand Down Expand Up @@ -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"],
)

0 comments on commit 844b5d2

Please sign in to comment.