{"id":32292500,"url":"https://github.com/melvinotieno/pigeon_generator","last_synced_at":"2026-02-20T23:01:06.228Z","repository":{"id":257780011,"uuid":"858402200","full_name":"melvinotieno/pigeon_generator","owner":"melvinotieno","description":"Integrate build_runner with pigeon code generation to automate the process of generating platform channels.","archived":false,"fork":false,"pushed_at":"2025-11-16T12:59:15.000Z","size":175,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-16T14:29:05.482Z","etag":null,"topics":["build-runner","pigeon","pigeon-build-runner","pigeon-generator"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/pigeon_generator","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/melvinotieno.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-16T20:41:59.000Z","updated_at":"2025-11-16T12:56:37.000Z","dependencies_parsed_at":"2024-09-19T16:15:33.569Z","dependency_job_id":"a1775a35-5567-4de9-b6f2-d528d48e3487","html_url":"https://github.com/melvinotieno/pigeon_generator","commit_stats":null,"previous_names":["melvinotieno/pigeon_generator"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/melvinotieno/pigeon_generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melvinotieno%2Fpigeon_generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melvinotieno%2Fpigeon_generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melvinotieno%2Fpigeon_generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melvinotieno%2Fpigeon_generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/melvinotieno","download_url":"https://codeload.github.com/melvinotieno/pigeon_generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melvinotieno%2Fpigeon_generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29667119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T19:49:36.704Z","status":"ssl_error","status_checked_at":"2026-02-20T19:44:05.372Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build-runner","pigeon","pigeon-build-runner","pigeon-generator"],"created_at":"2025-10-23T03:21:00.844Z","updated_at":"2026-02-20T23:01:06.218Z","avatar_url":"https://github.com/melvinotieno.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pigeon_generator\n\nThis is a Dart package that integrates [build_runner](https://pub.dev/packages/build_runner) with [pigeon](https://pub.dev/packages/pigeon) code generator for platform channels. This automates the manual process of running `pigeon`, making it easier and more efficient to generate code for platform channels.\n\n[![pub package](https://img.shields.io/pub/v/pigeon_generator.svg)](https://pub.dev/packages/pigeon_generator)\n[![pub points](https://img.shields.io/pub/points/pigeon_generator?color=2E8B57\u0026label=pub%20points)](https://pub.dev/packages/pigeon_generator/score)\n[![pigeon_generator](https://github.com/melvinotieno/pigeon_generator/actions/workflows/test.yml/badge.svg)](https://github.com/melvinotieno/pigeon_generator/actions/workflows/test.yml)\n\n## Installation\n\nTo install this package, run the following command:\n\n```bash\nflutter pub add build_runner pigeon pigeon_generator --dev\n```\n\nAlternatively, add the following dependencies to your `pubspec.yaml` file, replacing `[version]` with the latest version of the package:\n\n```yaml\ndev_dependencies:\n  build_runner: [version]\n  pigeon: [version]\n  pigeon_generator: [version]\n```\n\n## Usage\n\nFollow the steps below to use `pigeon_generator` in your project:\n\n### 1. Create a pigeons folder\n\nCreate a folder named `pigeons` in the root of your project. This folder will contain all the pigeon files.\n\nYou will also need to include this folder in the `build.yaml` file so that the `build_runner` can pick up the pigeon files.\n\n```yaml\nadditional_public_assets:\n  - pigeons/**\n```\n\nYou may use a different folder other than `pigeons`, but you will need to update the `build.yaml` file accordingly. If you are using a different folder, you will have to specify that folder in the `build.yaml` file options for the `pigeon_generator` builder. An example is shown below:\n\n```yaml\ntargets:\n  $default:\n    builders:\n      pigeon_generator:\n        options:\n          inputs: pigeons_other\n\nadditional_public_assets:\n  - pigeons_other/**\n```\n\n### 2. Configuring pigeon_generator\n\nBy default, you do not need to do anything other than create the `pigeons` folder with the pigeon files and specify the folder in the `additional_public_assets` of the `build.yaml` file.\n\nHowever, a full list of the configurations you can set is shown below:\n\n```yaml\ninputs: pigeons\ndart:\n  out: \"lib\"\n  package_name: \"pigeon_generator_example\"\n  options:\n    source_out: \"path/to/source\"\n    test_out: \"path/to/test\"\n    copyright_header: [\"Copyright Header\"]\nobjc:\n  header_out: \"macos/Runner\"\n  source_out: \"macos/Runner\"\n  options:\n    header_include: \"path/to/include\"\n    prefix: \"PGN\"\n    copyright_header: [\"Copyright Header\"]\njava:\n  out: \"android/app/src/main/java/com/example/pigeon_generator_example\"\n  options:\n    package: \"com.example.pigeon_generator_example\"\n    copyright_header: [\"Copyright Header\"]\n    use_generated_annotation: true\nswift:\n  out: \"ios/Runner\"\n  options:\n    copyright_header: [\"Copyright Header\"]\n    include_error_class: true\nkotlin:\n  out: \"android/app/src/main/kotlin/com/example/pigeon_generator_example\"\n  options:\n    package: \"com.example.pigeon_generator_example\"\n    copyright_header: [\"Copyright Header\"]\n    include_error_class: true\ncpp:\n  header_out: \"windows/runner\"\n  source_out: \"windows/runner\"\n  options:\n    header_include: \"path/to/include\"\n    namespace: \"pigeon_generator_example\"\n    copyright_header: [\"Copyright Header\"]\n    header_out: \"path/to/out\"\ngobject:\n  header_out: \"linux\"\n  source_out: \"linux\"\n  options:\n    header_include: \"path/to/include\"\n    module: \"pigeon_generator_example\"\n    copyright_header: [\"Copyright Header\"]\n    header_out: \"path/to/out\"\nast:\n  out: \"output\"\ncopyright_header: \"pigeons/copyright.txt\"\ndebug_generators: false\nbase_path: \"pigeon_generator_example\"\nskip_outputs:\n  defaults: [objc] # Do not generate output for objc for pigeons/defaults.dart\nout_folder: \"pigeons\"\nout_template: \"name.g.extension\"\n```\n\n- `inputs`: The folder path where the pigeon files are located. Default is `pigeons`.\n- `dart`: Dart code generation configuration. Defaults will be used if not specified, and disabled if `false`.\n  - `out`: The folder path where the Dart code will be generated `(.dart)`. If not defined, this defaults to `lib`.\n  - `package_name`: The name of the package the pigeon files will be used in.\n  - `options`:\n    - `source_out`: The folder path where the Dart source files will be generated.\n    - `test_out`: The folder path where the Dart test files will be generated.\n    - `copyright_header`: A copyright header that will get prepended to generated code.\n- `objc`: Objective-C code generation configuration. Defaults will be used if the value is `true`.\n  - `header_out`: The folder path where the Objective-C header files will be generated `(.h)`. Default is `macos/Runner`.\n  - `source_out`: The folder path where the Objective-C source files will be generated `(.m)`. Default is `macos/Runner`.\n  - `options`:\n    - `header_include`: The folder path to the header that will get placed in the source file.\n    - `prefix`: Prefix that will be appended before all generated classes and protocols.\n    - `copyright_header`: A copyright header that will get prepended to generated code.\n- `java`: Java code generation configuration for Android. Defaults will only be used if the value is `true`.\n  - `out`: The folder path where the Java code will be generated `(.java)`.\n  - `options`:\n    - `package`: The package where the generated class will live.\n    - `copyright_header`: A copyright header that will get prepended to generated code.\n    - `use_generated_annotation`: Determines if the javax.annotation.Generated is used in the output. This is false by default since that dependency isn't available in plugins by default.\n- `swift`: Swift code generation configuration. Defaults will be used if the value is `true` or if `ios` directory exists.\n  - `out`: The folder path where the Swift code will be generated `(.swift)`. Default is `ios/Runner`.\n  - `options`:\n    - `copyright_header`: A copyright header that will get prepended to generated code.\n    - `include_error_class`: Whether to include the error class in generation. This should only ever be set to false if you have another generated Swift file in the same directory.\n- `kotlin`: Kotlin code generation configuration for Android. Defaults will be used if the value is `true` or if a valid Android project exists.\n  - `out`: The folder path where the Kotlin code will be generated `(.kt)`. For defaults, we get the applicationId from the project's Gradle file and use it to generate the path.\n  - `options`:\n    - `package`: The package where the generated class will live.\n    - `copyright_header`: A copyright header that will get prepended to generated code.\n    - `include_error_class`: Whether to include the error class in generation. This should only ever be set to false if you have another generated Kotlin file in the same directory.\n- `cpp`: C++ code generation configuration for Windows. Defaults will be used if the value is `true` or if `windows` directory exists.\n  - `header_out`: The folder path where the C++ header files will be generated `(.h)`. Default is `windows/runner`.\n  - `source_out`: The folder path where the C++ source files will be generated `(.cpp)`. Default is `windows/runner`.\n  - `options`:\n    - `header_include`: The folder path to the header that will get placed in the source file.\n    - `namespace`: The namespace where the generated class will live.\n    - `copyright_header`: A copyright header that will get prepended to generated code.\n    - `header_out`: The folder path to the output header file location.\n- `gobject`: GObject code generation configuration for Linux. Defaults will be used if the value is `true` or if `linux` directory exists.\n  - `header_out`: The folder path where the GObject header files will be generated `(.h)`. Default is `linux`.\n  - `source_out`: The folder path where the GObject source files will be generated `(.cc)`. Default is `linux`.\n  - `options`:\n    - `header_include`: The folder path to the header that will get placed in the source file.\n    - `module`: The module where the generated class will live.\n    - `copyright_header`: A copyright header that will get prepended to generated code.\n    - `header_out`: The folder path to the output header file location.\n- `ast`: AST code generation configuration. Defaults will only be used if the value is `true`.\n  - `out`: The folder path where the AST code will be generated `(.ast)`. Default is `ast`.\n- `copyright_header`: The path to the file containing the copyright header. If the copyright header is placed inside the same folder as the pigeon files, then you do not need to specify this option as the generator will automatically pick it.\n- `debug_generators`: The value `true` prints the line number of the generator in comments at new lines.\n- `base_path`: A base path to be prepended to all provided output paths.\n- `skip_outputs`: The platforms to skip generating outputs for. Options include: `dart`, `dart_test`, `java`, `kotlin`, `swift`, `objc`, `cpp`, `gobject`, `ast`.\n- `out_folder`: The folder that will be appended to all output paths.\n- `out_template`: The template for the generated file name. The default is `name.g.extension` where `name` is the name of the pigeon file and `extension` is the platform-specific extension. Example for the pigeon file named `test.dart`, the generated file for Kotlin will be `Test.g.kt`.\n\n### 3. Run the generator\n\nTo generate the code, run the following command:\n\n```bash\ndart run build_runner build\n```\n\nYou can use the watch mode to regenerate the code when the pigeon files change automatically:\n\n```bash\ndart run build_runner watch\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelvinotieno%2Fpigeon_generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmelvinotieno%2Fpigeon_generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelvinotieno%2Fpigeon_generator/lists"}