-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
This issue is predicated on #157462 landing first.
In #157462, we added the field Plugin { bool isDevDependency }, which describes whether a plugin was resolved explicitly because it came from an application's pubspec.yaml in dev_dependencies (with additional checks to make sure that the dependency is not used in a non-dev fashion elsewhere in the transitive dependencies, see compute_dev_dependencies_test.dart).
This was a good first step to excluding dev-only plugins from release applications, however we need to go a step further and now serialized (and save) that property to .flutter-plugins-dependencies, so that tools (such as the Flutter Android Gradle plugin, and other tools such as the iOS/macOS flutter_tools extensions) can read that file, and conditionally exclude dev-only plugins.
Here is a rough example of .flutter-plugins-dependencies today:
{
"plugins": {
"android": [
{
"name": "plugin-a",
"path": "/path/to/plugin-a",
"dependencies": ["plugin-b", "plugin-c"],
"native_build": true
},
{
"name": "plugin-b",
"path": "/path/to/plugin-b",
"dependencies": ["plugin-c"],
"native_build": true
},
{
"name": "plugin-c",
"path": "/path/to/plugin-c",
"dependencies": [],
"native_build": true
},
],
},
"dependencyGraph": [
{
"name": "plugin-a",
"dependencies": ["plugin-b","plugin-c"]
},
{
"name": "plugin-b",
"dependencies": ["plugin-c"]
},
{
"name": "plugin-c",
"dependencies": []
}
]
}I imagine we'd make slight alternations to this file, i.e.:
{
"plugins": {
"android": [
{
"name": "plugin-a",
"path": "/path/to/plugin-a",
"dependencies": ["plugin-b", "plugin-c"],
"native_build": true,
+ "dev_dependency" true
},
{
"name": "plugin-b",
"path": "/path/to/plugin-b",
"dependencies": ["plugin-c"],
"native_build": true,
+ "dev_dependency" true
},
{
"name": "plugin-c",
"path": "/path/to/plugin-c",
"dependencies": [],
"native_build": true,
+ "dev_dependency" false
},
],
},
"dependencyGraph": [
{
"name": "plugin-a",
"dependencies": ["plugin-b","plugin-c"]
},
{
"name": "plugin-b",
"dependencies": ["plugin-c"]
},
{
"name": "plugin-c",
"dependencies": []
}
]
}