Skip to content

Commit fd7f73f

Browse files
Correct the symlink’d outputs from _framework_packaging
1 parent aa4a7c6 commit fd7f73f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

rules/framework.bzl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,15 @@ def _framework_packaging(ctx, action, inputs, outputs, manifest = None):
162162
if action in ctx.attr.skip_packaging:
163163
return []
164164
action_inputs = [manifest] + inputs if manifest else inputs
165-
outputs = [ctx.actions.declare_file(f) for f in outputs]
165+
166+
# Use the input to determine whether to use `declare_directory` or `declare_file`
167+
# since it'll need to match in the downstream symlink action.
168+
outputs_by_index = {index: outputs[index] for index in range(len(outputs))}
169+
outputs = [
170+
ctx.actions.declare_directory(output) if inputs[index].is_directory else ctx.actions.declare_file(output)
171+
for (index, output) in outputs_by_index.items()
172+
]
173+
166174
framework_name = ctx.attr.framework_name
167175
framework_dir = _find_framework_dir(outputs)
168176
args = ctx.actions.args().use_param_file("@%s").set_param_file_format("multiline")

0 commit comments

Comments
 (0)