mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:50:54 +07:00
[rules_jvm] Don't pass obsolete --rule_kind argument to jvm-builder
GitOrigin-RevId: 2459a610403377b21afc241607d1e6beb8b1769b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4998e98aa0
commit
aa21682ad5
@@ -5,15 +5,13 @@ load("//:rules/impl/kotlinc-options.bzl", "KotlincOptions", "kotlinc_options_to_
|
||||
|
||||
visibility("private")
|
||||
|
||||
def init_builder_args(ctx, rule_kind, associates, transitiveInputs, plugins, compile_deps):
|
||||
def init_builder_args(ctx, associates, transitiveInputs, plugins, compile_deps):
|
||||
"""Initialize an arg object for a task that will be executed by the Kotlin Builder."""
|
||||
args = ctx.actions.args()
|
||||
args.set_param_file_format("multiline")
|
||||
args.use_param_file("--flagfile=%s", use_always = True)
|
||||
|
||||
args.add("--target_label", ctx.label)
|
||||
if rule_kind != "kt_jvm_library":
|
||||
args.add("--rule_kind", rule_kind)
|
||||
args.add("--kotlin_module_name", associates.module_name)
|
||||
|
||||
kotlinc_options = ctx.attr.kotlinc_opts[KotlincOptions]
|
||||
|
||||
@@ -173,12 +173,11 @@ def _new_plugin_from(plugin_id_to_configuration, plugins_for_phase):
|
||||
options = options,
|
||||
)
|
||||
|
||||
def kt_jvm_produce_jar_actions(ctx, rule_kind):
|
||||
def kt_jvm_produce_jar_actions(ctx):
|
||||
"""This macro sets up a compile action for a Kotlin jar.
|
||||
|
||||
Args:
|
||||
ctx: Invoking rule ctx, used for attr, actions, and label.
|
||||
rule_kind: The rule kind --e.g., `kt_jvm_library`.
|
||||
Returns:
|
||||
A struct containing the providers JavaInfo (`java`) and `kt` (KtJvmInfo). This struct is not intended to be
|
||||
used as a legacy provider -- rather the caller should transform the result.
|
||||
@@ -204,7 +203,6 @@ def kt_jvm_produce_jar_actions(ctx, rule_kind):
|
||||
compile_jar = _run_jvm_builder(
|
||||
ctx = ctx,
|
||||
output_jar = output_jar,
|
||||
rule_kind = rule_kind,
|
||||
srcs = srcs,
|
||||
associates = associates,
|
||||
compile_deps = compile_deps,
|
||||
@@ -257,7 +255,6 @@ def kt_jvm_produce_jar_actions(ctx, rule_kind):
|
||||
def _run_jvm_builder(
|
||||
ctx,
|
||||
output_jar,
|
||||
rule_kind,
|
||||
srcs,
|
||||
associates,
|
||||
compile_deps,
|
||||
@@ -275,7 +272,7 @@ def _run_jvm_builder(
|
||||
kotlin_inc_threshold = kotlinc_options.inc_threshold
|
||||
java_inc_threshold = ctx.attr._java_inc_threshold[BuildSettingInfo].value
|
||||
|
||||
args = init_builder_args(ctx, rule_kind, associates, transitiveInputs, plugins = plugins, compile_deps = compile_deps)
|
||||
args = init_builder_args(ctx, associates, transitiveInputs, plugins = plugins, compile_deps = compile_deps)
|
||||
args.add("--out", output_jar)
|
||||
|
||||
outputs = [output_jar]
|
||||
|
||||
@@ -26,7 +26,7 @@ def _jvm_library(ctx):
|
||||
if ctx.attr.neverlink and ctx.attr.runtime_deps:
|
||||
fail("runtime_deps and neverlink is nonsensical.", attr = "runtime_deps")
|
||||
|
||||
return _make_providers(ctx, kt_jvm_produce_jar_actions(ctx, "kt_jvm_library"))
|
||||
return _make_providers(ctx, kt_jvm_produce_jar_actions(ctx))
|
||||
|
||||
jvm_library = rule(
|
||||
doc = """This rule compiles and links Kotlin and Java sources into a .jar file.""",
|
||||
|
||||
@@ -75,7 +75,7 @@ def _write_launcher_action(ctx, rjars, main_class, jvm_flags):
|
||||
return []
|
||||
|
||||
def _jvm_test(ctx):
|
||||
providers = kt_jvm_produce_jar_actions(ctx, "kt_jvm_test")
|
||||
providers = kt_jvm_produce_jar_actions(ctx)
|
||||
runtime_jars = depset(ctx.files._bazel_test_runner, transitive = [providers.java.transitive_runtime_jars])
|
||||
|
||||
# coverage_runfiles = []
|
||||
|
||||
Reference in New Issue
Block a user