Sitelet https://github.com/flutter/flutter/issues/163874
Skip to content

Release mode iOS apps should use .flutter-plugins-dependencies to omit dev-dependency plugins #163874

Description

@matanlurey

As of #160257, #56591 is implemented, and it's possible for the application build process for every platform, including iOS, to conditionally omit bundling (and building) plugins that are sole used for testing and debugging.

/// Whether this plugin is exclusively used as a dev dependency of the app.
///
/// If [false], the plugin is either:
/// - _Not_ a dev dependency
/// - _Not_ a dev dependency of some dependency that itself is not a dev
/// dependency
///
/// Dev dependencies are intended to be stripped out in release builds.
final bool isDevDependency;

This feature was implemented e2e for Android (which loads .flutter-plugins-dependencies into flutter.gradle), but I'm not sure what the best approach is for iOS, so filing this issue for the team to track implementation. If there is something I can do to help (explain, pair, take on minor coding tasks), please reach out.

The `.flutter-plugins-dependencies` file, at HEAD (with `flutter config --explicit-package-dependencies` enabled)
# Example from integration_test/example/.flutter-plugins-dependencies

{
  "info": "This is a generated file; do not edit or check into version control.",
  "plugins": {
    "ios": [
      {
        "name": "integration_test",
        "path": "/Users/matanl/Developer/flutter/packages/integration_test/",
        "native_build": true,
        "dependencies": [],
        "dev_dependency": true
      }
    ],
    "android": [
      {
        "name": "integration_test",
        "path": "/Users/matanl/Developer/flutter/packages/integration_test/",
        "native_build": true,
        "dependencies": [],
        "dev_dependency": true
      }
    ],
    "macos": [
      {
        "name": "integration_test_macos",
        "path": "/Users/matanl/Developer/flutter/packages/integration_test/integration_test_macos/",
        "native_build": true,
        "dependencies": [],
        "dev_dependency": true
      }
    ],
    "linux": [],
    "windows": [],
    "web": []
  },
  "dependencyGraph": [
    {
      "name": "integration_test",
      "dependencies": []
    },
    {
      "name": "integration_test_macos",
      "dependencies": []
    }
  ],
  "date_created": "2025-02-13 08:46:27.610077",
  "version": "3.30.0-1.0.pre.167",
  "swift_package_manager_enabled": {
    "ios": false,
    "macos": false
  }
}

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: new featureNothing broken; request for a new capabilityteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions