24
24
load ("@rules_java//java:defs.bzl" , "JavaInfo" , "java_common" )
25
25
load (
26
26
"//kotlin/internal:defs.bzl" ,
27
- _JAVA_RUNTIME_TOOLCHAIN_TYPE = "JAVA_RUNTIME_TOOLCHAIN_TYPE" ,
28
- _JAVA_TOOLCHAIN_TYPE = "JAVA_TOOLCHAIN_TYPE" ,
29
27
_KtCompilerPluginInfo = "KtCompilerPluginInfo" ,
30
28
_KtJvmInfo = "KtJvmInfo" ,
31
29
_KtPluginConfiguration = "KtPluginConfiguration" ,
@@ -436,52 +434,6 @@ def _run_merge_jdeps_action(ctx, toolchains, jdeps, outputs, deps):
436
434
toolchain = _TOOLCHAIN_TYPE ,
437
435
)
438
436
439
- def _run_kapt_builder_actions (
440
- ctx ,
441
- rule_kind ,
442
- toolchains ,
443
- srcs ,
444
- associates ,
445
- compile_deps ,
446
- deps_artifacts ,
447
- annotation_processors ,
448
- transitive_runtime_jars ,
449
- plugins ):
450
- """Runs KAPT using the KotlinBuilder tool
451
- Returns:
452
- A struct containing KAPT outputs
453
- """
454
- ap_generated_src_jar = ctx .actions .declare_file (ctx .label .name + "-kapt-gensrc.jar" )
455
- kapt_generated_stub_jar = ctx .actions .declare_file (ctx .label .name + "-kapt-generated-stub.jar" )
456
- kapt_generated_class_jar = ctx .actions .declare_file (ctx .label .name + "-kapt-generated-class.jar" )
457
-
458
- _run_kt_builder_action (
459
- ctx = ctx ,
460
- rule_kind = rule_kind ,
461
- toolchains = toolchains ,
462
- srcs = srcs ,
463
- generated_src_jars = [],
464
- associates = associates ,
465
- compile_deps = compile_deps ,
466
- deps_artifacts = deps_artifacts ,
467
- annotation_processors = annotation_processors ,
468
- transitive_runtime_jars = transitive_runtime_jars ,
469
- plugins = plugins ,
470
- outputs = {
471
- "generated_java_srcjar" : ap_generated_src_jar ,
472
- "kapt_generated_stub_jar" : kapt_generated_stub_jar ,
473
- "kapt_generated_class_jar" : kapt_generated_class_jar ,
474
- },
475
- build_kotlin = False ,
476
- mnemonic = "KotlinKapt" ,
477
- )
478
-
479
- return struct (
480
- ap_generated_src_jar = ap_generated_src_jar ,
481
- kapt_generated_stub_jar = kapt_generated_stub_jar ,
482
- kapt_generated_class_jar = kapt_generated_class_jar ,
483
- )
484
-
485
437
def _run_ksp_builder_actions (
486
438
ctx ,
487
439
rule_kind ,
@@ -546,10 +498,10 @@ def _run_kt_builder_action(
546
498
args .add ("--" + f , path )
547
499
548
500
experimental_preserve_declaration_order = toolchains .kt .experimental_preserve_declaration_order
549
- if ' kt_experimental_preserve_declaration_order_in_abi_plugin_incompatible' in ctx .attr .tags :
501
+ if " kt_experimental_preserve_declaration_order_in_abi_plugin_incompatible" in ctx .attr .tags :
550
502
experimental_preserve_declaration_order = False
551
503
experimental_remove_data_class_copy_if_constructor_is_private = toolchains .kt .experimental_remove_data_class_copy_if_constructor_is_private
552
- if ' kt_experimental_preserve_declaration_order_in_abi_plugin_incompatible' in ctx .attr .tags :
504
+ if " kt_experimental_preserve_declaration_order_in_abi_plugin_incompatible" in ctx .attr .tags :
553
505
experimental_remove_data_class_copy_if_constructor_is_private = False
554
506
555
507
# Unwrap kotlinc_options/javac_options options or default to the ones being provided by the toolchain
@@ -560,6 +512,7 @@ def _run_kt_builder_action(
560
512
args .add_all ("--classpath" , compile_deps .compile_jars )
561
513
args .add ("--reduced_classpath_mode" , toolchains .kt .experimental_reduce_classpath_mode )
562
514
args .add ("--treat_internal_as_private_in_abi_jar" , toolchains .kt .experimental_treat_internal_as_private_in_abi_jars )
515
+ args .add ("--build_tools_api" , toolchains .kt .experimental_build_tools_api )
563
516
args .add ("--remove_private_classes_in_abi_jar" , toolchains .kt .experimental_remove_private_classes_in_abi_jars )
564
517
args .add ("--preserve_declaration_order" , experimental_preserve_declaration_order )
565
518
args .add ("--remove_data_class_copy_if_constructor_is_private" , experimental_remove_data_class_copy_if_constructor_is_private )
0 commit comments