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:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -378,7 +378,6 @@ class CustomDevicesAddCommand extends CustomDevicesCommandBase {
|
||||
config: config,
|
||||
logger: logger,
|
||||
processManager: _processManager,
|
||||
useImplicitPubspecResolution: globalResults!.flag(FlutterGlobalOptions.kImplicitPubspecResolution),
|
||||
);
|
||||
|
||||
bool result = true;
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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).',
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
];
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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() &&
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()),
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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>[
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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');
|
||||
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
|
||||
@@ -33,7 +33,6 @@ abstract class WebRunnerFactory {
|
||||
required SystemClock systemClock,
|
||||
required Usage usage,
|
||||
required Analytics analytics,
|
||||
required bool useImplicitPubspecResolution,
|
||||
bool machine = false,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user