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
65 changed files with 224 additions and 436 deletions

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 {