Skip to content

Commit

Permalink
Encode a pluginProperties for each processor
Browse files Browse the repository at this point in the history
Reviewed By: IanChilds

Differential Revision: D53010672

fbshipit-source-id: 63254c90ec7f2691076a8af43b8004812647a164
  • Loading branch information
Nate Stedman authored and facebook-github-bot committed Jan 25, 2024
1 parent 81b5f94 commit 37b3eda
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions prelude/jvm/cd_jar_creator_util.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -250,22 +250,27 @@ def encode_ap_params(annotation_processor_properties: AnnotationProcessorPropert
return encoded_ap_params

def encode_plugin_params(plugin_params: [PluginParams, None]) -> [struct, None]:
# TODO(cjhopman): We should change plugins to not be merged together just like APs.
encoded_plugin_params = None
if plugin_params:
encoded_plugin_params = struct(
parameters = [],
pluginProperties = [struct(
canReuseClassLoader = False,
doesNotAffectAbi = False,
supportsAbiGenerationFromSource = False,
processorNames = plugin_params.processors,
classpath = plugin_params.deps.project_as_json("javacd_json") if plugin_params.deps else [],
pathParams = {},
)],
pluginProperties = [
encode_plugin_properties(processor, plugin_params)
for processor in plugin_params.processors
],
)
return encoded_plugin_params

def encode_plugin_properties(processor: str, plugin_params: PluginParams) -> struct:
return struct(
canReuseClassLoader = False,
doesNotAffectAbi = False,
supportsAbiGenerationFromSource = False,
processorNames = [processor],
classpath = plugin_params.deps.project_as_json("javacd_json") if plugin_params.deps else [],
pathParams = {},
)

def encode_base_jar_command(
javac_tool: [str, RunInfo, Artifact, None],
target_type: TargetType,
Expand Down

0 comments on commit 37b3eda

Please sign in to comment.