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:
Matan Lurey 2024-11-13 18:33:34 -08:00 committed by GitHub
parent 9ac9049d09
commit 125b4e945e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
65 changed files with 224 additions and 436 deletions

View File

@ -347,7 +347,6 @@ class Environment {
required Analytics analytics,
String? engineVersion,
required bool generateDartPluginRegistry,
required bool useImplicitPubspecResolution,
Directory? buildDir,
Map<String, String> defines = const <String, String>{},
Map<String, String> inputs = const <String, String>{},
@ -392,7 +391,6 @@ class Environment {
engineVersion: engineVersion,
inputs: inputs,
generateDartPluginRegistry: generateDartPluginRegistry,
useImplicitPubspecResolution: useImplicitPubspecResolution,
);
}
@ -414,7 +412,6 @@ class Environment {
Usage? usage,
Analytics? analytics,
bool generateDartPluginRegistry = false,
bool useImplicitPubspecResolution = true,
required FileSystem fileSystem,
required Logger logger,
required Artifacts artifacts,
@ -438,7 +435,6 @@ class Environment {
analytics: analytics ?? const NoOpAnalytics(),
engineVersion: engineVersion,
generateDartPluginRegistry: generateDartPluginRegistry,
useImplicitPubspecResolution: useImplicitPubspecResolution,
);
}
@ -461,7 +457,6 @@ class Environment {
this.engineVersion,
required this.inputs,
required this.generateDartPluginRegistry,
required this.useImplicitPubspecResolution,
});
/// The [Source] value which is substituted with the path to [projectDir].
@ -562,10 +557,6 @@ class Environment {
/// the new entrypoint.
final bool generateDartPluginRegistry;
/// Whether to generate a `.flutter-plugins` file and for Flutter i10n source
/// generation to default to `synthetic-package: true`.
final bool useImplicitPubspecResolution;
late final DepfileService depFileService = DepfileService(
logger: logger,
fileSystem: fileSystem,

View File

@ -4,6 +4,7 @@
import '../../base/file_system.dart';
import '../../convert.dart';
import '../../features.dart';
import '../../localizations/gen_l10n.dart';
import '../../localizations/localizations_utils.dart';
import '../build_system.dart';
@ -56,7 +57,7 @@ class GenerateLocalizationsTarget extends Target {
file: configFile,
logger: environment.logger,
defaultArbDir: defaultArbDir,
defaultSyntheticPackage: environment.useImplicitPubspecResolution,
defaultSyntheticPackage: !featureFlags.isExplicitPackageDependenciesEnabled,
);
await generateLocalizations(
logger: environment.logger,

View File

@ -37,7 +37,6 @@ class BundleBuilder {
Future<void> build({
required TargetPlatform platform,
required BuildInfo buildInfo,
required bool useImplicitPubspecResolution,
FlutterProject? project,
String? mainPath,
String manifestPath = defaultManifestPath,
@ -80,7 +79,6 @@ class BundleBuilder {
analytics: globals.analytics,
platform: globals.platform,
generateDartPluginRegistry: true,
useImplicitPubspecResolution: useImplicitPubspecResolution,
);
final Target target = buildInfo.mode == BuildMode.debug
? globals.buildTargets.copyFlutterBundle

View File

@ -26,7 +26,6 @@ import '../globals.dart' as globals;
import '../project.dart';
import '../reporting/reporting.dart';
import '../runner/flutter_command.dart';
import '../runner/flutter_command_runner.dart';
/// All currently implemented targets.
List<Target> _kDefaultTargets = <Target>[
@ -253,7 +252,6 @@ class AssembleCommand extends FlutterCommand {
? null
: globals.flutterVersion.engineRevision,
generateDartPluginRegistry: true,
useImplicitPubspecResolution: globalResults!.flag(FlutterGlobalOptions.kImplicitPubspecResolution),
);
return result;
}

View File

@ -279,7 +279,6 @@ known, it can be explicitly provided to attach via the command-line, e.g.
? _logger
: NotifyingLogger(verbose: _logger.isVerbose, parent: _logger),
logToStdout: true,
useImplicitPubspecResolution: globalResults!.flag(FlutterGlobalOptions.kImplicitPubspecResolution),
)
: null;
@ -466,7 +465,6 @@ known, it can be explicitly provided to attach via the command-line, e.g.
printDtd: boolArg(FlutterGlobalOptions.kPrintDtd, global: true),
);
final bool useImplicitPubspecResolution = globalResults!.flag(FlutterGlobalOptions.kImplicitPubspecResolution);
return buildInfo.isDebug
? _hotRunnerFactory.build(
flutterDevices,
@ -479,13 +477,11 @@ known, it can be explicitly provided to attach via the command-line, e.g.
nativeAssetsYamlFile: stringArg(FlutterOptions.kNativeAssetsYamlFile),
nativeAssetsBuilder: _nativeAssetsBuilder,
analytics: analytics,
useImplicitPubspecResolution: useImplicitPubspecResolution,
)
: ColdRunner(
flutterDevices,
target: targetFile,
debuggingOptions: debuggingOptions,
useImplicitPubspecResolution: useImplicitPubspecResolution,
);
}
@ -512,7 +508,6 @@ class HotRunnerFactory {
FlutterProject? flutterProject,
String? nativeAssetsYamlFile,
required HotRunnerNativeAssetsBuilder? nativeAssetsBuilder,
required bool useImplicitPubspecResolution,
required Analytics analytics,
}) => HotRunner(
devices,
@ -527,6 +522,5 @@ class HotRunnerFactory {
nativeAssetsYamlFile: nativeAssetsYamlFile,
nativeAssetsBuilder: nativeAssetsBuilder,
analytics: analytics,
useImplicitPubspecResolution: useImplicitPubspecResolution,
);
}

View File

@ -13,7 +13,6 @@ import '../globals.dart' as globals;
import '../project.dart';
import '../reporting/reporting.dart';
import '../runner/flutter_command.dart';
import '../runner/flutter_command_runner.dart';
import 'build.dart';
class BuildBundleCommand extends BuildSubCommand {
@ -150,7 +149,6 @@ class BuildBundleCommand extends BuildSubCommand {
depfilePath: stringArg('depfile'),
assetDirPath: stringArg('asset-dir'),
buildNativeAssets: false,
useImplicitPubspecResolution: globalResults!.flag(FlutterGlobalOptions.kImplicitPubspecResolution),
);
return FlutterCommandResult.success();
}

View File

@ -21,7 +21,6 @@ import '../flutter_plugins.dart';
import '../globals.dart' as globals;
import '../macos/cocoapod_utils.dart';
import '../runner/flutter_command.dart' show DevelopmentArtifact, FlutterCommandResult;
import '../runner/flutter_command_runner.dart';
import '../version.dart';
import 'build.dart';
@ -461,7 +460,6 @@ end
? null
: globals.flutterVersion.engineRevision,
generateDartPluginRegistry: true,
useImplicitPubspecResolution: globalResults!.flag(FlutterGlobalOptions.kImplicitPubspecResolution),
);
Target target;
// Always build debug for simulator.

View File

@ -19,7 +19,6 @@ import '../flutter_plugins.dart';
import '../globals.dart' as globals;
import '../macos/cocoapod_utils.dart';
import '../runner/flutter_command.dart' show DevelopmentArtifact, FlutterCommandResult;
import '../runner/flutter_command_runner.dart';
import '../version.dart';
import 'build_ios_framework.dart';
@ -240,7 +239,6 @@ end
analytics: globals.analytics,
engineVersion: globals.artifacts!.usesLocalArtifacts ? null : globals.flutterVersion.engineRevision,
generateDartPluginRegistry: true,
useImplicitPubspecResolution: globalResults!.flag(FlutterGlobalOptions.kImplicitPubspecResolution),
);
Target target;
// Always build debug for simulator.

View File

@ -10,7 +10,6 @@ import '../features.dart';
import '../globals.dart' as globals;
import '../runner/flutter_command.dart'
show DevelopmentArtifact, FlutterCommandResult, FlutterOptions;
import '../runner/flutter_command_runner.dart';
import '../web/compile.dart';
import '../web/file_generators/flutter_service_worker_js.dart';
import '../web/web_constants.dart';
@ -227,7 +226,6 @@ class BuildWebCommand extends BuildSubCommand {
flutterVersion: globals.flutterVersion,
usage: globals.flutterUsage,
analytics: globals.analytics,
useImplicitPubspecResolution: globalResults!.flag(FlutterGlobalOptions.kImplicitPubspecResolution),
);
await webBuilder.buildWeb(
project,

View File

@ -26,7 +26,6 @@ import '../macos/swift_packages.dart';
import '../project.dart';
import '../reporting/reporting.dart';
import '../runner/flutter_command.dart';
import '../runner/flutter_command_runner.dart';
import 'create_base.dart';
const String kPlatformHelp =
@ -459,7 +458,6 @@ class CreateCommand extends CreateBase {
macOSPlatform: includeMacos,
windowsPlatform: includeWindows,
webPlatform: includeWeb,
useImplicitPubspecResolution: boolArg(FlutterGlobalOptions.kImplicitPubspecResolution, global: true),
);
}
}

View File

@ -21,7 +21,6 @@ import '../flutter_project_metadata.dart';
import '../globals.dart' as globals;
import '../project.dart';
import '../runner/flutter_command.dart';
import '../runner/flutter_command_runner.dart';
import '../template.dart';
const List<String> _kAvailablePlatforms = <String>[
@ -575,7 +574,6 @@ abstract class CreateBase extends FlutterCommand {
projectDir: project.directory,
packageConfigPath: packageConfigPath(),
generateDartPluginRegistry: true,
useImplicitPubspecResolution: globalResults!.flag(FlutterGlobalOptions.kImplicitPubspecResolution),
);
// Generate the l10n synthetic package that will be injected into the

View File

@ -378,7 +378,6 @@ class CustomDevicesAddCommand extends CustomDevicesCommandBase {
config: config,
logger: logger,
processManager: _processManager,
useImplicitPubspecResolution: globalResults!.flag(FlutterGlobalOptions.kImplicitPubspecResolution),
);
bool result = true;

View File

@ -32,7 +32,6 @@ import '../resident_runner.dart';
import '../run_cold.dart';
import '../run_hot.dart';
import '../runner/flutter_command.dart';
import '../runner/flutter_command_runner.dart';
import '../vmservice.dart';
import '../web/web_runner.dart';
@ -67,7 +66,6 @@ class DaemonCommand extends FlutterCommand {
@override
Future<FlutterCommandResult> runCommand() async {
final bool useImplicitPubspecResolution = globalResults!.flag(FlutterGlobalOptions.kImplicitPubspecResolution);
if (argResults!['listen-on-tcp-port'] != null) {
int? port;
try {
@ -84,7 +82,6 @@ class DaemonCommand extends FlutterCommand {
outputPreferences: globals.outputPreferences,
),
notifyingLogger: asLogger<NotifyingLogger>(globals.logger),
useImplicitPubspecResolution: useImplicitPubspecResolution,
).run();
return FlutterCommandResult.success();
}
@ -95,7 +92,6 @@ class DaemonCommand extends FlutterCommand {
logger: globals.logger,
),
notifyingLogger: asLogger<NotifyingLogger>(globals.logger),
useImplicitPubspecResolution: useImplicitPubspecResolution,
);
final int code = await daemon.onExit;
if (code != 0) {
@ -109,11 +105,10 @@ class DaemonCommand extends FlutterCommand {
class DaemonServer {
DaemonServer({
this.port,
required bool useImplicitPubspecResolution,
required this.logger,
this.notifyingLogger,
@visibleForTesting Future<ServerSocket> Function(InternetAddress address, int port) bind = ServerSocket.bind,
}) : _bind = bind, _useImplicitPubspecResolution = useImplicitPubspecResolution;
}) : _bind = bind;
final int? port;
@ -122,7 +117,6 @@ class DaemonServer {
// Logger that sends the message to the other end of daemon connection.
final NotifyingLogger? notifyingLogger;
final bool _useImplicitPubspecResolution;
final Future<ServerSocket> Function(InternetAddress address, int port) _bind;
@ -157,7 +151,6 @@ class DaemonServer {
logger: logger,
),
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: _useImplicitPubspecResolution,
);
await daemon.onExit;
await socketDone;
@ -176,14 +169,13 @@ typedef CommandHandlerWithBinary = Future<Object?> Function(Map<String, Object?>
class Daemon {
Daemon(
this.connection, {
required bool useImplicitPubspecResolution,
this.notifyingLogger,
this.logToStdout = false,
FileTransfer fileTransfer = const FileTransfer(),
}) {
// Set up domains.
registerDomain(daemonDomain = DaemonDomain(this));
registerDomain(appDomain = AppDomain(this, useImplicitPubspecResolution: useImplicitPubspecResolution));
registerDomain(appDomain = AppDomain(this));
registerDomain(deviceDomain = DeviceDomain(this));
registerDomain(emulatorDomain = EmulatorDomain(this));
registerDomain(devToolsDomain = DevToolsDomain(this));
@ -645,10 +637,7 @@ typedef RunOrAttach = Future<void> Function({
///
/// It fires events for application start, stop, and stdout and stderr.
class AppDomain extends Domain {
AppDomain(Daemon daemon, {
required bool useImplicitPubspecResolution,
}) : _useImplicitPubspecResolution = useImplicitPubspecResolution,
super(daemon, 'app') {
AppDomain(Daemon daemon) : super(daemon, 'app') {
registerHandler('restart', restart);
registerHandler('callServiceExtension', callServiceExtension);
registerHandler('stop', stop);
@ -660,7 +649,6 @@ class AppDomain extends Domain {
static String _getNewAppId() => _uuidGenerator.v4();
final List<AppInstance> _apps = <AppInstance>[];
final bool _useImplicitPubspecResolution;
final DebounceOperationQueue<OperationResult, OperationType> operationQueue = DebounceOperationQueue<OperationResult, OperationType>();
@ -717,7 +705,6 @@ class AppDomain extends Domain {
systemClock: globals.systemClock,
logger: globals.logger,
fileSystem: globals.fs,
useImplicitPubspecResolution: _useImplicitPubspecResolution,
);
} else if (enableHotReload) {
runner = HotRunner(
@ -731,7 +718,6 @@ class AppDomain extends Domain {
machine: machine,
analytics: globals.analytics,
nativeAssetsBuilder: nativeAssetsBuilder,
useImplicitPubspecResolution: _useImplicitPubspecResolution,
);
} else {
runner = ColdRunner(
@ -740,7 +726,6 @@ class AppDomain extends Domain {
debuggingOptions: options,
applicationBinary: applicationBinary,
machine: machine,
useImplicitPubspecResolution: _useImplicitPubspecResolution,
);
}

View File

@ -28,7 +28,6 @@ import '../ios/devices.dart';
import '../macos/macos_ipad_device.dart';
import '../resident_runner.dart';
import '../runner/flutter_command.dart' show FlutterCommandCategory, FlutterCommandResult, FlutterOptions;
import '../runner/flutter_command_runner.dart';
import '../web/web_device.dart';
import 'run.dart';
@ -261,7 +260,6 @@ class DriveCommand extends RunCommandBase {
processUtils: globals.processUtils,
dartSdkPath: globals.artifacts!.getArtifactPath(Artifact.engineDartBinary),
devtoolsLauncher: DevtoolsLauncher.instance!,
useImplicitPubspecResolution: globalResults!.flag(FlutterGlobalOptions.kImplicitPubspecResolution),
);
final File packageConfigFile = findPackageConfigFileOrDefault(_fileSystem.currentDirectory);

View File

@ -21,7 +21,6 @@ import '../plugins.dart';
import '../project.dart';
import '../reporting/reporting.dart';
import '../runner/flutter_command.dart';
import '../runner/flutter_command_runner.dart';
/// The function signature of the [print] function.
typedef PrintFn = void Function(Object?);
@ -305,7 +304,6 @@ class PackagesGetCommand extends FlutterCommand {
projectDir: rootProject.directory,
packageConfigPath: packageConfigPath(),
generateDartPluginRegistry: true,
useImplicitPubspecResolution: globalResults!.flag(FlutterGlobalOptions.kImplicitPubspecResolution),
);
await generateLocalizationsSyntheticPackage(
@ -329,7 +327,6 @@ class PackagesGetCommand extends FlutterCommand {
projectDir: rootProject.directory,
packageConfigPath: packageConfigPath(),
generateDartPluginRegistry: true,
useImplicitPubspecResolution: globalResults!.flag(FlutterGlobalOptions.kImplicitPubspecResolution),
);
final BuildResult result = await globals.buildSystem.build(
const GenerateLocalizationsTarget(),
@ -386,15 +383,10 @@ class PackagesGetCommand extends FlutterCommand {
if (rootProject != null) {
// We need to regenerate the platform specific tooling for both the project
// itself and example(if present).
final bool useImplicitPubspecResolution = boolArg(FlutterGlobalOptions.kImplicitPubspecResolution, global: true);
await rootProject.regeneratePlatformSpecificTooling(
useImplicitPubspecResolution: useImplicitPubspecResolution,
);
await rootProject.regeneratePlatformSpecificTooling();
if (example && rootProject.hasExampleApp && rootProject.example.pubspecFile.existsSync()) {
final FlutterProject exampleProject = rootProject.example;
await exampleProject.regeneratePlatformSpecificTooling(
useImplicitPubspecResolution: useImplicitPubspecResolution,
);
await exampleProject.regeneratePlatformSpecificTooling();
}
}
@ -407,7 +399,7 @@ class PackagesGetCommand extends FlutterCommand {
return <Plugin>[];
}
return findPlugins(rootProject, throwOnError: false, useImplicitPubspecResolution: boolArg(FlutterGlobalOptions.kImplicitPubspecResolution, global: true));
return findPlugins(rootProject, throwOnError: false);
})();
late final String? _androidEmbeddingVersion = _rootProject?.android.getEmbeddingVersion().toString().split('.').last;

View File

@ -681,7 +681,6 @@ class RunCommand extends RunCommandBase {
required String? applicationBinaryPath,
required FlutterProject flutterProject,
}) async {
final bool useImplicitPubspecResolution = globalResults!.flag(FlutterGlobalOptions.kImplicitPubspecResolution);
if (hotMode && !webMode) {
return HotRunner(
flutterDevices,
@ -697,7 +696,6 @@ class RunCommand extends RunCommandBase {
analytics: globals.analytics,
nativeAssetsYamlFile: stringArg(FlutterOptions.kNativeAssetsYamlFile),
nativeAssetsBuilder: _nativeAssetsBuilder,
useImplicitPubspecResolution: useImplicitPubspecResolution,
);
} else if (webMode) {
return webRunnerFactory!.createWebRunner(
@ -711,7 +709,6 @@ class RunCommand extends RunCommandBase {
analytics: globals.analytics,
logger: globals.logger,
systemClock: globals.systemClock,
useImplicitPubspecResolution: useImplicitPubspecResolution,
);
}
return ColdRunner(
@ -724,13 +721,11 @@ class RunCommand extends RunCommandBase {
? null
: globals.fs.file(applicationBinaryPath),
stayResident: stayResident,
useImplicitPubspecResolution: useImplicitPubspecResolution,
);
}
@visibleForTesting
Daemon createMachineDaemon() {
final bool useImplicitPubspecResolution = globalResults!.flag(FlutterGlobalOptions.kImplicitPubspecResolution);
final Daemon daemon = Daemon(
DaemonConnection(
daemonStreams: DaemonStreams.fromStdio(globals.stdio, logger: globals.logger),
@ -740,7 +735,6 @@ class RunCommand extends RunCommandBase {
? globals.logger as NotifyingLogger
: NotifyingLogger(verbose: globals.logger.isVerbose, parent: globals.logger),
logToStdout: true,
useImplicitPubspecResolution: useImplicitPubspecResolution,
);
return daemon;
}

View File

@ -68,7 +68,6 @@ import 'windows/windows_workflow.dart';
Future<T> runInContext<T>(
FutureOr<T> Function() runner, {
bool useImplicitPubspecResolution = true,
Map<Type, Generator>? overrides,
}) async {
@ -211,7 +210,6 @@ Future<T> runInContext<T>(
operatingSystemUtils: globals.os,
customDevicesConfig: globals.customDevicesConfig,
nativeAssetsBuilder: globals.nativeAssetsBuilder,
useImplicitPubspecResolution: useImplicitPubspecResolution,
),
DevtoolsLauncher: () => DevtoolsServerLauncher(
processManager: globals.processManager,

View File

@ -440,10 +440,8 @@ class CustomDevice extends Device {
required CustomDeviceConfig config,
required super.logger,
required ProcessManager processManager,
required bool useImplicitPubspecResolution,
}) : _config = config,
_logger = logger,
_useImplicitPubspecResolution = useImplicitPubspecResolution,
_processManager = processManager,
_processUtils = ProcessUtils(
processManager: processManager,
@ -471,7 +469,6 @@ class CustomDevice extends Device {
final ProcessUtils _processUtils;
final Map<ApplicationPackage, CustomDeviceAppSession> _sessions = <ApplicationPackage, CustomDeviceAppSession>{};
final CustomDeviceLogReader _globalLogReader;
final bool _useImplicitPubspecResolution;
@override
final DevicePortForwarder portForwarder;
@ -765,7 +762,6 @@ class CustomDevice extends Device {
mainPath: mainPath,
depfilePath: defaultDepfilePath,
assetDirPath: assetBundleDir,
useImplicitPubspecResolution: _useImplicitPubspecResolution,
);
// if we have a post build step (needed for some embedders), execute it
@ -827,17 +823,14 @@ class CustomDevices extends PollingDeviceDiscovery {
required ProcessManager processManager,
required Logger logger,
required CustomDevicesConfig config,
required bool useImplicitPubspecResolution,
}) : _customDeviceWorkflow = CustomDeviceWorkflow(
featureFlags: featureFlags,
),
_useImplicitPubspecResolution = useImplicitPubspecResolution,
_logger = logger,
_processManager = processManager,
_config = config,
super('custom devices');
final bool _useImplicitPubspecResolution;
final CustomDeviceWorkflow _customDeviceWorkflow;
final ProcessManager _processManager;
final Logger _logger;
@ -859,7 +852,6 @@ class CustomDevices extends PollingDeviceDiscovery {
config: config,
logger: _logger,
processManager: _processManager,
useImplicitPubspecResolution: _useImplicitPubspecResolution,
)
).toList();
}

View File

@ -9,6 +9,7 @@ import '../base/file_system.dart';
import '../base/utils.dart';
import '../build_system/build_system.dart';
import '../build_system/build_targets.dart';
import '../features.dart';
Future<void> generateLocalizationsSyntheticPackage({
required Environment environment,
@ -51,19 +52,19 @@ Future<void> generateLocalizationsSyntheticPackage({
if (isSyntheticL10nPackage == false) {
return;
}
} else if (!environment.useImplicitPubspecResolution) {
// --no-implicit-pubspec-resolution was passed, and synthetic-packages: true was not.
} else if (featureFlags.isExplicitPackageDependenciesEnabled) {
// synthetic-packages: true was not set and it is no longer the defualt.
return;
}
if (!environment.useImplicitPubspecResolution) {
if (featureFlags.isExplicitPackageDependenciesEnabled) {
throwToolExit(
'Cannot generate a synthetic package when --no-implicit-pubspec-resolution is passed.\n'
'Cannot generate a synthetic package when explicit-package-dependencies is enabled.\n'
'\n'
'Synthetic package output (package:flutter_gen) is deprecated: '
'https://flutter.dev/to/flutter-gen-deprecation. If you are seeing this '
'message either you have provided --no-implicit-pubspec-resolution, or '
'it is the default value (see flutter --verbose --help).',
'message either you have provided explicit-package-dependencies, or it '
'is the default value (see flutter config --help).',
);
}

View File

@ -28,20 +28,17 @@ class FlutterDriverFactory {
required ProcessUtils processUtils,
required String dartSdkPath,
required DevtoolsLauncher devtoolsLauncher,
required bool useImplicitPubspecResolution,
}) : _applicationPackageFactory = applicationPackageFactory,
_logger = logger,
_processUtils = processUtils,
_dartSdkPath = dartSdkPath,
_devtoolsLauncher = devtoolsLauncher,
_useImplicitPubspecResolution = useImplicitPubspecResolution;
_devtoolsLauncher = devtoolsLauncher;
final ApplicationPackageFactory _applicationPackageFactory;
final Logger _logger;
final ProcessUtils _processUtils;
final String _dartSdkPath;
final DevtoolsLauncher _devtoolsLauncher;
final bool _useImplicitPubspecResolution;
/// Create a driver service for running `flutter drive`.
DriverService createDriverService(bool web) {
@ -50,7 +47,6 @@ class FlutterDriverFactory {
logger: _logger,
processUtils: _processUtils,
dartSdkPath: _dartSdkPath,
useImplicitPubspecResolution: _useImplicitPubspecResolution,
);
}
return FlutterDriverService(

View File

@ -30,16 +30,13 @@ class WebDriverService extends DriverService {
required ProcessUtils processUtils,
required String dartSdkPath,
required Logger logger,
required bool useImplicitPubspecResolution,
}) : _processUtils = processUtils,
_dartSdkPath = dartSdkPath,
_logger = logger,
_useImplicitPubspecResolution = useImplicitPubspecResolution;
_logger = logger;
final ProcessUtils _processUtils;
final String _dartSdkPath;
final Logger _logger;
final bool _useImplicitPubspecResolution;
late ResidentRunner _residentRunner;
Uri? _webUri;
@ -97,7 +94,6 @@ class WebDriverService extends DriverService {
analytics: globals.analytics,
logger: _logger,
systemClock: globals.systemClock,
useImplicitPubspecResolution: _useImplicitPubspecResolution,
);
final Completer<void> appStartedCompleter = Completer<void>.sync();
final Future<int?> runFuture = _residentRunner.run(

View File

@ -54,6 +54,9 @@ abstract class FeatureFlags {
/// Whether Swift Package Manager dependency management is enabled.
bool get isSwiftPackageManagerEnabled => false;
/// Whether explicit package dependency management is enabled.
bool get isExplicitPackageDependenciesEnabled => false;
/// Whether a particular feature is enabled for the current channel.
///
/// Prefer using one of the specific getters above instead of this API.
@ -74,6 +77,7 @@ const List<Feature> allFeatures = <Feature>[
nativeAssets,
previewDevice,
swiftPackageManager,
explicitPackageDependencies,
];
/// All current Flutter feature flags that can be configured.
@ -193,6 +197,30 @@ const Feature swiftPackageManager = Feature(
),
);
/// Enable explicit resolution and generation of package dependencies.
const Feature explicitPackageDependencies = Feature(
name: 'support for dev_dependency plugins',
configSetting: 'explicit-package-dependencies',
extraHelpText:
'Plugins that are resolved as result of being in "dev_dependencies" of a '
'package are not included in release builds of an app. By enabling this '
'feature, the synthetic "package:flutter_gen" can no longer be generated '
'and the legacy ".flutter-plugins" tool artifact is no longer generated.\n'
'\n'
'See also:\n'
'* https://flutter.dev/to/flutter-plugins-configuration.\n'
'* https://flutter.dev/to/flutter-gen-deprecation.',
master: FeatureChannelSetting(
available: true,
),
beta: FeatureChannelSetting(
available: true,
),
stable: FeatureChannelSetting(
available: true,
),
);
/// A [Feature] is a process for conditionally enabling tool features.
///
/// All settings are optional, and if not provided will generally default to

View File

@ -53,7 +53,6 @@ class FlutterDeviceManager extends DeviceManager {
required WindowsWorkflow windowsWorkflow,
required CustomDevicesConfig customDevicesConfig,
required TestCompilerNativeAssetsBuilder? nativeAssetsBuilder,
required bool useImplicitPubspecResolution,
}) : deviceDiscoverers = <DeviceDiscovery>[
AndroidDevices(
logger: logger,
@ -80,7 +79,6 @@ class FlutterDeviceManager extends DeviceManager {
logger: logger,
artifacts: artifacts,
nativeAssetsBuilder: nativeAssetsBuilder,
useImplicitPubspecResolution: useImplicitPubspecResolution,
),
MacOSDevices(
processManager: processManager,
@ -105,7 +103,6 @@ class FlutterDeviceManager extends DeviceManager {
logger: logger,
processManager: processManager,
featureFlags: featureFlags,
useImplicitPubspecResolution: useImplicitPubspecResolution,
),
LinuxDevices(
platform: platform,
@ -134,7 +131,6 @@ class FlutterDeviceManager extends DeviceManager {
processManager: processManager,
logger: logger,
config: customDevicesConfig,
useImplicitPubspecResolution: useImplicitPubspecResolution,
),
];

View File

@ -61,6 +61,9 @@ class FlutterFeatureFlags implements FeatureFlags {
@override
bool get isSwiftPackageManagerEnabled => isEnabled(swiftPackageManager);
@override
bool get isExplicitPackageDependenciesEnabled => isEnabled(explicitPackageDependencies);
@override
bool isEnabled(Feature feature) {
final String currentChannel = _flutterVersion.channel;

View File

@ -89,30 +89,13 @@ Future<Plugin?> _pluginFromPackage(
/// Returns a list of all plugins to be registered with the provided [project].
///
/// [useImplicitPubspecResolution] defines if legacy rules for traversing the
/// pub dependencies of a package implies, namely, that if `true`, all plugins
/// are assumed to be non-dev dependencies. Code that calls [findPlugins] in
/// order to obtain _other_ information about the plugins, such as whether a
/// plugin uses a specific language or platform can safely pass either `true`
/// or `false`; however a value of `false` _will_ cause `dart pub deps --json`
/// to trigger, which in turn could have other side-effects.
///
/// Please reach out to matanlurey@ if you find you need:
/// ```dart
/// useImplicitPubspecResolution: true
/// ```
///
/// ... in order for your code to function, as that path is being deprecated:
/// <https://flutter.dev/to/flutter-gen-deprecation>.
///
/// ---
///
/// If [throwOnError] is `true`, an empty package configuration is an error.
Future<List<Plugin>> findPlugins(
FlutterProject project, {
required bool useImplicitPubspecResolution,
bool throwOnError = true,
bool? determineDevDependencies,
}) async {
determineDevDependencies ??= featureFlags.isExplicitPackageDependenciesEnabled;
final List<Plugin> plugins = <Plugin>[];
final FileSystem fs = project.directory.fileSystem;
final File packageConfigFile = findPackageConfigFileOrDefault(project.directory);
@ -122,10 +105,7 @@ Future<List<Plugin>> findPlugins(
throwOnError: throwOnError,
);
final Set<String> devDependencies;
if (useImplicitPubspecResolution) {
// With --implicit-pubspec-resolution, we do not want to check for what
// plugins are dev dependencies and instead continue to assume the previous
// behavior (all plugins are non-dev dependencies).
if (!determineDevDependencies) {
devDependencies = <String>{};
} else {
devDependencies = await computeExclusiveDevDependencies(
@ -1062,14 +1042,16 @@ Future<void> refreshPluginsList(
bool iosPlatform = false,
bool macOSPlatform = false,
bool forceCocoaPodsOnly = false,
required bool useImplicitPubspecResolution,
bool? determineDevDependencies,
bool? generateLegacyPlugins,
}) async {
final List<Plugin> plugins = await findPlugins(project, useImplicitPubspecResolution: useImplicitPubspecResolution);
final List<Plugin> plugins = await findPlugins(project, determineDevDependencies: determineDevDependencies);
// Sort the plugins by name to keep ordering stable in generated files.
plugins.sort((Plugin left, Plugin right) => left.name.compareTo(right.name));
// TODO(matanlurey): Remove once migration is complete.
// Write the legacy plugin files to avoid breaking existing apps.
final bool legacyChanged = useImplicitPubspecResolution && _writeFlutterPluginsListLegacy(project, plugins);
generateLegacyPlugins ??= !featureFlags.isExplicitPackageDependenciesEnabled;
final bool legacyChanged = generateLegacyPlugins && _writeFlutterPluginsListLegacy(project, plugins);
bool swiftPackageManagerEnabledIos = false;
bool swiftPackageManagerEnabledMacos = false;
@ -1119,7 +1101,7 @@ Future<void> injectBuildTimePluginFilesForWebPlatform(
FlutterProject project, {
required Directory destination,
}) async {
final List<Plugin> plugins = await findPlugins(project, useImplicitPubspecResolution: true);
final List<Plugin> plugins = await findPlugins(project);
final Map<String, List<Plugin>> pluginsByPlatform = _resolvePluginImplementations(plugins, pluginResolutionType: _PluginResolutionType.nativeOrDart);
await _writeWebPluginRegistrant(project, pluginsByPlatform[WebPlugin.kConfigKey]!, destination);
}
@ -1138,7 +1120,6 @@ Future<void> injectBuildTimePluginFilesForWebPlatform(
/// Assumes [refreshPluginsList] has been called since last change to `pubspec.yaml`.
Future<void> injectPlugins(
FlutterProject project, {
required bool useImplicitPubspecResolution,
bool androidPlatform = false,
bool iosPlatform = false,
bool linuxPlatform = false,
@ -1147,7 +1128,7 @@ Future<void> injectPlugins(
Iterable<String>? allowedPlugins,
DarwinDependencyManagement? darwinDependencyManagement,
}) async {
final List<Plugin> plugins = await findPlugins(project, useImplicitPubspecResolution: useImplicitPubspecResolution);
final List<Plugin> plugins = await findPlugins(project);
final Map<String, List<Plugin>> pluginsByPlatform = _resolvePluginImplementations(plugins, pluginResolutionType: _PluginResolutionType.nativeOrDart);
if (androidPlatform) {
@ -1575,7 +1556,7 @@ Future<void> generateMainDartWithPluginRegistrant(
String currentMainUri,
File mainFile,
) async {
final List<Plugin> plugins = await findPlugins(rootProject, useImplicitPubspecResolution: true);
final List<Plugin> plugins = await findPlugins(rootProject);
final List<PluginInterfaceResolution> resolutions = resolvePlatformImplementation(
plugins,
selectDartPluginsOnly: true,

View File

@ -938,7 +938,7 @@ Future<bool> _isPluginSwiftPackageOnly({
required String pluginName,
required FileSystem fileSystem,
}) async {
final List<Plugin> plugins = await findPlugins(project, useImplicitPubspecResolution: true);
final List<Plugin> plugins = await findPlugins(project);
final Plugin? matched = plugins
.where((Plugin plugin) =>
plugin.name.toLowerCase() == pluginName.toLowerCase() &&

View File

@ -57,7 +57,6 @@ class DwdsWebRunnerFactory extends WebRunnerFactory {
required SystemClock systemClock,
required Usage usage,
required Analytics analytics,
required bool useImplicitPubspecResolution,
bool machine = false,
}) {
return ResidentWebRunner(
@ -73,7 +72,6 @@ class DwdsWebRunnerFactory extends WebRunnerFactory {
systemClock: systemClock,
fileSystem: fileSystem,
logger: logger,
useImplicitPubspecResolution: useImplicitPubspecResolution,
);
}
}
@ -89,7 +87,6 @@ class ResidentWebRunner extends ResidentRunner {
bool stayResident = true,
bool machine = false,
required this.flutterProject,
required bool useImplicitPubspecResolution,
required DebuggingOptions debuggingOptions,
required FileSystem fileSystem,
required Logger logger,
@ -105,7 +102,6 @@ class ResidentWebRunner extends ResidentRunner {
_usage = usage,
_analytics = analytics,
_urlTunneller = urlTunneller,
_useImplicitPubspecResolution = useImplicitPubspecResolution,
super(
<FlutterDevice>[device],
target: target ?? fileSystem.path.join('lib', 'main.dart'),
@ -113,7 +109,6 @@ class ResidentWebRunner extends ResidentRunner {
stayResident: stayResident,
machine: machine,
devtoolsHandler: devtoolsHandler,
useImplicitPubspecResolution: useImplicitPubspecResolution,
);
final FileSystem _fileSystem;
@ -122,7 +117,6 @@ class ResidentWebRunner extends ResidentRunner {
final Usage _usage;
final Analytics _analytics;
final UrlTunneller? _urlTunneller;
final bool _useImplicitPubspecResolution;
@override
Logger get logger => _logger;
@ -351,7 +345,6 @@ Please provide a valid TCP port (an integer between 0 and 65535, inclusive).
flutterVersion: globals.flutterVersion,
usage: globals.flutterUsage,
analytics: globals.analytics,
useImplicitPubspecResolution: _useImplicitPubspecResolution,
);
await webBuilder.buildWeb(
flutterProject,
@ -448,7 +441,6 @@ Please provide a valid TCP port (an integer between 0 and 65535, inclusive).
flutterVersion: globals.flutterVersion,
usage: globals.flutterUsage,
analytics: globals.analytics,
useImplicitPubspecResolution: _useImplicitPubspecResolution,
);
await webBuilder.buildWeb(
flutterProject,

View File

@ -38,7 +38,8 @@ Future<void> processPodsIfNeeded(
// file being generated. A better long-term fix would be not to have a call to refreshPluginsList
// at all, and instead have it implicitly run by the FlutterCommand instead. See
// https://github.com/flutter/flutter/issues/157391 for details.
useImplicitPubspecResolution: false,
determineDevDependencies: false,
generateLegacyPlugins: false,
);
// If there are no plugins and if the project is a not module with an existing

View File

@ -37,14 +37,12 @@ class PreviewDeviceDiscovery extends PollingDeviceDiscovery {
required Logger logger,
required ProcessManager processManager,
required FeatureFlags featureFlags,
required bool useImplicitPubspecResolution,
}) : _artifacts = artifacts,
_logger = logger,
_processManager = processManager,
_fileSystem = fileSystem,
_platform = platform,
_features = featureFlags,
_useImplicitPubspecResolution = useImplicitPubspecResolution,
super('Flutter preview device');
final Platform _platform;
@ -53,7 +51,6 @@ class PreviewDeviceDiscovery extends PollingDeviceDiscovery {
final ProcessManager _processManager;
final FileSystem _fileSystem;
final FeatureFlags _features;
final bool _useImplicitPubspecResolution;
@override
bool get canListAnything => _platform.isWindows;
@ -78,7 +75,6 @@ class PreviewDeviceDiscovery extends PollingDeviceDiscovery {
logger: _logger,
processManager: _processManager,
previewBinary: previewBinary,
useImplicitPubspecResolution: _useImplicitPubspecResolution,
);
return <Device>[
if (_features.isPreviewDeviceEnabled)
@ -103,7 +99,6 @@ class PreviewDevice extends Device {
required FileSystem fileSystem,
required Artifacts artifacts,
required File previewBinary,
required bool useImplicitPubspecResolution,
@visibleForTesting BundleBuilderFactory builderFactory = _defaultBundleBuilder,
}) : _previewBinary = previewBinary,
_processManager = processManager,
@ -111,7 +106,6 @@ class PreviewDevice extends Device {
_fileSystem = fileSystem,
_bundleBuilderFactory = builderFactory,
_artifacts = artifacts,
_useImplicitPubspecResolution = useImplicitPubspecResolution,
super('preview', ephemeral: false, category: Category.desktop, platformType: PlatformType.windowsPreview);
final ProcessManager _processManager;
@ -120,7 +114,6 @@ class PreviewDevice extends Device {
final BundleBuilderFactory _bundleBuilderFactory;
final Artifacts _artifacts;
final File _previewBinary;
final bool _useImplicitPubspecResolution;
/// The set of plugins that are allowed to be used by Preview users.
///
@ -191,7 +184,6 @@ class PreviewDevice extends Device {
mainPath: mainPath,
platform: TargetPlatform.windows_x64,
assetDirPath: getAssetBuildDirectory(),
useImplicitPubspecResolution: _useImplicitPubspecResolution,
);
copyDirectory(_fileSystem.directory(
getAssetBuildDirectory()),

View File

@ -321,7 +321,6 @@ class FlutterProject {
Future<void> regeneratePlatformSpecificTooling({
DeprecationBehavior deprecationBehavior = DeprecationBehavior.none,
Iterable<String>? allowedPlugins,
required bool useImplicitPubspecResolution,
}) async {
return ensureReadyForPlatformSpecificTooling(
androidPlatform: android.existsSync(),
@ -334,7 +333,6 @@ class FlutterProject {
webPlatform: featureFlags.isWebEnabled && web.existsSync(),
deprecationBehavior: deprecationBehavior,
allowedPlugins: allowedPlugins,
useImplicitPubspecResolution: useImplicitPubspecResolution,
);
}
@ -349,7 +347,6 @@ class FlutterProject {
bool webPlatform = false,
DeprecationBehavior deprecationBehavior = DeprecationBehavior.none,
Iterable<String>? allowedPlugins,
required bool useImplicitPubspecResolution,
}) async {
if (!directory.existsSync() || isPlugin) {
return;
@ -358,7 +355,6 @@ class FlutterProject {
this,
iosPlatform: iosPlatform,
macOSPlatform: macOSPlatform,
useImplicitPubspecResolution: useImplicitPubspecResolution,
);
if (androidPlatform) {
await android.ensureReadyForPlatformSpecificTooling(deprecationBehavior: deprecationBehavior);
@ -386,7 +382,6 @@ class FlutterProject {
macOSPlatform: macOSPlatform,
windowsPlatform: windowsPlatform,
allowedPlugins: allowedPlugins,
useImplicitPubspecResolution: useImplicitPubspecResolution,
);
}

View File

@ -1053,7 +1053,6 @@ abstract class ResidentRunner extends ResidentHandlers {
this.flutterDevices, {
required this.target,
required this.debuggingOptions,
required bool useImplicitPubspecResolution,
String? projectRootPath,
this.stayResident = true,
this.hotMode = true,
@ -1064,7 +1063,6 @@ abstract class ResidentRunner extends ResidentHandlers {
packagesFilePath = debuggingOptions.buildInfo.packageConfigPath,
projectRootPath = projectRootPath ?? globals.fs.currentDirectory.path,
_dillOutputPath = dillOutputPath,
_useImplicitPubspecResolution = useImplicitPubspecResolution,
artifactDirectory = dillOutputPath == null
? globals.fs.systemTempDirectory.createTempSync('flutter_tool.')
: globals.fs.file(dillOutputPath).parent,
@ -1097,7 +1095,6 @@ abstract class ResidentRunner extends ResidentHandlers {
@override
final bool stayResident;
final String? _dillOutputPath;
final bool _useImplicitPubspecResolution;
/// The parent location of the incremental artifacts.
final Directory artifactDirectory;
final String packagesFilePath;
@ -1224,7 +1221,6 @@ abstract class ResidentRunner extends ResidentHandlers {
// Needed for Dart plugin registry generation.
kTargetFile: mainPath,
},
useImplicitPubspecResolution: _useImplicitPubspecResolution,
);
final CompositeTarget compositeTarget = CompositeTarget(<Target>[

View File

@ -18,7 +18,6 @@ class ColdRunner extends ResidentRunner {
super.flutterDevices, {
required super.target,
required super.debuggingOptions,
required super.useImplicitPubspecResolution,
this.traceStartup = false,
this.awaitFirstFrameWhenTracing = true,
this.applicationBinary,

View File

@ -79,7 +79,6 @@ class HotRunner extends ResidentRunner {
super.flutterDevices, {
required super.target,
required super.debuggingOptions,
required super.useImplicitPubspecResolution,
this.benchmarkMode = false,
this.applicationBinary,
this.hostIsIde = false,

View File

@ -1770,7 +1770,6 @@ Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and
projectDir: project.directory,
packageConfigPath: packageConfigPath(),
generateDartPluginRegistry: true,
useImplicitPubspecResolution: globalResults!.flag(FlutterGlobalOptions.kImplicitPubspecResolution),
);
await pub.get(
@ -1793,7 +1792,6 @@ Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and
}
await project.regeneratePlatformSpecificTooling(
allowedPlugins: allowedPlugins,
useImplicitPubspecResolution: boolArg(FlutterGlobalOptions.kImplicitPubspecResolution, global: true),
);
if (reportNullSafety) {
await _sendNullSafetyAnalyticsEvents(project);

View File

@ -51,7 +51,6 @@ class FlutterTesterDevice extends Device {
required super.logger,
required FileSystem fileSystem,
required Artifacts artifacts,
required bool useImplicitPubspecResolution,
TestCompilerNativeAssetsBuilder? nativeAssetsBuilder,
}) : _processManager = processManager,
_flutterVersion = flutterVersion,
@ -59,7 +58,6 @@ class FlutterTesterDevice extends Device {
_fileSystem = fileSystem,
_artifacts = artifacts,
_nativeAssetsBuilder = nativeAssetsBuilder,
_useImplicitPubspecResolution = useImplicitPubspecResolution,
super(
platformType: null,
category: null,
@ -72,7 +70,6 @@ class FlutterTesterDevice extends Device {
final FileSystem _fileSystem;
final Artifacts _artifacts;
final TestCompilerNativeAssetsBuilder? _nativeAssetsBuilder;
final bool _useImplicitPubspecResolution;
Process? _process;
final DevicePortForwarder _portForwarder = const NoOpDevicePortForwarder();
@ -167,7 +164,6 @@ class FlutterTesterDevice extends Device {
applicationKernelFilePath: applicationKernelFilePath,
platform: TargetPlatform.tester,
assetDirPath: assetDirectory.path,
useImplicitPubspecResolution: _useImplicitPubspecResolution,
);
final List<String> command = <String>[
@ -269,7 +265,6 @@ class FlutterTesterDevices extends PollingDeviceDiscovery {
required ProcessManager processManager,
required Logger logger,
required FlutterVersion flutterVersion,
required bool useImplicitPubspecResolution,
TestCompilerNativeAssetsBuilder? nativeAssetsBuilder,
}) : _testerDevice = FlutterTesterDevice(
kTesterDeviceId,
@ -279,7 +274,6 @@ class FlutterTesterDevices extends PollingDeviceDiscovery {
logger: logger,
flutterVersion: flutterVersion,
nativeAssetsBuilder: nativeAssetsBuilder,
useImplicitPubspecResolution: useImplicitPubspecResolution,
),
super('Flutter tester');

View File

@ -46,15 +46,13 @@ class WebBuilder {
required Analytics analytics,
required FlutterVersion flutterVersion,
required FileSystem fileSystem,
required bool useImplicitPubspecResolution,
}) : _logger = logger,
_processManager = processManager,
_buildSystem = buildSystem,
_flutterUsage = usage,
_analytics = analytics,
_flutterVersion = flutterVersion,
_fileSystem = fileSystem,
_useImplicitPubspecResolution = useImplicitPubspecResolution;
_fileSystem = fileSystem;
final Logger _logger;
final ProcessManager _processManager;
@ -63,7 +61,6 @@ class WebBuilder {
final Analytics _analytics;
final FlutterVersion _flutterVersion;
final FileSystem _fileSystem;
final bool _useImplicitPubspecResolution;
Future<void> buildWeb(
FlutterProject flutterProject,
@ -74,8 +71,8 @@ class WebBuilder {
String? baseHref,
String? outputDirectoryPath,
}) async {
final bool hasWebPlugins =
(await findPlugins(flutterProject, useImplicitPubspecResolution: true)).any((Plugin p) => p.platforms.containsKey(WebPlugin.kConfigKey));
final bool hasWebPlugins = (await findPlugins(flutterProject))
.any((Plugin p) => p.platforms.containsKey(WebPlugin.kConfigKey));
final Directory outputDirectory = outputDirectoryPath == null
? _fileSystem.directory(getWebBuildDirectory())
: _fileSystem.directory(outputDirectoryPath);
@ -89,7 +86,8 @@ class WebBuilder {
final ProjectMigration migration = ProjectMigration(migrators);
await migration.run();
final Status status = _logger.startProgress('Compiling $target for the Web...');
final Status status =
_logger.startProgress('Compiling $target for the Web...');
final Stopwatch sw = Stopwatch()..start();
try {
final BuildResult result = await _buildSystem.build(
@ -97,7 +95,9 @@ class WebBuilder {
Environment(
projectDir: _fileSystem.currentDirectory,
outputDir: outputDirectory,
buildDir: flutterProject.directory.childDirectory('.dart_tool').childDirectory('flutter_build'),
buildDir: flutterProject.directory
.childDirectory('.dart_tool')
.childDirectory('flutter_build'),
defines: <String, String>{
kTargetFile: target,
kHasWebPlugins: hasWebPlugins.toString(),
@ -114,15 +114,17 @@ class WebBuilder {
usage: _flutterUsage,
analytics: _analytics,
cacheDir: globals.cache.getRoot(),
engineVersion: globals.artifacts!.usesLocalArtifacts ? null : _flutterVersion.engineRevision,
engineVersion: globals.artifacts!.usesLocalArtifacts
? null
: _flutterVersion.engineRevision,
flutterRootDir: _fileSystem.directory(Cache.flutterRoot),
// Web uses a different Dart plugin registry.
// https://github.com/flutter/flutter/issues/80406
generateDartPluginRegistry: false,
useImplicitPubspecResolution: _useImplicitPubspecResolution,
));
if (!result.success) {
for (final ExceptionMeasurement measurement in result.exceptions.values) {
for (final ExceptionMeasurement measurement
in result.exceptions.values) {
_logger.printError(
'Target ${measurement.target} failed: ${measurement.exception}',
stackTrace: measurement.fatal ? measurement.stackTrace : null,
@ -161,7 +163,8 @@ class WebBuilder {
));
final Duration elapsedDuration = sw.elapsed;
final String variableName = compilerConfigs.length > 1 ? 'dual-compile' : 'dart2js';
final String variableName =
compilerConfigs.length > 1 ? 'dual-compile' : 'dart2js';
_flutterUsage.sendTiming(
'build',
variableName,
@ -189,7 +192,8 @@ enum WebRendererMode implements CliEnum {
/// Always use skwasm.
skwasm;
factory WebRendererMode.fromCliOption(String? webRendererString, {required bool useWasm}) {
factory WebRendererMode.fromCliOption(String? webRendererString,
{required bool useWasm}) {
if (webRendererString == null) {
return getDefault(useWasm: useWasm);
}
@ -215,8 +219,8 @@ enum WebRendererMode implements CliEnum {
/// Returns a consistent deprecation warning for the WebRendererMode.
String get deprecationWarning =>
'The HTML Renderer is deprecated. Do not use "--web-renderer=$name".'
'\nSee: https://docs.flutter.dev/to/web-html-renderer-deprecation';
'The HTML Renderer is deprecated. Do not use "--web-renderer=$name".'
'\nSee: https://docs.flutter.dev/to/web-html-renderer-deprecation';
@override
String get cliName => kebabCase(name);
@ -253,9 +257,11 @@ enum WebRendererMode implements CliEnum {
List<String> updateDartDefines(List<String> inputDefines) {
final Set<String> dartDefinesSet = inputDefines.toSet();
if (!inputDefines.any((String d) => d.startsWith('FLUTTER_WEB_AUTO_DETECT='))
&& inputDefines.any((String d) => d.startsWith('FLUTTER_WEB_USE_SKIA='))) {
dartDefinesSet.removeWhere((String d) => d.startsWith('FLUTTER_WEB_USE_SKIA='));
if (!inputDefines
.any((String d) => d.startsWith('FLUTTER_WEB_AUTO_DETECT=')) &&
inputDefines.any((String d) => d.startsWith('FLUTTER_WEB_USE_SKIA='))) {
dartDefinesSet
.removeWhere((String d) => d.startsWith('FLUTTER_WEB_USE_SKIA='));
}
dartDefinesSet.addAll(dartDefines);
return dartDefinesSet.toList();
@ -264,16 +270,19 @@ enum WebRendererMode implements CliEnum {
/// The correct precompiled artifact to use for each build and render mode for DDC with AMD modules.
// TODO(markzipan): delete this when DDC's AMD module system is deprecated, https://github.com/flutter/flutter/issues/142060.
const Map<WebRendererMode, Map<NullSafetyMode, HostArtifact>> kAmdDartSdkJsArtifactMap = <WebRendererMode, Map<NullSafetyMode, HostArtifact>>{
WebRendererMode.auto: <NullSafetyMode, HostArtifact> {
NullSafetyMode.sound: HostArtifact.webPrecompiledAmdCanvaskitAndHtmlSoundSdk,
const Map<WebRendererMode, Map<NullSafetyMode, HostArtifact>>
kAmdDartSdkJsArtifactMap =
<WebRendererMode, Map<NullSafetyMode, HostArtifact>>{
WebRendererMode.auto: <NullSafetyMode, HostArtifact>{
NullSafetyMode.sound:
HostArtifact.webPrecompiledAmdCanvaskitAndHtmlSoundSdk,
NullSafetyMode.unsound: HostArtifact.webPrecompiledAmdCanvaskitAndHtmlSdk,
},
WebRendererMode.canvaskit: <NullSafetyMode, HostArtifact> {
WebRendererMode.canvaskit: <NullSafetyMode, HostArtifact>{
NullSafetyMode.sound: HostArtifact.webPrecompiledAmdCanvaskitSoundSdk,
NullSafetyMode.unsound: HostArtifact.webPrecompiledAmdCanvaskitSdk,
},
WebRendererMode.html: <NullSafetyMode, HostArtifact> {
WebRendererMode.html: <NullSafetyMode, HostArtifact>{
NullSafetyMode.sound: HostArtifact.webPrecompiledAmdSoundSdk,
NullSafetyMode.unsound: HostArtifact.webPrecompiledAmdSdk,
},
@ -281,48 +290,63 @@ const Map<WebRendererMode, Map<NullSafetyMode, HostArtifact>> kAmdDartSdkJsArtif
/// The correct source map artifact to use for each build and render mode for DDC with AMD modules.
// TODO(markzipan): delete this when DDC's AMD module system is deprecated, https://github.com/flutter/flutter/issues/142060.
const Map<WebRendererMode, Map<NullSafetyMode, HostArtifact>> kAmdDartSdkJsMapArtifactMap = <WebRendererMode, Map<NullSafetyMode, HostArtifact>>{
WebRendererMode.auto: <NullSafetyMode, HostArtifact> {
NullSafetyMode.sound: HostArtifact.webPrecompiledAmdCanvaskitAndHtmlSoundSdkSourcemaps,
NullSafetyMode.unsound: HostArtifact.webPrecompiledAmdCanvaskitAndHtmlSdkSourcemaps,
const Map<WebRendererMode, Map<NullSafetyMode, HostArtifact>>
kAmdDartSdkJsMapArtifactMap =
<WebRendererMode, Map<NullSafetyMode, HostArtifact>>{
WebRendererMode.auto: <NullSafetyMode, HostArtifact>{
NullSafetyMode.sound:
HostArtifact.webPrecompiledAmdCanvaskitAndHtmlSoundSdkSourcemaps,
NullSafetyMode.unsound:
HostArtifact.webPrecompiledAmdCanvaskitAndHtmlSdkSourcemaps,
},
WebRendererMode.canvaskit: <NullSafetyMode, HostArtifact> {
NullSafetyMode.sound: HostArtifact.webPrecompiledAmdCanvaskitSoundSdkSourcemaps,
NullSafetyMode.unsound: HostArtifact.webPrecompiledAmdCanvaskitSdkSourcemaps,
WebRendererMode.canvaskit: <NullSafetyMode, HostArtifact>{
NullSafetyMode.sound:
HostArtifact.webPrecompiledAmdCanvaskitSoundSdkSourcemaps,
NullSafetyMode.unsound:
HostArtifact.webPrecompiledAmdCanvaskitSdkSourcemaps,
},
WebRendererMode.html: <NullSafetyMode, HostArtifact> {
WebRendererMode.html: <NullSafetyMode, HostArtifact>{
NullSafetyMode.sound: HostArtifact.webPrecompiledAmdSoundSdkSourcemaps,
NullSafetyMode.unsound: HostArtifact.webPrecompiledAmdSdkSourcemaps,
},
};
/// The correct precompiled artifact to use for each build and render mode for DDC with DDC modules.
const Map<WebRendererMode, Map<NullSafetyMode, HostArtifact>> kDdcDartSdkJsArtifactMap = <WebRendererMode, Map<NullSafetyMode, HostArtifact>>{
WebRendererMode.auto: <NullSafetyMode, HostArtifact> {
NullSafetyMode.sound: HostArtifact.webPrecompiledDdcCanvaskitAndHtmlSoundSdk,
const Map<WebRendererMode, Map<NullSafetyMode, HostArtifact>>
kDdcDartSdkJsArtifactMap =
<WebRendererMode, Map<NullSafetyMode, HostArtifact>>{
WebRendererMode.auto: <NullSafetyMode, HostArtifact>{
NullSafetyMode.sound:
HostArtifact.webPrecompiledDdcCanvaskitAndHtmlSoundSdk,
NullSafetyMode.unsound: HostArtifact.webPrecompiledDdcCanvaskitAndHtmlSdk,
},
WebRendererMode.canvaskit: <NullSafetyMode, HostArtifact> {
WebRendererMode.canvaskit: <NullSafetyMode, HostArtifact>{
NullSafetyMode.sound: HostArtifact.webPrecompiledDdcCanvaskitSoundSdk,
NullSafetyMode.unsound: HostArtifact.webPrecompiledDdcCanvaskitSdk,
},
WebRendererMode.html: <NullSafetyMode, HostArtifact> {
WebRendererMode.html: <NullSafetyMode, HostArtifact>{
NullSafetyMode.sound: HostArtifact.webPrecompiledDdcSoundSdk,
NullSafetyMode.unsound: HostArtifact.webPrecompiledDdcSdk,
},
};
/// The correct source map artifact to use for each build and render mode for DDC with DDC modules.
const Map<WebRendererMode, Map<NullSafetyMode, HostArtifact>> kDdcDartSdkJsMapArtifactMap = <WebRendererMode, Map<NullSafetyMode, HostArtifact>>{
WebRendererMode.auto: <NullSafetyMode, HostArtifact> {
NullSafetyMode.sound: HostArtifact.webPrecompiledDdcCanvaskitAndHtmlSoundSdkSourcemaps,
NullSafetyMode.unsound: HostArtifact.webPrecompiledDdcCanvaskitAndHtmlSdkSourcemaps,
const Map<WebRendererMode, Map<NullSafetyMode, HostArtifact>>
kDdcDartSdkJsMapArtifactMap =
<WebRendererMode, Map<NullSafetyMode, HostArtifact>>{
WebRendererMode.auto: <NullSafetyMode, HostArtifact>{
NullSafetyMode.sound:
HostArtifact.webPrecompiledDdcCanvaskitAndHtmlSoundSdkSourcemaps,
NullSafetyMode.unsound:
HostArtifact.webPrecompiledDdcCanvaskitAndHtmlSdkSourcemaps,
},
WebRendererMode.canvaskit: <NullSafetyMode, HostArtifact> {
NullSafetyMode.sound: HostArtifact.webPrecompiledDdcCanvaskitSoundSdkSourcemaps,
NullSafetyMode.unsound: HostArtifact.webPrecompiledDdcCanvaskitSdkSourcemaps,
WebRendererMode.canvaskit: <NullSafetyMode, HostArtifact>{
NullSafetyMode.sound:
HostArtifact.webPrecompiledDdcCanvaskitSoundSdkSourcemaps,
NullSafetyMode.unsound:
HostArtifact.webPrecompiledDdcCanvaskitSdkSourcemaps,
},
WebRendererMode.html: <NullSafetyMode, HostArtifact> {
WebRendererMode.html: <NullSafetyMode, HostArtifact>{
NullSafetyMode.sound: HostArtifact.webPrecompiledDdcSoundSdkSourcemaps,
NullSafetyMode.unsound: HostArtifact.webPrecompiledDdcSdkSourcemaps,
},

View File

@ -33,7 +33,6 @@ abstract class WebRunnerFactory {
required SystemClock systemClock,
required Usage usage,
required Analytics analytics,
required bool useImplicitPubspecResolution,
bool machine = false,
});
}

View File

@ -1259,7 +1259,6 @@ class FakeHotRunnerFactory extends Fake implements HotRunnerFactory {
Analytics? analytics,
String? nativeAssetsYamlFile,
HotRunnerNativeAssetsBuilder? nativeAssetsBuilder,
required bool useImplicitPubspecResolution,
}) {
if (_artifactTester != null) {
for (final FlutterDevice device in devices) {

View File

@ -99,7 +99,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'daemon.version'}));
final DaemonMessage response = await daemonStreams.outputs.stream.firstWhere(_notEvent);
@ -112,7 +111,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
// Use the flutter_gallery project which has a known set of supported platforms.
final String projectPath = globals.fs.path.join(getFlutterRoot(), 'dev', 'integration_tests', 'flutter_gallery');
@ -217,7 +215,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
globals.printError('daemon.logMessage test');
final DaemonMessage response = await daemonStreams.outputs.stream.firstWhere((DaemonMessage message) {
@ -236,7 +233,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
globals.printWarning('daemon.logMessage test');
final DaemonMessage response = await daemonStreams.outputs.stream.firstWhere((DaemonMessage message) {
@ -257,7 +253,6 @@ void main() {
daemonConnection,
notifyingLogger: notifyingLogger,
logToStdout: true,
useImplicitPubspecResolution: true,
);
globals.printStatus('daemon.logMessage test');
return Future<void>.value();
@ -274,7 +269,6 @@ void main() {
daemonConnection,
notifyingLogger: notifyingLogger,
logToStdout: true,
useImplicitPubspecResolution: true,
);
globals.printBox('This is the box message', title: 'Sample title');
return Future<void>.value();
@ -289,7 +283,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
notifyingLogger.notifyVerbose = false;
globals.printTrace('daemon.logMessage test 1');
@ -311,7 +304,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
expect(notifyingLogger.notifyVerbose, false);
@ -330,7 +322,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
notifyingLogger.notifyVerbose = false;
@ -349,7 +340,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'daemon.shutdown'}));
return daemon.onExit.then<void>((int code) async {
@ -362,7 +352,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'app.restart'}));
@ -375,7 +364,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{
@ -394,7 +382,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'app.stop'}));
@ -407,7 +394,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'device.getDevices'}));
final DaemonMessage response = await daemonStreams.outputs.stream.firstWhere(_notEvent);
@ -419,7 +405,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
daemon.deviceDomain.addDeviceDiscoverer(discoverer);
@ -436,7 +421,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
@ -450,7 +434,6 @@ void main() {
previewBinary: fs.file(r'preview_device.exe'),
artifacts: Artifacts.test(fileSystem: fs),
builderFactory: () => throw UnimplementedError('TODO implement builder factory'),
useImplicitPubspecResolution: true,
));
final List<Map<String, Object?>> names = <Map<String, Object?>>[];
@ -521,7 +504,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'device.discoverDevices'}));
final DaemonMessage response = await daemonStreams.outputs.stream.firstWhere(_notEvent);
@ -533,7 +515,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
daemon.deviceDomain.addDeviceDiscoverer(discoverer);
@ -551,7 +532,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
daemon.deviceDomain.addDeviceDiscoverer(discoverer);
@ -576,7 +556,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
daemon.deviceDomain.addDeviceDiscoverer(discoverer);
@ -628,7 +607,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
daemon.deviceDomain.addDeviceDiscoverer(discoverer);
@ -695,7 +673,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
daemon.deviceDomain.addDeviceDiscoverer(discoverer);
@ -755,7 +732,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
final FakePollingDeviceDiscovery discoverer1 = FakePollingDeviceDiscovery();
discoverer1.diagnostics = <String>['fake diagnostic 1', 'fake diagnostic 2'];
@ -781,7 +757,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'emulator.launch'}));
@ -794,7 +769,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
final Map<String, Object?> params = <String, Object?>{'emulatorId': 'device', 'coldBoot': 1};
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'emulator.launch', 'params': params}));
@ -807,7 +781,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'emulator.getEmulators'}));
final DaemonMessage response = await daemonStreams.outputs.stream.firstWhere(_notEvent);
@ -822,7 +795,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
// Respond to any requests from the daemon to expose a URL.
@ -842,7 +814,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'devtools.serve'}));
@ -859,7 +830,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'devtools.serve'}));
@ -890,7 +860,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'proxy.connect', 'params': <String, Object?>{'port': 123}}));
@ -951,7 +920,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'proxy.connect', 'params': <String, Object?>{'port': 123}}));
@ -972,7 +940,6 @@ void main() {
daemon = Daemon(
daemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
daemonStreams.inputs.add(DaemonMessage(<String, Object?>{'id': 0, 'method': 'proxy.connect', 'params': <String, Object?>{'port': 123}}));

View File

@ -377,7 +377,7 @@ untranslated-messages-file: lib/l10n/untranslated.json
});
// Regression test for https://github.com/flutter/flutter/issues/120530.
testWithoutContext('dart format is run when generateLocalizations is called through build target', () async {
testUsingContext('dart format is run when generateLocalizations is called through build target', () async {
final File arbFile = fileSystem.file(fileSystem.path.join('lib', 'l10n', 'app_en.arb'))
..createSync(recursive: true);
arbFile.writeAsStringSync('''

View File

@ -71,7 +71,6 @@ void main() {
daemon = Daemon(
serverDaemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
fakeDevice = FakeAndroidDevice();
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
@ -93,7 +92,6 @@ void main() {
daemon = Daemon(
serverDaemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
fakeDevice = FakeAndroidDevice();
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
@ -116,7 +114,6 @@ void main() {
daemon = Daemon(
serverDaemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
fakeDevice = FakeAndroidDevice();
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
@ -147,7 +144,6 @@ void main() {
daemon = Daemon(
serverDaemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
fakeDevice = FakeAndroidDevice();
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();
@ -201,7 +197,6 @@ void main() {
daemon = Daemon(
serverDaemonConnection,
notifyingLogger: notifyingLogger,
useImplicitPubspecResolution: true,
);
fakeDevice = FakeAndroidDevice();
final FakePollingDeviceDiscovery discoverer = FakePollingDeviceDiscovery();

View File

@ -1583,14 +1583,14 @@ class DaemonCapturingRunCommand extends RunCommand {
@override
Daemon createMachineDaemon() {
daemon = super.createMachineDaemon();
appDomain = daemon.appDomain = CapturingAppDomain(daemon, useImplicitPubspecResolution: true);
appDomain = daemon.appDomain = CapturingAppDomain(daemon);
daemon.registerDomain(appDomain);
return daemon;
}
}
class CapturingAppDomain extends AppDomain {
CapturingAppDomain(super.daemon, {required super.useImplicitPubspecResolution});
CapturingAppDomain(super.daemon);
String? userIdentifier;
bool? enableDevTools;

View File

@ -544,6 +544,5 @@ class FakeBundleBuilder extends Fake implements BundleBuilder {
String? assetDirPath,
bool buildNativeAssets = true,
@visibleForTesting BuildSystem? buildSystem,
required bool useImplicitPubspecResolution,
}) async {}
}

View File

@ -15,6 +15,7 @@ import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/commands/packages.dart';
import 'package:flutter_tools/src/dart/pub.dart';
import 'package:flutter_tools/src/features.dart';
import 'package:flutter_tools/src/globals.dart' as globals;
import 'package:unified_analytics/unified_analytics.dart';
import 'package:yaml/yaml.dart';
@ -636,7 +637,7 @@ workspace:
),
});
testUsingContext('get --no-implicit-pubspec-resolution omits ".flutter-plugins"', () async {
testUsingContext('get explicit-packages-resolution omits ".flutter-plugins"', () async {
final String projectPath = await createProject(
tempDir,
arguments: <String>['--template=plugin', '--no-pub', '--platforms=ios,android'],
@ -646,12 +647,15 @@ workspace:
removeGeneratedFiles(exampleProjectPath);
// Running flutter packages get also resolves the dependencies in the example/ project.
await runCommandIn(projectPath, 'get', globalArgs: <String>['--no-implicit-pubspec-resolution']);
await runCommandIn(projectPath, 'get');
expectDependenciesResolved(projectPath);
expectDependenciesResolved(exampleProjectPath);
expectPluginInjected(exampleProjectPath, includeLegacyPluginsList: false);
}, overrides: <Type, Generator>{
FeatureFlags: () => TestFeatureFlags(
isExplicitPackageDependenciesEnabled: true,
),
Stdio: () => mockStdio,
Pub: () => Pub.test(
fileSystem: globals.fs,

View File

@ -48,7 +48,6 @@ void main() {
assetDirPath: 'example',
depfilePath: 'example.d',
buildSystem: buildSystem,
useImplicitPubspecResolution: true,
);
expect(globals.fs.file(globals.fs.path.join('example', 'kernel_blob.bin')).existsSync(), true);
expect(globals.fs.file(globals.fs.path.join('example', 'LICENSE')).existsSync(), true);
@ -138,7 +137,6 @@ void main() {
assetDirPath: 'example',
depfilePath: 'example.d',
buildSystem: TestBuildSystem.all(BuildResult(success: false)),
useImplicitPubspecResolution: true,
),
throwsToolExit()
);
@ -184,7 +182,6 @@ void main() {
assetDirPath: assetDirPath,
depfilePath: depfilePath,
buildSystem: buildSystem,
useImplicitPubspecResolution: true,
);
expect(env, isNotNull);

View File

@ -42,7 +42,6 @@ void main() {
final int exitCode = await ColdRunner(devices,
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug),
target: 'main.dart',
useImplicitPubspecResolution: true,
).attach();
expect(exitCode, 2);
});
@ -59,7 +58,6 @@ void main() {
await ColdRunner(devices,
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug),
target: 'main.dart',
useImplicitPubspecResolution: true,
).cleanupAtFinish();
expect(flutterDevice1.stopEchoingDeviceLogCount, 1);
@ -89,7 +87,6 @@ void main() {
applicationBinary: applicationBinary,
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug),
target: 'main.dart',
useImplicitPubspecResolution: true,
).run();
expect(result, 1);
@ -106,7 +103,6 @@ void main() {
debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug),
target: 'main.dart',
traceStartup: true,
useImplicitPubspecResolution: true,
).run();
expect(result, 0);
@ -130,7 +126,6 @@ void main() {
debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug),
target: 'main.dart',
traceStartup: true,
useImplicitPubspecResolution: true,
).run();
expect(result, 0);

View File

@ -29,7 +29,6 @@ void main() {
bindPorts.add(port);
return socket;
},
useImplicitPubspecResolution: true,
);
await server.run();
expect(bindCalledTimes, 1);
@ -57,7 +56,6 @@ void main() {
}
return socket;
},
useImplicitPubspecResolution: true,
);
await server.run();
expect(bindCalledTimes, 2);

View File

@ -123,7 +123,6 @@ void main() {
config: testConfig,
processManager: FakeProcessManager.any(),
logger: BufferLogger.test(),
useImplicitPubspecResolution: true,
);
final PrebuiltLinuxApp linuxApp = PrebuiltLinuxApp(executable: 'foo');
@ -167,7 +166,6 @@ void main() {
directory: dir,
logger: BufferLogger.test()
),
useImplicitPubspecResolution: true,
).devices(), <Device>[]);
});
@ -186,7 +184,6 @@ void main() {
directory: dir,
logger: BufferLogger.test()
),
useImplicitPubspecResolution: true,
).devices(), <Device>[]);
});
@ -211,7 +208,6 @@ void main() {
directory: dir,
logger: BufferLogger.test()
),
useImplicitPubspecResolution: true,
).devices(),
hasLength(1)
);
@ -240,7 +236,6 @@ void main() {
directory: dir,
logger: BufferLogger.test(),
),
useImplicitPubspecResolution: true,
);
final List<Device> discoveredDevices = await discovery.discoverDevices();
@ -270,7 +265,6 @@ void main() {
directory: dir,
logger: BufferLogger.test(),
),
useImplicitPubspecResolution: true,
);
expect(await discovery.discoverDevices(), hasLength(0));
@ -295,7 +289,6 @@ void main() {
directory: dir,
logger: BufferLogger.test(),
),
useImplicitPubspecResolution: true,
);
expect(await discovery.discoverDevices(), hasLength(0));
@ -315,7 +308,6 @@ void main() {
config: testConfig,
logger: BufferLogger.test(),
processManager: FakeProcessManager.any(),
useImplicitPubspecResolution: true,
).isSupportedForProject(flutterProject), true);
});
@ -331,7 +323,6 @@ void main() {
FakeCommand(command: testConfig.uninstallCommand),
FakeCommand(command: testConfig.installCommand, onRun: (_) => bothCommandsWereExecuted = true),
]),
useImplicitPubspecResolution: true,
);
expect(await device.installApp(PrebuiltLinuxApp(executable: 'exe')), true);
@ -394,7 +385,6 @@ void main() {
config: testConfig,
logger: BufferLogger.test(),
processManager: processManager,
useImplicitPubspecResolution: true,
),
appPackage: PrebuiltLinuxApp(executable: 'testexecutable'),
logger: BufferLogger.test(),
@ -432,7 +422,6 @@ void main() {
config: testConfigNonForwarding,
logger: BufferLogger.test(),
processManager: processManager,
useImplicitPubspecResolution: true,
),
appPackage: PrebuiltLinuxApp(executable: 'testexecutable'),
logger: BufferLogger.test(),
@ -498,7 +487,6 @@ void main() {
directory: configFileDir,
logger: BufferLogger.test()
),
useImplicitPubspecResolution: true,
);
final List<Device> devices = await customDevices.discoverDevices();
@ -548,7 +536,6 @@ void main() {
config: testConfig,
logger: BufferLogger.test(),
processManager: processManager,
useImplicitPubspecResolution: true,
);
expect(device.supportsScreenshot, true);
@ -577,7 +564,6 @@ void main() {
),
logger: BufferLogger.test(),
processManager: processManager,
useImplicitPubspecResolution: true,
);
expect(device.supportsScreenshot, false);
@ -596,7 +582,6 @@ void main() {
),
logger: BufferLogger.test(),
processManager: FakeProcessManager.empty(),
useImplicitPubspecResolution: true,
);
expect(await device.targetPlatform, TargetPlatform.linux_x64);
@ -664,7 +649,6 @@ class FakeBundleBuilder extends Fake implements BundleBuilder {
String? assetDirPath,
Uri? nativeAssets,
bool buildNativeAssets = true,
required bool useImplicitPubspecResolution,
@visibleForTesting BuildSystem? buildSystem
}) async {}
}

View File

@ -12,14 +12,16 @@ import 'package:flutter_tools/src/build_system/build_system.dart';
import 'package:flutter_tools/src/build_system/build_targets.dart';
import 'package:flutter_tools/src/build_system/targets/localizations.dart';
import 'package:flutter_tools/src/dart/generate_synthetic_packages.dart';
import 'package:flutter_tools/src/features.dart';
import 'package:flutter_tools/src/isolated/build_targets.dart';
import '../../src/common.dart';
import '../../src/fake_process_manager.dart';
import '../../src/context.dart';
import '../../src/fakes.dart';
import '../../src/test_build_system.dart';
void main() {
testWithoutContext('calls buildSystem.build with blank l10n.yaml file', () async {
testUsingContext('calls buildSystem.build with blank l10n.yaml file', () async {
// Project directory setup for gen_l10n logic
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
@ -68,7 +70,7 @@ void main() {
await completer.future;
});
testWithoutContext('calls buildSystem.build with l10n.yaml synthetic-package: true', () async {
testUsingContext('calls buildSystem.build with l10n.yaml synthetic-package: true', () async {
// Project directory setup for gen_l10n logic
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
@ -118,7 +120,7 @@ void main() {
await completer.future;
});
testWithoutContext('calls buildSystem.build with l10n.yaml synthetic-package: null', () async {
testUsingContext('calls buildSystem.build with l10n.yaml synthetic-package: null', () async {
// Project directory setup for gen_l10n logic
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
@ -166,7 +168,7 @@ void main() {
await completer.future;
});
testWithoutContext('does not call buildSystem.build when l10n.yaml is not present', () async {
testUsingContext('does not call buildSystem.build when l10n.yaml is not present', () async {
// Project directory setup for gen_l10n logic
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
@ -196,7 +198,7 @@ void main() {
);
});
testWithoutContext('does not call buildSystem.build with incorrect l10n.yaml format', () async {
testUsingContext('does not call buildSystem.build with incorrect l10n.yaml format', () async {
// Project directory setup for gen_l10n logic
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
@ -232,7 +234,7 @@ void main() {
);
});
testWithoutContext('does not call buildSystem.build with non-bool "synthetic-package" value', () async {
testUsingContext('does not call buildSystem.build with non-bool "synthetic-package" value', () async {
// Project directory setup for gen_l10n logic
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
@ -268,7 +270,7 @@ void main() {
);
});
testWithoutContext('synthetic-package: true (implicit) logs a deprecation warning', () async {
testUsingContext('synthetic-package: true (implicit) logs a deprecation warning', () async {
// Project directory setup for gen_l10n logic.
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
@ -305,7 +307,7 @@ void main() {
);
});
testWithoutContext('synthetic-package: true (explicit) logs a deprecation warning', () async {
testUsingContext('synthetic-package: true (explicit) logs a deprecation warning', () async {
// Project directory setup for gen_l10n logic.
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
@ -340,7 +342,7 @@ void main() {
);
});
testWithoutContext('synthetic-package: false has no deprecation warning', () async {
testUsingContext('synthetic-package: false has no deprecation warning', () async {
// Project directory setup for gen_l10n logic
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
@ -375,7 +377,7 @@ void main() {
);
});
testWithoutContext('synthetic-package: true with --no-implicit-pubspec-resolution is an error', () async {
testUsingContext('synthetic-package: true with explicit-packages-resolution is an error', () async {
// Project directory setup for gen_l10n logic
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
@ -397,7 +399,6 @@ void main() {
logger: mockBufferLogger,
artifacts: Artifacts.test(),
processManager: FakeProcessManager.any(),
useImplicitPubspecResolution: false,
);
// Will throw if build is called.
final TestBuildSystem buildSystem = TestBuildSystem.all(null);
@ -408,11 +409,15 @@ void main() {
buildSystem: buildSystem,
buildTargets: const NoOpBuildTargets(),
),
throwsToolExit(message: 'Cannot generate a synthetic package when --no-implicit-pubspec-resolution is passed'),
throwsToolExit(message: 'Cannot generate a synthetic package when explicit-package-dependencies is enabled'),
);
}, overrides: <Type, Generator> {
FeatureFlags: () => TestFeatureFlags(
isExplicitPackageDependenciesEnabled: true,
),
});
testWithoutContext('synthetic-package defaults to false if --no-implicit-pubspec-resolution is passed', () async {
testUsingContext('synthetic-package defaults to false if explicit-package-dependencies is enabled', () async {
// Project directory setup for gen_l10n logic
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
@ -434,7 +439,6 @@ void main() {
logger: mockBufferLogger,
artifacts: Artifacts.test(),
processManager: FakeProcessManager.any(),
useImplicitPubspecResolution: false,
);
// Will throw if build is called.
final TestBuildSystem buildSystem = TestBuildSystem.all(null);
@ -447,5 +451,9 @@ void main() {
),
returnsNormally,
);
}, overrides: <Type, Generator> {
FeatureFlags: () => TestFeatureFlags(
isExplicitPackageDependenciesEnabled: true,
),
});
}

View File

@ -318,7 +318,6 @@ class FakeWebRunnerFactory implements WebRunnerFactory {
Usage? usage,
Analytics? analytics,
bool machine = false,
required bool useImplicitPubspecResolution,
}) {
expect(stayResident, isTrue);
return FakeResidentRunner(
@ -382,7 +381,6 @@ WebDriverService setUpDriverService() {
processManager: FakeProcessManager.any(),
),
dartSdkPath: 'dart',
useImplicitPubspecResolution: true,
);
}

View File

@ -149,7 +149,6 @@ void main() {
debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug),
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
useImplicitPubspecResolution: true,
analytics: fakeAnalytics,
).restart(fullRestart: true);
expect(result.isOk, false);
@ -182,7 +181,6 @@ void main() {
debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug),
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
useImplicitPubspecResolution: true,
reassembleHelper: (
List<FlutterDevice?> flutterDevices,
Map<FlutterDevice?, List<FlutterView>> viewCache,
@ -232,7 +230,6 @@ void main() {
debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug),
target: 'main.dart',
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
).cleanupAfterSignal();
expect(shutdownTestingConfig.shutdownHookCalled, true);
}, overrides: <Type, Generator>{
@ -261,7 +258,6 @@ void main() {
debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug),
target: 'main.dart',
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
).preExit();
expect(shutdownTestingConfig.shutdownHookCalled, true);
}, overrides: <Type, Generator>{
@ -312,7 +308,6 @@ void main() {
devtoolsHandler: createNoOpHandler,
stopwatchFactory: fakeStopwatchFactory,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
).restart(fullRestart: true);
expect(result.isOk, true);
@ -400,7 +395,6 @@ void main() {
devtoolsHandler: createNoOpHandler,
stopwatchFactory: fakeStopwatchFactory,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
reloadSourcesHelper: (
HotRunner hotRunner,
List<FlutterDevice?> flutterDevices,
@ -507,7 +501,6 @@ void main() {
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
await expectLater(runner.restart(fullRestart: true), throwsA(isA<Exception>().having((Exception e) => e.toString(), 'message', 'Exception: updateDevFS failed')));
@ -543,7 +536,6 @@ void main() {
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
await expectLater(runner.restart(), throwsA(isA<Exception>().having((Exception e) => e.toString(), 'message', 'Exception: updateDevFS failed')));
@ -597,7 +589,6 @@ void main() {
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug),
target: 'main.dart',
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
).attach(needsFullRestart: false);
expect(exitCode, 2);
}, overrides: <Type, Generator>{
@ -636,7 +627,6 @@ void main() {
debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug),
target: 'main.dart',
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
).cleanupAtFinish();
expect(device1.disposed, true);

View File

@ -90,7 +90,6 @@ void main() {
devtoolsHandler: createNoOpHandler,
nativeAssetsBuilder: FakeHotRunnerNativeAssetsBuilder(buildRunner),
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
final OperationResult result = await hotRunner.restart(fullRestart: true);
expect(result.isOk, true);
@ -161,7 +160,6 @@ void main() {
devtoolsHandler: createNoOpHandler,
nativeAssetsBuilder: FakeHotRunnerNativeAssetsBuilder(buildRunner),
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
expect(
() => hotRunner.run(),

View File

@ -74,7 +74,6 @@ void main() {
nativeAssetsBuilder: FakeHotRunnerNativeAssetsBuilder(buildRunner),
analytics: FakeAnalytics(),
nativeAssetsYamlFile: 'foo.yaml',
useImplicitPubspecResolution: true,
);
final int result = await residentRunner.run();

View File

@ -345,7 +345,7 @@ void main() {
..writeAsStringSync('Existing release config');
final FlutterProject project = FlutterProject.fromDirectoryTest(fileSystem.directory('project'));
await injectPlugins(project, iosPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(project, iosPlatform: true);
final String debugContents = projectUnderTest.ios.xcodeConfigFor('Debug').readAsStringSync();
expect(debugContents, contains(

View File

@ -404,7 +404,7 @@ dependencies:
group('refreshPlugins', () {
testUsingContext('Refreshing the plugin list is a no-op when the plugins list stays empty', () async {
await refreshPluginsList(flutterProject, useImplicitPubspecResolution: true);
await refreshPluginsList(flutterProject);
expect(flutterProject.flutterPluginsFile.existsSync(), false);
expect(flutterProject.flutterPluginsDependenciesFile.existsSync(), false);
@ -417,7 +417,7 @@ dependencies:
flutterProject.flutterPluginsFile.createSync();
flutterProject.flutterPluginsDependenciesFile.createSync();
await refreshPluginsList(flutterProject, useImplicitPubspecResolution: true);
await refreshPluginsList(flutterProject);
expect(flutterProject.flutterPluginsFile.existsSync(), false);
expect(flutterProject.flutterPluginsDependenciesFile.existsSync(), false);
@ -436,7 +436,7 @@ dependencies:
iosProject.testExists = true;
await refreshPluginsList(flutterProject, useImplicitPubspecResolution: true);
await refreshPluginsList(flutterProject);
expect(flutterProject.flutterPluginsFile.existsSync(), true);
expect(flutterProject.flutterPluginsDependenciesFile.existsSync(), true);
@ -450,7 +450,7 @@ dependencies:
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('Opting out of useImplicitPubspecResolution omits .flutter-plugins', () async {
testUsingContext('Opting in to explicit-package-dependencies omits .flutter-plugins', () async {
createFakePlugins(fs, <String>[
'plugin_d',
'plugin_a',
@ -458,11 +458,14 @@ dependencies:
'/local_plugins/plugin_b',
]);
await refreshPluginsList(flutterProject, useImplicitPubspecResolution: false);
await refreshPluginsList(flutterProject);
expect(flutterProject.flutterPluginsFile, isNot(exists));
expect(flutterProject.flutterPluginsDependenciesFile, exists);
}, overrides: <Type, Generator>{
FeatureFlags: () => TestFeatureFlags(
isExplicitPackageDependenciesEnabled: true,
),
FileSystem: () => fs,
ProcessManager: FakeProcessManager.empty,
Pub: FakePubWithPrimedDeps.new,
@ -479,7 +482,7 @@ dependencies:
final DateTime dateCreated = DateTime(1970);
systemClock.currentTime = dateCreated;
await refreshPluginsList(flutterProject, useImplicitPubspecResolution: true);
await refreshPluginsList(flutterProject);
// Verify .flutter-plugins-dependencies is configured correctly.
expect(flutterProject.flutterPluginsFile.existsSync(), true);
@ -597,7 +600,7 @@ dependencies:
final DateTime dateCreated = DateTime(1970);
systemClock.currentTime = dateCreated;
await refreshPluginsList(flutterProject, useImplicitPubspecResolution: true);
await refreshPluginsList(flutterProject);
expect(flutterProject.flutterPluginsDependenciesFile.existsSync(), true);
final String pluginsString = flutterProject.flutterPluginsDependenciesFile.readAsStringSync();
@ -674,7 +677,6 @@ dependencies:
flutterProject,
iosPlatform: true,
macOSPlatform: true,
useImplicitPubspecResolution: true,
);
expect(flutterProject.flutterPluginsDependenciesFile.existsSync(), true);
@ -720,7 +722,7 @@ dependencies:
iosProject.usesSwiftPackageManager = true;
macosProject.usesSwiftPackageManager = true;
await refreshPluginsList(flutterProject, forceCocoaPodsOnly: true, useImplicitPubspecResolution: true);
await refreshPluginsList(flutterProject, forceCocoaPodsOnly: true);
expect(flutterProject.flutterPluginsDependenciesFile.existsSync(), true);
final String pluginsString = flutterProject.flutterPluginsDependenciesFile
@ -768,7 +770,6 @@ dependencies:
flutterProject,
iosPlatform: true,
macOSPlatform: true,
useImplicitPubspecResolution: true,
);
expect(flutterProject.flutterPluginsDependenciesFile.existsSync(), true);
@ -798,7 +799,7 @@ dependencies:
iosProject.testExists = true;
macosProject.exists = true;
await refreshPluginsList(flutterProject, iosPlatform: true, macOSPlatform: true, useImplicitPubspecResolution: true);
await refreshPluginsList(flutterProject, iosPlatform: true, macOSPlatform: true);
expect(iosProject.podManifestLock.existsSync(), false);
expect(macosProject.podManifestLock.existsSync(), false);
}, overrides: <Type, Generator>{
@ -817,11 +818,11 @@ dependencies:
// Since there was no plugins list, the lock files will be invalidated.
// The second call is where the plugins list is compared to the existing one, and if there is no change,
// the podfiles shouldn't be invalidated.
await refreshPluginsList(flutterProject, iosPlatform: true, macOSPlatform: true, useImplicitPubspecResolution: true);
await refreshPluginsList(flutterProject, iosPlatform: true, macOSPlatform: true);
simulatePodInstallRun(iosProject);
simulatePodInstallRun(macosProject);
await refreshPluginsList(flutterProject, useImplicitPubspecResolution: true);
await refreshPluginsList(flutterProject);
expect(iosProject.podManifestLock.existsSync(), true);
expect(macosProject.podManifestLock.existsSync(), true);
}, overrides: <Type, Generator>{
@ -842,7 +843,7 @@ dependencies:
testUsingContext('Registrant uses new embedding if app uses new embedding', () async {
androidProject.embeddingVersion = AndroidEmbeddingVersion.v2;
await injectPlugins(flutterProject, androidPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(flutterProject, androidPlatform: true);
final File registrant = flutterProject.directory
.childDirectory(fs.path.join('android', 'app', 'src', 'main', 'java', 'io', 'flutter', 'plugins'))
@ -865,7 +866,7 @@ dependencies:
await expectLater(
() async {
await injectPlugins(flutterProject, androidPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(flutterProject, androidPlatform: true);
},
throwsToolExit(
message: "The plugin `plugin1` doesn't have a main class defined in "
@ -887,7 +888,7 @@ dependencies:
createDualSupportJavaPlugin4();
await injectPlugins(flutterProject, androidPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(flutterProject, androidPlatform: true);
final File registrant = flutterProject.directory
.childDirectory(fs.path.join('android', 'app', 'src', 'main', 'java', 'io', 'flutter', 'plugins'))
@ -908,7 +909,7 @@ dependencies:
flutterProject.isModule = true;
androidProject.embeddingVersion = AndroidEmbeddingVersion.v2;
await injectPlugins(flutterProject, androidPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(flutterProject, androidPlatform: true);
final File registrant = flutterProject.directory
.childDirectory(fs.path.join('android', 'app', 'src', 'main', 'java', 'io', 'flutter', 'plugins'))
@ -929,7 +930,7 @@ dependencies:
createNewJavaPlugin1();
await injectPlugins(flutterProject, androidPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(flutterProject, androidPlatform: true);
final File registrant = flutterProject.directory
.childDirectory(fs.path.join('android', 'app', 'src', 'main', 'java', 'io', 'flutter', 'plugins'))
@ -950,7 +951,7 @@ dependencies:
createDualSupportJavaPlugin4();
await injectPlugins(flutterProject, androidPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(flutterProject, androidPlatform: true);
final File registrant = flutterProject.directory
.childDirectory(fs.path.join('android', 'app', 'src', 'main', 'java', 'io', 'flutter', 'plugins'))
@ -971,7 +972,7 @@ dependencies:
createDualSupportJavaPlugin4();
await injectPlugins(flutterProject, androidPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(flutterProject, androidPlatform: true);
final File registrant = flutterProject.directory
.childDirectory(fs.path.join('android', 'app', 'src', 'main', 'java', 'io', 'flutter', 'plugins'))
@ -989,7 +990,7 @@ dependencies:
testUsingContext('Does not throw when AndroidManifest.xml is not found', () async {
final File manifest = fs.file('AndroidManifest.xml');
androidProject.appManifestFile = manifest;
await injectPlugins(flutterProject, androidPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(flutterProject, androidPlatform: true);
}, overrides: <Type, Generator>{
FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(),
@ -1099,7 +1100,7 @@ flutter:
dartPluginClass: SomePlugin
''');
await injectPlugins(flutterProject, androidPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(flutterProject, androidPlatform: true);
final File registrantFile = androidProject.pluginRegistrantHost
.childDirectory(fs.path.join('src', 'main', 'java', 'io', 'flutter', 'plugins'))
@ -1128,7 +1129,6 @@ flutter:
flutterProject,
iosPlatform: true,
darwinDependencyManagement: dependencyManagement,
useImplicitPubspecResolution: true,
);
final File registrantFile = iosProject.pluginRegistrantImplementation;
@ -1156,7 +1156,6 @@ flutter:
flutterProject,
macOSPlatform: true,
darwinDependencyManagement: dependencyManagement,
useImplicitPubspecResolution: true,
);
final File registrantFile = macosProject.managedDirectory.childFile('GeneratedPluginRegistrant.swift');
@ -1185,7 +1184,6 @@ flutter:
flutterProject,
macOSPlatform: true,
darwinDependencyManagement: dependencyManagement,
useImplicitPubspecResolution: true,
);
final File registrantFile = macosProject.managedDirectory.childFile('GeneratedPluginRegistrant.swift');
@ -1210,7 +1208,6 @@ flutter:
flutterProject,
macOSPlatform: true,
darwinDependencyManagement: dependencyManagement,
useImplicitPubspecResolution: true,
);
final File registrantFile = macosProject.managedDirectory.childFile('GeneratedPluginRegistrant.swift');
@ -1224,7 +1221,7 @@ flutter:
testUsingContext('Injecting creates generated Linux registrant', () async {
createFakePlugin(fs);
await injectPlugins(flutterProject, linuxPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(flutterProject, linuxPlatform: true);
final File registrantHeader = linuxProject.managedDirectory.childFile('generated_plugin_registrant.h');
final File registrantImpl = linuxProject.managedDirectory.childFile('generated_plugin_registrant.cc');
@ -1273,7 +1270,7 @@ dependencies:
flutterProject.manifest = manifest;
await injectPlugins(flutterProject, linuxPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(flutterProject, linuxPlatform: true);
final File registrantImpl = linuxProject.managedDirectory.childFile('generated_plugin_registrant.cc');
@ -1331,7 +1328,7 @@ dependencies:
flutterProject.manifest = manifest;
await injectPlugins(flutterProject, linuxPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(flutterProject, linuxPlatform: true);
final File registrantImpl = linuxProject.managedDirectory.childFile('generated_plugin_registrant.cc');
@ -1354,7 +1351,7 @@ flutter:
dartPluginClass: SomePlugin
''');
await injectPlugins(flutterProject, linuxPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(flutterProject, linuxPlatform: true);
final File registrantImpl = linuxProject.managedDirectory.childFile('generated_plugin_registrant.cc');
@ -1378,7 +1375,7 @@ flutter:
dartPluginClass: SomePlugin
''');
await injectPlugins(flutterProject, linuxPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(flutterProject, linuxPlatform: true);
final File registrantImpl = linuxProject.managedDirectory.childFile('generated_plugin_registrant.cc');
@ -1393,7 +1390,7 @@ flutter:
testUsingContext('Injecting creates generated Linux plugin Cmake file', () async {
createFakePlugin(fs);
await injectPlugins(flutterProject, linuxPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(flutterProject, linuxPlatform: true);
final File pluginMakefile = linuxProject.generatedPluginCmakeFile;
@ -1416,7 +1413,7 @@ flutter:
'/local_plugins/plugin_b',
]);
await injectPlugins(flutterProject, linuxPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(flutterProject, linuxPlatform: true);
final File pluginCmakeFile = linuxProject.generatedPluginCmakeFile;
final File pluginRegistrant = linuxProject.managedDirectory.childFile('generated_plugin_registrant.cc');
@ -1434,7 +1431,7 @@ flutter:
testUsingContext('Injecting creates generated Windows registrant', () async {
createFakePlugin(fs);
await injectPlugins(flutterProject, windowsPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(flutterProject, windowsPlatform: true);
final File registrantHeader = windowsProject.managedDirectory.childFile('generated_plugin_registrant.h');
final File registrantImpl = windowsProject.managedDirectory.childFile('generated_plugin_registrant.cc');
@ -1458,7 +1455,7 @@ flutter:
dartPluginClass: SomePlugin
''');
await injectPlugins(flutterProject, windowsPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(flutterProject, windowsPlatform: true);
final File registrantImpl = windowsProject.managedDirectory.childFile('generated_plugin_registrant.cc');
@ -1481,7 +1478,7 @@ flutter:
dartPluginClass: SomePlugin
''');
await injectPlugins(flutterProject, windowsPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(flutterProject, windowsPlatform: true);
final File registrantImpl = windowsProject.managedDirectory.childFile('generated_plugin_registrant.cc');
@ -1501,7 +1498,7 @@ flutter:
'/local_plugins/plugin_b',
]);
await injectPlugins(flutterProject, windowsPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(flutterProject, windowsPlatform: true);
final File pluginCmakeFile = windowsProject.generatedPluginCmakeFile;
final File pluginRegistrant = windowsProject.managedDirectory.childFile('generated_plugin_registrant.cc');
@ -1521,7 +1518,7 @@ flutter:
setUpProject(fsWindows);
createFakePlugin(fsWindows);
await injectPlugins(flutterProject, linuxPlatform: true, windowsPlatform: true, useImplicitPubspecResolution: true);
await injectPlugins(flutterProject, linuxPlatform: true, windowsPlatform: true);
for (final CmakeBasedProject? project in <CmakeBasedProject?>[linuxProject, windowsProject]) {
final File pluginCmakefile = project!.generatedPluginCmakeFile;
@ -1546,7 +1543,6 @@ flutter:
linuxPlatform: true,
windowsPlatform: true,
allowedPlugins: PreviewDevice.supportedPubPlugins,
useImplicitPubspecResolution: true,
),
throwsToolExit(message: '''
The Flutter Preview device does not support the following plugins from your pubspec.yaml:
@ -1566,7 +1562,6 @@ The Flutter Preview device does not support the following plugins from your pubs
iosPlatform: true,
macOSPlatform: true,
darwinDependencyManagement: dependencyManagement,
useImplicitPubspecResolution: true,
);
expect(
dependencyManagement.setupPlatforms,
@ -1582,7 +1577,6 @@ The Flutter Preview device does not support the following plugins from your pubs
await injectPlugins(
flutterProject,
darwinDependencyManagement: dependencyManagement,
useImplicitPubspecResolution: true,
);
expect(dependencyManagement.setupPlatforms, <SupportedPlatform>[]);
}, overrides: <Type, Generator>{
@ -1602,7 +1596,7 @@ The Flutter Preview device does not support the following plugins from your pubs
linuxProject.exists = true;
createFakePlugin(fs);
// refreshPluginsList should call createPluginSymlinks.
await refreshPluginsList(flutterProject, useImplicitPubspecResolution: true);
await refreshPluginsList(flutterProject);
expect(linuxProject.pluginSymlinkDirectory.childLink('some_plugin').existsSync(), true);
}, overrides: <Type, Generator>{
@ -1615,7 +1609,7 @@ The Flutter Preview device does not support the following plugins from your pubs
windowsProject.exists = true;
createFakePlugin(fs);
// refreshPluginsList should call createPluginSymlinks.
await refreshPluginsList(flutterProject, useImplicitPubspecResolution: true);
await refreshPluginsList(flutterProject);
expect(windowsProject.pluginSymlinkDirectory.childLink('some_plugin').existsSync(), true);
}, overrides: <Type, Generator>{
@ -1661,7 +1655,7 @@ The Flutter Preview device does not support the following plugins from your pubs
// refreshPluginsList should remove existing links and recreate on changes.
createFakePlugin(fs);
await refreshPluginsList(flutterProject, useImplicitPubspecResolution: true);
await refreshPluginsList(flutterProject);
for (final File file in dummyFiles) {
expect(file.existsSync(), false);
@ -1700,7 +1694,7 @@ The Flutter Preview device does not support the following plugins from your pubs
linuxProject.exists = true;
windowsProject.exists = true;
createFakePlugin(fs);
await refreshPluginsList(flutterProject, useImplicitPubspecResolution: true);
await refreshPluginsList(flutterProject);
final List<Link> links = <Link>[
linuxProject.pluginSymlinkDirectory.childLink('some_plugin'),

View File

@ -49,7 +49,6 @@ void main() {
processManager: FakeProcessManager.any(),
previewBinary: previewBinary,
logger: BufferLogger.test(),
useImplicitPubspecResolution: true,
);
expect(await device.isLocalEmulator, false);
@ -85,7 +84,6 @@ void main() {
]),
logger: logger,
builderFactory: () => FakeBundleBuilder(fs),
useImplicitPubspecResolution: true,
);
final Directory previewDeviceCacheDir = fs
.directory('Artifact.windowsDesktopPath.TargetPlatform.windows_x64.debug')
@ -123,7 +121,6 @@ void main() {
processManager: processManager,
platform: linuxPlatform,
featureFlags: featureFlags,
useImplicitPubspecResolution: true,
);
final List<Device> devices = await discovery.devices();
@ -139,7 +136,6 @@ void main() {
processManager: processManager,
platform: macPlatform,
featureFlags: featureFlags,
useImplicitPubspecResolution: true,
);
final List<Device> devices = await discovery.devices();
@ -157,7 +153,6 @@ void main() {
processManager: processManager,
platform: windowsPlatform,
featureFlags: featureFlags,
useImplicitPubspecResolution: true,
);
final List<Device> devices = await discovery.devices();
@ -175,7 +170,6 @@ void main() {
processManager: processManager,
platform: windowsPlatform,
featureFlags: featureFlags,
useImplicitPubspecResolution: true,
);
final List<Device> devices = await discovery.devices();
@ -204,7 +198,6 @@ class FakeBundleBuilder extends Fake implements BundleBuilder {
String? assetDirPath,
bool buildNativeAssets = true,
@visibleForTesting BuildSystem? buildSystem,
required bool useImplicitPubspecResolution,
}) async {
final Directory assetDirectory = fileSystem
.directory(assetDirPath)

View File

@ -141,12 +141,12 @@ void main() {
FlutterManifest.empty(logger: logger),
FlutterManifest.empty(logger: logger),
);
await project.regeneratePlatformSpecificTooling(useImplicitPubspecResolution: true);
await project.regeneratePlatformSpecificTooling();
expectNotExists(project.directory);
});
_testInMemory('does nothing in plugin or package root project', () async {
final FlutterProject project = await aPluginProject();
await project.regeneratePlatformSpecificTooling(useImplicitPubspecResolution: true);
await project.regeneratePlatformSpecificTooling();
expectNotExists(project.ios.hostAppRoot.childDirectory('Runner').childFile('GeneratedPluginRegistrant.h'));
expectNotExists(androidPluginRegistrant(project.android.hostAppGradleRoot.childDirectory('app')));
expectNotExists(project.ios.hostAppRoot.childDirectory('Flutter').childFile('Generated.xcconfig'));
@ -158,7 +158,7 @@ void main() {
// that a project was a plugin, but shouldn't be as this creates false
// positives.
project.directory.childDirectory('example').createSync();
await project.regeneratePlatformSpecificTooling(useImplicitPubspecResolution: true);
await project.regeneratePlatformSpecificTooling();
expectExists(project.ios.hostAppRoot.childDirectory('Runner').childFile('GeneratedPluginRegistrant.h'));
expectExists(androidPluginRegistrant(project.android.hostAppGradleRoot.childDirectory('app')));
expectExists(project.ios.hostAppRoot.childDirectory('Flutter').childFile('Generated.xcconfig'));
@ -166,22 +166,22 @@ void main() {
});
_testInMemory('injects plugins for iOS', () async {
final FlutterProject project = await someProject();
await project.regeneratePlatformSpecificTooling(useImplicitPubspecResolution: true);
await project.regeneratePlatformSpecificTooling();
expectExists(project.ios.hostAppRoot.childDirectory('Runner').childFile('GeneratedPluginRegistrant.h'));
});
_testInMemory('generates Xcode configuration for iOS', () async {
final FlutterProject project = await someProject();
await project.regeneratePlatformSpecificTooling(useImplicitPubspecResolution: true);
await project.regeneratePlatformSpecificTooling();
expectExists(project.ios.hostAppRoot.childDirectory('Flutter').childFile('Generated.xcconfig'));
});
_testInMemory('injects plugins for Android', () async {
final FlutterProject project = await someProject();
await project.regeneratePlatformSpecificTooling(useImplicitPubspecResolution: true);
await project.regeneratePlatformSpecificTooling();
expectExists(androidPluginRegistrant(project.android.hostAppGradleRoot.childDirectory('app')));
});
_testInMemory('updates local properties for Android', () async {
final FlutterProject project = await someProject();
await project.regeneratePlatformSpecificTooling(useImplicitPubspecResolution: true);
await project.regeneratePlatformSpecificTooling();
expectExists(project.android.hostAppGradleRoot.childFile('local.properties'));
});
_testInMemory('checkForDeprecation fails on invalid android app manifest file', () async {
@ -224,18 +224,18 @@ void main() {
final FlutterProject project = await aPluginProject();
project.example.directory.deleteSync();
await project.regeneratePlatformSpecificTooling(useImplicitPubspecResolution: true);
await project.regeneratePlatformSpecificTooling();
expect(testLogger.statusText, isNot(contains('https://github.com/flutter/flutter/blob/main/docs/platforms/android/Upgrading-pre-1.12-Android-projects.md')));
});
_testInMemory('updates local properties for Android', () async {
final FlutterProject project = await someProject();
await project.regeneratePlatformSpecificTooling(useImplicitPubspecResolution: true);
await project.regeneratePlatformSpecificTooling();
expectExists(project.android.hostAppGradleRoot.childFile('local.properties'));
});
testUsingContext('injects plugins for macOS', () async {
final FlutterProject project = await someProject();
project.macos.managedDirectory.createSync(recursive: true);
await project.regeneratePlatformSpecificTooling(useImplicitPubspecResolution: true);
await project.regeneratePlatformSpecificTooling();
expectExists(project.macos.pluginRegistrantImplementation);
}, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem.test(),
@ -249,7 +249,7 @@ void main() {
testUsingContext('generates Xcode configuration for macOS', () async {
final FlutterProject project = await someProject();
project.macos.managedDirectory.createSync(recursive: true);
await project.regeneratePlatformSpecificTooling(useImplicitPubspecResolution: true);
await project.regeneratePlatformSpecificTooling();
expectExists(project.macos.generatedXcodePropertiesFile);
}, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem.test(),
@ -263,7 +263,7 @@ void main() {
testUsingContext('injects plugins for Linux', () async {
final FlutterProject project = await someProject();
project.linux.cmakeFile.createSync(recursive: true);
await project.regeneratePlatformSpecificTooling(useImplicitPubspecResolution: true);
await project.regeneratePlatformSpecificTooling();
expectExists(project.linux.managedDirectory.childFile('generated_plugin_registrant.h'));
expectExists(project.linux.managedDirectory.childFile('generated_plugin_registrant.cc'));
}, overrides: <Type, Generator>{
@ -278,7 +278,7 @@ void main() {
testUsingContext('injects plugins for Windows', () async {
final FlutterProject project = await someProject();
project.windows.cmakeFile.createSync(recursive: true);
await project.regeneratePlatformSpecificTooling(useImplicitPubspecResolution: true);
await project.regeneratePlatformSpecificTooling();
expectExists(project.windows.managedDirectory.childFile('generated_plugin_registrant.h'));
expectExists(project.windows.managedDirectory.childFile('generated_plugin_registrant.cc'));
}, overrides: <Type, Generator>{
@ -292,14 +292,14 @@ void main() {
});
_testInMemory('creates Android library in module', () async {
final FlutterProject project = await aModuleProject();
await project.regeneratePlatformSpecificTooling(useImplicitPubspecResolution: true);
await project.regeneratePlatformSpecificTooling();
expectExists(project.android.hostAppGradleRoot.childFile('settings.gradle'));
expectExists(project.android.hostAppGradleRoot.childFile('local.properties'));
expectExists(androidPluginRegistrant(project.android.hostAppGradleRoot.childDirectory('Flutter')));
});
_testInMemory('creates iOS pod in module', () async {
final FlutterProject project = await aModuleProject();
await project.regeneratePlatformSpecificTooling(useImplicitPubspecResolution: true);
await project.regeneratePlatformSpecificTooling();
final Directory flutter = project.ios.hostAppRoot.childDirectory('Flutter');
expectExists(flutter.childFile('podhelper.rb'));
expectExists(flutter.childFile('flutter_export_environment.sh'));

View File

@ -63,7 +63,6 @@ void main() {
target: 'main.dart',
analytics: fakeAnalytics,
devtoolsHandler: createNoOpHandler,
useImplicitPubspecResolution: true,
);
}, overrides: <Type, Generator>{
Analytics: () => FakeAnalytics(),
@ -115,7 +114,6 @@ void main() {
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: globals.analytics,
useImplicitPubspecResolution: true,
);
flutterDevice.generator = residentCompiler;
@ -140,7 +138,6 @@ void main() {
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: globals.analytics,
useImplicitPubspecResolution: true,
);
flutterDevice.generator = residentCompiler;
@ -162,7 +159,6 @@ void main() {
debuggingOptions: DebuggingOptions.enabled(BuildInfo.release),
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
useImplicitPubspecResolution: true,
);
flutterDevice.runColdCode = 1;
@ -184,7 +180,6 @@ void main() {
debuggingOptions: DebuggingOptions.enabled(BuildInfo.release),
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
useImplicitPubspecResolution: true,
);
flutterDevice.runColdError = Exception('BAD STUFF');
@ -213,7 +208,6 @@ void main() {
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: globals.analytics,
useImplicitPubspecResolution: true,
);
flutterDevice.generator = residentCompiler;
@ -274,7 +268,6 @@ void main() {
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: globals.analytics,
useImplicitPubspecResolution: true,
);
final Completer<DebugConnectionInfo> futureConnectionInfo = Completer<DebugConnectionInfo>.sync();
final Completer<void> futureAppStart = Completer<void>.sync();
@ -416,7 +409,6 @@ void main() {
enableDevTools: false,
),
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
final Completer<DebugConnectionInfo> futureConnectionInfo = Completer<DebugConnectionInfo>.sync();
final Completer<void> futureAppStart = Completer<void>.sync();
@ -481,7 +473,6 @@ void main() {
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
final Completer<DebugConnectionInfo> futureConnectionInfo = Completer<DebugConnectionInfo>.sync();
final Completer<void> futureAppStart = Completer<void>.sync();
@ -746,7 +737,6 @@ void main() {
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
devFS.nextUpdateReport = UpdateFSReport(
success: true,
@ -1091,7 +1081,6 @@ void main() {
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
expect(otherRunner.artifactDirectory.path, contains('foobar'));
}));
@ -1205,7 +1194,6 @@ flutter:
target: 'custom_main.dart',
devtoolsHandler: createNoOpHandler,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
await residentRunner.runSourceGenerators();
@ -1266,7 +1254,6 @@ flutter:
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
flutterDevice.generator = residentCompiler;
@ -1367,7 +1354,6 @@ flutter:
debuggingOptions: DebuggingOptions.disabled(BuildInfo.release),
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
useImplicitPubspecResolution: true,
);
residentRunner.printHelp(details: true);
@ -1403,7 +1389,6 @@ flutter:
debuggingOptions: DebuggingOptions.disabled(BuildInfo.release),
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
useImplicitPubspecResolution: true,
);
residentRunner.printHelp(details: false);
@ -1493,7 +1478,6 @@ flutter:
debuggingOptions: DebuggingOptions.enabled(BuildInfo.profile, vmserviceOutFile: 'foo', enableDevTools: false),
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
useImplicitPubspecResolution: true,
);
final Future<int?> result = residentRunner.attach();
@ -1539,7 +1523,6 @@ flutter:
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
await residentRunner.run();
@ -1570,7 +1553,6 @@ flutter:
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
residentRunner.artifactDirectory.childFile('app.dill').writeAsStringSync('ABC');
@ -1602,7 +1584,6 @@ flutter:
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
residentRunner.artifactDirectory.childFile('app.dill').writeAsStringSync('ABC');
@ -1635,7 +1616,6 @@ flutter:
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
residentRunner.artifactDirectory.childFile('app.dill').writeAsStringSync('ABC');
@ -1660,7 +1640,6 @@ flutter:
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
residentRunner.artifactDirectory.childFile('app.dill').writeAsStringSync('ABC');
@ -1686,7 +1665,6 @@ flutter:
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
residentRunner.artifactDirectory.childFile('app.dill').writeAsStringSync('ABC');
@ -1716,7 +1694,6 @@ flutter:
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
residentRunner.artifactDirectory.childFile('app.dill').writeAsStringSync('ABC');
@ -1740,7 +1717,6 @@ flutter:
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
await residentRunner.run();
@ -1762,7 +1738,6 @@ flutter:
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
await residentRunner.run();
@ -1786,7 +1761,6 @@ flutter:
debuggingOptions: DebuggingOptions.enabled(BuildInfo.profile, vmserviceOutFile: 'foo'),
devtoolsHandler: createNoOpHandler,
target: 'main.dart',
useImplicitPubspecResolution: true,
);
await residentRunner.run();
@ -2168,7 +2142,6 @@ flutter:
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
await residentRunner.cleanupAtFinish();
@ -2190,7 +2163,6 @@ flutter:
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
(flutterDevice.devFS! as FakeDevFS).assetPathsToEvict = <String>{'asset'};
@ -2216,7 +2188,6 @@ flutter:
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
(flutterDevice.devFS! as FakeDevFS).shaderPathsToEvict = <String>{'foo.frag'};
@ -2239,7 +2210,6 @@ flutter:
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
expect(flutterDevice.devFS!.hasSetAssetDirectory, false);
@ -2262,7 +2232,6 @@ flutter:
target: 'main.dart',
devtoolsHandler: createNoOpHandler,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
(flutterDevice.devFS! as FakeDevFS).assetPathsToEvict = <String>{'asset'};
@ -2312,7 +2281,6 @@ flutter:
devtoolsHandler: createNoOpHandler,
analytics: globals.analytics,
nativeAssetsYamlFile: 'foo.yaml',
useImplicitPubspecResolution: true,
);
final int? result = await residentRunner.run();

View File

@ -61,7 +61,6 @@ void main() {
fs: fileSystem,
fakeFlutterVersion: FakeFlutterVersion(),
),
useImplicitPubspecResolution: true,
);
final Completer<DebugConnectionInfo> connectionInfoCompleter = Completer<DebugConnectionInfo>();
@ -92,7 +91,6 @@ void main() {
fs: fileSystem,
fakeFlutterVersion: FakeFlutterVersion(),
),
useImplicitPubspecResolution: true,
);
expect(() => residentWebRunner.run(), throwsToolExit());
@ -118,7 +116,6 @@ void main() {
fs: fileSystem,
fakeFlutterVersion: FakeFlutterVersion(),
),
useImplicitPubspecResolution: true,
);
expect(() async => residentWebRunner.run(), throwsException);
@ -143,7 +140,6 @@ void main() {
fs: fileSystem,
fakeFlutterVersion: FakeFlutterVersion(),
),
useImplicitPubspecResolution: true,
);
final Completer<DebugConnectionInfo> connectionInfoCompleter = Completer<DebugConnectionInfo>();
unawaited(residentWebRunner.run(
@ -173,7 +169,6 @@ void main() {
fs: fileSystem,
fakeFlutterVersion: FakeFlutterVersion(),
),
useImplicitPubspecResolution: true,
);
final Completer<DebugConnectionInfo> connectionInfoCompleter = Completer<DebugConnectionInfo>();
unawaited(residentWebRunner.run(

View File

@ -170,7 +170,6 @@ void main() {
usage: globals.flutterUsage,
analytics: globals.analytics,
systemClock: globals.systemClock,
useImplicitPubspecResolution: true,
);
expect(profileResidentWebRunner.debuggingEnabled, false);
@ -203,7 +202,6 @@ void main() {
usage: globals.flutterUsage,
analytics: globals.analytics,
systemClock: globals.systemClock,
useImplicitPubspecResolution: true,
);
expect(profileResidentWebRunner.uri, webDevFS.baseUri);
@ -223,7 +221,6 @@ void main() {
usage: globals.flutterUsage,
analytics: globals.analytics,
systemClock: globals.systemClock,
useImplicitPubspecResolution: true,
);
fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[]);
flutterDevice.device = chromeDevice;
@ -237,7 +234,6 @@ void main() {
usage: globals.flutterUsage,
analytics: globals.analytics,
systemClock: globals.systemClock,
useImplicitPubspecResolution: true,
);
expect(profileResidentWebRunner.supportsServiceProtocol, false);
@ -372,7 +368,6 @@ void main() {
analytics: globals.analytics,
systemClock: globals.systemClock,
devtoolsHandler: createNoOpHandler,
useImplicitPubspecResolution: true,
);
expect(await residentWebRunner.run(), 0);
@ -400,7 +395,6 @@ void main() {
analytics: globals.analytics,
systemClock: globals.systemClock,
devtoolsHandler: createNoOpHandler,
useImplicitPubspecResolution: true,
);
expect(await residentWebRunner.run(), 0);
@ -602,7 +596,6 @@ void main() {
analytics: globals.analytics,
systemClock: globals.systemClock,
devtoolsHandler: createNoOpHandler,
useImplicitPubspecResolution: true,
);
fakeVmServiceHost =
FakeVmServiceHost(requests: kAttachExpectations.toList());
@ -1130,7 +1123,6 @@ void main() {
analytics: globals.analytics,
systemClock: globals.systemClock,
devtoolsHandler: createNoOpHandler,
useImplicitPubspecResolution: true,
);
final Completer<DebugConnectionInfo> connectionInfoCompleter =
@ -1180,7 +1172,6 @@ void main() {
analytics: globals.analytics,
systemClock: globals.systemClock,
devtoolsHandler: createNoOpHandler,
useImplicitPubspecResolution: true,
);
final Completer<DebugConnectionInfo> connectionInfoCompleter =
@ -1224,7 +1215,6 @@ void main() {
analytics: globals.analytics,
systemClock: globals.systemClock,
devtoolsHandler: createNoOpHandler,
useImplicitPubspecResolution: true,
);
// Create necessary files.
@ -1481,7 +1471,6 @@ ResidentRunner setUpResidentRunner(
fileSystem: globals.fs,
logger: logger ?? BufferLogger.test(),
devtoolsHandler: createNoOpHandler,
useImplicitPubspecResolution: true,
);
}

View File

@ -98,7 +98,6 @@ void main() {
artifacts: Artifacts.test(),
logger: BufferLogger.test(),
flutterVersion: FakeFlutterVersion(),
useImplicitPubspecResolution: true,
);
logLines = <String>[];
device.getLogReader().logLines.listen(logLines.add);
@ -218,7 +217,6 @@ FlutterTesterDevices setUpFlutterTesterDevices() {
processManager: FakeProcessManager.any(),
fileSystem: MemoryFileSystem.test(),
flutterVersion: FakeFlutterVersion(),
useImplicitPubspecResolution: true,
);
}

View File

@ -70,7 +70,6 @@ void main() {
flutterVersion: flutterVersion,
fileSystem: fileSystem,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
await webBuilder.buildWeb(
flutterProject,
@ -163,7 +162,6 @@ void main() {
flutterVersion: flutterVersion,
fileSystem: fileSystem,
analytics: fakeAnalytics,
useImplicitPubspecResolution: true,
);
await expectLater(
() async => webBuilder.buildWeb(

View File

@ -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,
};
}

View File

@ -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());
}
}

View File

@ -21,7 +21,6 @@ void main() {
processManager: FakeProcessManager.empty(),
),
dartSdkPath: 'dart',
useImplicitPubspecResolution: true,
);
const String link = 'https://flutter.dev/to/integration-test-on-web';
try {