Skip to content

chore: Ignore platform-generated build files to improve DX #630

@bhola-dev58

Description

@bhola-dev58

improvement idea

Currently,
when developers run flutter pub get or test the app locally, Flutter auto-generates platform-specific build files

linux/flutter/generated_plugin_registrant.cc
linux/flutter/generated_plugins.cmake
macos/Flutter/GeneratedPluginRegistrant.swift
pubspec.lock
windows/flutter/generated_plugin_registrant.cc
windows/flutter/generated_plugins.cmake

depending on local dependencies.

This creates dirty working directories and forces contributors to manually discard changes before committing.

To improve the Developer Experience (DX) and prevent unwanted files from being committed, these paths should be added to .gitignore.

My proposed solution

  1. I will append the specific paths of the auto-generated platform files to the .gitignore at the root of the project.
  2. Run git rm --cached <file_paths> to untrack these files from the Git repository history so they immediately stop causing merge conflicts for new branches.

By taking these simple steps, we completely automate ignore rules, keeping all future Pull Requests clean from randomly generated machine-specific code.

I am currently working on a PR for this to help out the team.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions