Skip to content

[pigeon] add support for multiple swift outputs - #12720

Open
tarrinneal wants to merge 3 commits into
flutter:mainfrom
tarrinneal:multi-output-swift
Open

[pigeon] add support for multiple swift outputs#12720
tarrinneal wants to merge 3 commits into
flutter:mainfrom
tarrinneal:multi-output-swift

Conversation

@tarrinneal

Copy link
Copy Markdown
Contributor

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Sep 2, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for multiple output locations in the Swift generator via swiftOut and --swift_out. It updates option parsing, internal option models, and generation adapters to handle multiple paths, and adds corresponding unit tests. The review feedback suggests improving Windows compatibility by using platform-agnostic path.join instead of path.posix.join for file operations, and replacing backslashes with forward slashes before extracting file names from paths.

Comment thread packages/pigeon/lib/src/pigeon_lib_internal.dart Outdated
Comment thread packages/pigeon/lib/src/swift/swift_generator.dart Outdated

@stuartmorgan-g stuartmorgan-g left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but please add a mention of this option in a readme. Probably here, as a comment above the swiftOut line in the block saying it can be an array to output to separate iOS and macOS locations if required.

Comment thread packages/pigeon/lib/src/pigeon_lib.dart Outdated
);
final content = buffer.toString();
sink.write(content);
for (final String outputPath in outputs.skip(1)) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could use an implementation comment; I don't think it's obvious in this context that the sink was created from the first entry in outputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[pigeon] Allow multiple output locations for generated Swift

2 participants