Move explicit package dependencies to a feature flag (#158016)
Closes https://github.com/flutter/flutter/issues/158012. This is (effectively) a user-facing NOP, which is exchanging an on-by-default command-line argument (`--implicit-pubspec-resolution`) for an off-by-default global feature flag (`explicit-package-dependencies`). It matches the mental model better, is less painstaking to maintain and feed throughout, and will be easier to globally flip on/off in a future PR. --------- Co-authored-by: Andrew Kolos <andrewrkolos@gmail.com>
This commit is contained in:
@@ -482,6 +482,7 @@ class TestFeatureFlags implements FeatureFlags {
|
||||
this.isNativeAssetsEnabled = false,
|
||||
this.isPreviewDeviceEnabled = false,
|
||||
this.isSwiftPackageManagerEnabled = false,
|
||||
this.isExplicitPackageDependenciesEnabled = false,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -520,6 +521,9 @@ class TestFeatureFlags implements FeatureFlags {
|
||||
@override
|
||||
final bool isSwiftPackageManagerEnabled;
|
||||
|
||||
@override
|
||||
final bool isExplicitPackageDependenciesEnabled;
|
||||
|
||||
@override
|
||||
bool isEnabled(Feature feature) {
|
||||
return switch (feature) {
|
||||
@@ -533,6 +537,7 @@ class TestFeatureFlags implements FeatureFlags {
|
||||
flutterCustomDevicesFeature => areCustomDevicesEnabled,
|
||||
cliAnimation => isCliAnimationEnabled,
|
||||
nativeAssets => isNativeAssetsEnabled,
|
||||
explicitPackageDependencies => isExplicitPackageDependenciesEnabled,
|
||||
_ => false,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ class Testbed {
|
||||
///
|
||||
/// `overrides` may be used to provide new context values for the single test
|
||||
/// case or override any context values from the setup.
|
||||
Future<T?> run<T>(FutureOr<T> Function() test, {Map<Type, Generator>? overrides, bool useImplicitPubspecResolution = true}) {
|
||||
Future<T?> run<T>(FutureOr<T> Function() test, {Map<Type, Generator>? overrides}) {
|
||||
final Map<Type, Generator> testOverrides = <Type, Generator>{
|
||||
..._testbedDefaults,
|
||||
// Add the initial setUp overrides
|
||||
@@ -139,7 +139,7 @@ class Testbed {
|
||||
}
|
||||
return null;
|
||||
});
|
||||
}, useImplicitPubspecResolution: useImplicitPubspecResolution);
|
||||
});
|
||||
}, createHttpClient: (SecurityContext? c) => FakeHttpClient.any());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user