Skip to content

[pigeon] Allow multiple output locations for generated Swift #164297

Closed
flutter/packages
#12720

Description

@JifScharp

Use case

When using Swift for iOS and macOS, it would be nice to be able to specify both folders as output locations.

Proposal

For example:

@ConfigurePigeon(PigeonOptions(
  dartOut: 'lib/messages.g.dart',
  swiftOut: ['ios/Classes/Messages.g.swift', 'macos/Classes/Messages.g.swift'],
))

Activity

  1. stuartmorgan-g commented on Feb 27, 2025

    @stuartmorgan-g
    Contributor

    Could you provide more information about the specific use case for sharing the Pigeon definition, but not the implementation (via darwin/)?

  2. added
    in triagePresently being triaged by the triage team
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    and removed
    in triagePresently being triaged by the triage team
    on Feb 28, 2025
  3. JifScharp commented on Feb 28, 2025

    @JifScharp
    Author

    I actually started out using /darwin, because the original implementation was supposed to be the same for iOS and macOS. However, due to the native libraries involved, the actual implementation diverged heavily, until I split them up.

    So an implementation that uses a native library where the implementation is different for iOS and macOS, or potentially where different libraries are required for iOS and macOS.

  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 28, 2025
  5. darshankawar commented on Mar 27, 2025

    @darshankawar
    Member

    Sorry for coming back late on this issue, as I didn't see this issue in my list to address.
    I'll keep the issue open for team's tracking.

  6. added
    packageflutter/packages repository. See also p: labels.
    c: proposalA detailed proposal for a change to Flutter
    p: pigeonrelated to pigeon messaging codegen tool
    and removed
    in triagePresently being triaged by the triage team
    on Mar 27, 2025
  7. added
    P2Important issues not at the top of the work list
    on Apr 1, 2025
  8. stuartmorgan-g commented on Apr 1, 2025

    @stuartmorgan-g
    Contributor

    So an implementation that uses a native library where the implementation is different for iOS and macOS, or potentially where different libraries are required for iOS and macOS.

    In our own implementations we generally would have different Pigeon files for fundamentally different implementations, but for the more traditional plugin style of having a single cross-platform interface as the language boundary, multiple output locations would be reasonable.

  9. added
    P1High-priority issues at the top of the work list
    and removed
    P2Important issues not at the top of the work list
    on Aug 31, 2026
  10. stuartmorgan-g commented on Aug 31, 2026

    @stuartmorgan-g
    Contributor

    @tarrinneal It turns out this is blocking for switching the create template to Pigeon, because the template generation allows for generating ios/ and macos/ without generating darwin/, and there's currently no way to make that template work with Pigeon.

    If we don't want the value type to be variable, we could instead make a SwiftOptions entry for a secondary output location.

  11. github-actions commented on Sep 23, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  12. locked as resolved and limited conversation to collaborators on Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: proposalA detailed proposal for a change to Flutterp: pigeonrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions