@@ -317,6 +317,7 @@ def _run_kapt_builder_actions(
317
317
compile_deps = compile_deps ,
318
318
deps_artifacts = deps_artifacts ,
319
319
annotation_processors = annotation_processors ,
320
+ ksp_options = [],
320
321
transitive_runtime_jars = transitive_runtime_jars ,
321
322
plugins = plugins ,
322
323
outputs = {
@@ -343,6 +344,7 @@ def _run_ksp_builder_actions(
343
344
compile_deps ,
344
345
deps_artifacts ,
345
346
annotation_processors ,
347
+ options ,
346
348
transitive_runtime_jars ,
347
349
plugins ):
348
350
"""Runs KSP using the KotlinBuilder tool
@@ -362,6 +364,7 @@ def _run_ksp_builder_actions(
362
364
compile_deps = compile_deps ,
363
365
deps_artifacts = deps_artifacts ,
364
366
annotation_processors = annotation_processors ,
367
+ ksp_options = options ,
365
368
transitive_runtime_jars = transitive_runtime_jars ,
366
369
plugins = plugins ,
367
370
outputs = {
@@ -383,6 +386,7 @@ def _run_kt_builder_action(
383
386
compile_deps ,
384
387
deps_artifacts ,
385
388
annotation_processors ,
389
+ ksp_options ,
386
390
transitive_runtime_jars ,
387
391
plugins ,
388
392
outputs ,
@@ -408,6 +412,7 @@ def _run_kt_builder_action(
408
412
args .add_all ("--deps_artifacts" , deps_artifacts , omit_if_empty = True )
409
413
args .add_all ("--kotlin_friend_paths" , associates .jars , map_each = _associate_utils .flatten_jars )
410
414
args .add ("--instrument_coverage" , ctx .coverage_instrumented ())
415
+ args .add_all ("--ksp_options" , ksp_options , omit_if_empty = True )
411
416
412
417
# Collect and prepare plugin descriptor for the worker.
413
418
args .add_all (
@@ -535,6 +540,8 @@ def kt_jvm_produce_jar_actions(ctx, rule_kind):
535
540
)
536
541
annotation_processors = _plugin_mappers .targets_to_annotation_processors (ctx .attr .plugins + ctx .attr .deps )
537
542
ksp_annotation_processors = _plugin_mappers .targets_to_ksp_annotation_processors (ctx .attr .plugins + ctx .attr .deps )
543
+ ksp_options = _plugin_mappers .targets_to_ksp_options (ctx .attr .plugins + ctx .attr .deps ).to_list ()
544
+
538
545
transitive_runtime_jars = _plugin_mappers .targets_to_transitive_runtime_jars (ctx .attr .plugins + ctx .attr .deps )
539
546
plugins = ctx .attr .plugins + _exported_plugins (deps = ctx .attr .deps )
540
547
deps_artifacts = _deps_artifacts (toolchains , ctx .attr .deps + associates .targets )
@@ -558,6 +565,7 @@ def kt_jvm_produce_jar_actions(ctx, rule_kind):
558
565
deps_artifacts = deps_artifacts ,
559
566
annotation_processors = annotation_processors ,
560
567
ksp_annotation_processors = ksp_annotation_processors ,
568
+ ksp_options = ksp_options ,
561
569
transitive_runtime_jars = transitive_runtime_jars ,
562
570
plugins = plugins ,
563
571
compile_jar = compile_jar ,
@@ -650,6 +658,7 @@ def _run_kt_java_builder_actions(
650
658
deps_artifacts ,
651
659
annotation_processors ,
652
660
ksp_annotation_processors ,
661
+ ksp_options ,
653
662
transitive_runtime_jars ,
654
663
plugins ,
655
664
compile_jar ,
@@ -699,6 +708,7 @@ def _run_kt_java_builder_actions(
699
708
compile_deps = compile_deps ,
700
709
deps_artifacts = deps_artifacts ,
701
710
annotation_processors = ksp_annotation_processors ,
711
+ options = ksp_options ,
702
712
transitive_runtime_jars = transitive_runtime_jars ,
703
713
plugins = plugins ,
704
714
)
@@ -736,6 +746,7 @@ def _run_kt_java_builder_actions(
736
746
compile_deps = compile_deps ,
737
747
deps_artifacts = deps_artifacts ,
738
748
annotation_processors = [],
749
+ ksp_options = [],
739
750
transitive_runtime_jars = transitive_runtime_jars ,
740
751
plugins = plugins ,
741
752
outputs = outputs ,
0 commit comments