Skip to content

Commit

Permalink
Ensure that KSP plugins are included in the action inputs (#964)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bencodes committed Apr 26, 2023
1 parent cbf5679 commit f478231
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions kotlin/internal/jvm/plugins.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ def _kt_plugin_to_processorpath(processor):
def _targets_to_annotation_processors(targets):
plugins = []
for t in targets:
if _JavaPluginInfo in t:
if _KspPluginInfo in targets:
# KSP plugins are handled by the KSP Kotlinc compiler plugin
pass
elif _JavaPluginInfo in t:
p = t[_JavaPluginInfo].plugins
if p.processor_jars:
plugins.append(p)
Expand All @@ -50,13 +53,15 @@ def _targets_to_annotation_processors_java_plugin_info(targets):
return [t[_JavaPluginInfo] for t in targets if _JavaPluginInfo in t]

def _targets_to_transitive_runtime_jars(targets):
return depset(
transitive = [
(t[_JavaPluginInfo] if _JavaPluginInfo in t else t[JavaInfo]).plugins.processor_jars
for t in targets
if _JavaPluginInfo in t or JavaInfo in t
],
)
transitive = []
for t in targets:
if _JavaPluginInfo in t:
transitive.append(t[_JavaPluginInfo].plugins.processor_jars)
elif JavaInfo in t:
transitive.append(t[JavaInfo].plugins.processor_jars)
elif _KspPluginInfo in t:
transitive.extend([plugin.plugins.processor_jars for plugin in t[_KspPluginInfo].plugins])
return depset(transitive = transitive)

mappers = struct(
targets_to_annotation_processors = _targets_to_annotation_processors,
Expand Down

0 comments on commit f478231

Please sign in to comment.