Skip to content

[pigeon] Recursively create output target files #128820

@stuartmorgan-g

Description

@stuartmorgan-g

At least the Dart generation, and probably all of the language generation, doesn't create the output file recursively. That leads to confusing flows like the following, which has bitten me several times:

  1. Set up Pigeon for the first time in a plugin that was simple enough to only have a lib/plugin_name.dart file with all of the implementation.
  2. Configure the Dart to output to lib/src/messages.g.dart.
  3. Run Pigeon generation.
  4. Get an error about lib/src/messages.g.dart not existing. (The actual problem is that lib/src/ doesn't exist, so it can't make the file).

We should do a create(recursive: true) on the target File before trying to write to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listgood first issueRelatively approachable for first-time contributorsp: 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