Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary Java runtime dependencies #1000

Merged
merged 1 commit into from
Aug 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions kotlin/internal/jvm/jvm.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ _implicit_deps = {
default = Label("@bazel_tools//tools/jdk:current_java_runtime"),
cfg = "exec",
),
}

_runnable_implicit_deps = {
"_java_runtime": attr.label(
default = Label("@bazel_tools//tools/jdk:current_java_runtime"),
),
Expand Down Expand Up @@ -269,7 +272,7 @@ this is not transitive""",
),
})

_runnable_common_attr = utils.add_dicts(_common_attr, {
_runnable_common_attr = utils.add_dicts(_common_attr, _runnable_implicit_deps, {
"jvm_flags": attr.string_list(
doc = """A list of flags to embed in the wrapper script generated for running this binary. Note: does not yet
support make variable substitution.""",
Expand All @@ -287,6 +290,9 @@ _common_outputs = dict(
_common_toolchains = [
_TOOLCHAIN_TYPE,
_JAVA_TOOLCHAIN_TYPE,
]

_runnable_common_toolchains = [
_JAVA_RUNTIME_TOOLCHAIN_TYPE,
]

Expand Down Expand Up @@ -318,7 +324,7 @@ It is appropriate for building workspace utilities. `java_binary` should be pref
}.items()),
executable = True,
outputs = _common_outputs,
toolchains = _common_toolchains,
toolchains = _common_toolchains + _runnable_common_toolchains,
fragments = ["java"], # Required fragments of the target configuration
host_fragments = ["java"], # Required fragments of the host configuration
implementation = _kt_jvm_binary_impl,
Expand Down Expand Up @@ -353,7 +359,7 @@ Setup a simple kotlin_test.
executable = True,
outputs = _common_outputs,
test = True,
toolchains = _common_toolchains,
toolchains = _common_toolchains + _runnable_common_toolchains,
implementation = _kt_jvm_junit_test_impl,
fragments = ["java"], # Required fragments of the target configuration
host_fragments = ["java"], # Required fragments of the host configuration
Expand Down