Revert "Revert "[flutter_tools] Remove sound null safety flag (#120936)" (#122909)" (#123031)

[flutter_tools] Remove sound null safety flag #2
This commit is contained in:
Christopher Fujino
2023-03-20 15:32:07 -07:00
committed by GitHub
parent 484c22682b
commit f4c3facfdd
67 changed files with 130 additions and 1126 deletions

View File

@@ -4,7 +4,6 @@
import 'package:file/memory.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/build_system/build_system.dart';
@@ -67,7 +66,6 @@ void main() {
final FakeFlutterVersion fakeFlutterVersion = FakeFlutterVersion(frameworkVersion: frameworkVersion);
final BuildIOSFrameworkCommand command = BuildIOSFrameworkCommand(
logger: BufferLogger.test(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
platform: fakePlatform,
flutterVersion: fakeFlutterVersion,
@@ -97,7 +95,6 @@ void main() {
);
final BuildIOSFrameworkCommand command = BuildIOSFrameworkCommand(
logger: BufferLogger.test(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
platform: fakePlatform,
flutterVersion: fakeFlutterVersion,
@@ -124,7 +121,6 @@ void main() {
);
final BuildIOSFrameworkCommand command = BuildIOSFrameworkCommand(
logger: BufferLogger.test(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
platform: fakePlatform,
flutterVersion: fakeFlutterVersion,
@@ -166,7 +162,6 @@ void main() {
);
final BuildIOSFrameworkCommand command = BuildIOSFrameworkCommand(
logger: BufferLogger.test(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
platform: fakePlatform,
flutterVersion: fakeFlutterVersion,
@@ -201,7 +196,6 @@ void main() {
testUsingContext('contains license and version', () async {
final BuildIOSFrameworkCommand command = BuildIOSFrameworkCommand(
logger: BufferLogger.test(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
platform: fakePlatform,
flutterVersion: fakeFlutterVersion,
@@ -222,7 +216,6 @@ void main() {
testUsingContext('debug URL', () async {
final BuildIOSFrameworkCommand command = BuildIOSFrameworkCommand(
logger: BufferLogger.test(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
platform: fakePlatform,
flutterVersion: fakeFlutterVersion,
@@ -241,7 +234,6 @@ void main() {
testUsingContext('profile URL', () async {
final BuildIOSFrameworkCommand command = BuildIOSFrameworkCommand(
logger: BufferLogger.test(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
platform: fakePlatform,
flutterVersion: fakeFlutterVersion,
@@ -260,7 +252,6 @@ void main() {
testUsingContext('release URL', () async {
final BuildIOSFrameworkCommand command = BuildIOSFrameworkCommand(
logger: BufferLogger.test(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
platform: fakePlatform,
flutterVersion: fakeFlutterVersion,
@@ -304,7 +295,6 @@ void main() {
final FakeFlutterVersion fakeFlutterVersion = FakeFlutterVersion(frameworkVersion: frameworkVersion);
final BuildMacOSFrameworkCommand command = BuildMacOSFrameworkCommand(
logger: BufferLogger.test(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
platform: fakePlatform,
flutterVersion: fakeFlutterVersion,
@@ -334,7 +324,6 @@ void main() {
);
final BuildMacOSFrameworkCommand command = BuildMacOSFrameworkCommand(
logger: BufferLogger.test(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
platform: fakePlatform,
flutterVersion: fakeFlutterVersion,
@@ -361,7 +350,6 @@ void main() {
);
final BuildMacOSFrameworkCommand command = BuildMacOSFrameworkCommand(
logger: BufferLogger.test(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
platform: fakePlatform,
flutterVersion: fakeFlutterVersion,
@@ -403,7 +391,6 @@ void main() {
);
final BuildMacOSFrameworkCommand command = BuildMacOSFrameworkCommand(
logger: BufferLogger.test(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
platform: fakePlatform,
flutterVersion: fakeFlutterVersion,
@@ -438,7 +425,6 @@ void main() {
testUsingContext('contains license and version', () async {
final BuildMacOSFrameworkCommand command = BuildMacOSFrameworkCommand(
logger: BufferLogger.test(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
platform: fakePlatform,
flutterVersion: fakeFlutterVersion,
@@ -459,7 +445,6 @@ void main() {
testUsingContext('debug URL', () async {
final BuildMacOSFrameworkCommand command = BuildMacOSFrameworkCommand(
logger: BufferLogger.test(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
platform: fakePlatform,
flutterVersion: fakeFlutterVersion,
@@ -478,7 +463,6 @@ void main() {
testUsingContext('profile URL', () async {
final BuildMacOSFrameworkCommand command = BuildMacOSFrameworkCommand(
logger: BufferLogger.test(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
platform: fakePlatform,
flutterVersion: fakeFlutterVersion,
@@ -497,7 +481,6 @@ void main() {
testUsingContext('release URL', () async {
final BuildMacOSFrameworkCommand command = BuildMacOSFrameworkCommand(
logger: BufferLogger.test(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
platform: fakePlatform,
flutterVersion: fakeFlutterVersion,

View File

@@ -6,7 +6,6 @@ import 'package:args/command_runner.dart';
import 'package:file/memory.dart';
import 'package:flutter_tools/src/android/android_sdk.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/os.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/build_info.dart';
@@ -186,7 +185,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createCoreMockProjectFiles();
@@ -206,7 +204,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createCoreMockProjectFiles();
@@ -226,7 +223,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
fileSystem.file('pubspec.yaml').createSync();
@@ -234,7 +230,7 @@ void main() {
fileSystem.file(fileSystem.path.join('lib', 'main.dart'))
.createSync(recursive: true);
final bool supported = BuildIOSCommand(logger: BufferLogger.test(), verboseHelp: false).supported;
final bool supported = BuildIOSCommand(verboseHelp: false).supported;
expect(createTestCommandRunner(command).run(
const <String>['build', 'ios', '--no-pub']
), supported ? throwsToolExit() : throwsA(isA<UsageException>()));
@@ -250,7 +246,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
@@ -277,7 +272,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
@@ -304,7 +298,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
@@ -330,7 +323,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
@@ -356,7 +348,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
@@ -406,7 +397,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
@@ -437,7 +427,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
@@ -472,7 +461,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
@@ -506,7 +494,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
@@ -535,7 +522,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
@@ -570,7 +556,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
@@ -605,7 +590,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
@@ -642,7 +626,6 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
@@ -676,7 +659,6 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
@@ -714,7 +696,6 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
@@ -748,7 +729,6 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
@@ -783,7 +763,6 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
@@ -820,7 +799,6 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
@@ -855,7 +833,6 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
@@ -891,7 +868,6 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
@@ -929,7 +905,6 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);

View File

@@ -7,7 +7,6 @@ import 'dart:typed_data';
import 'package:args/command_runner.dart';
import 'package:file/memory.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/build_system/build_system.dart';
import 'package:flutter_tools/src/cache.dart';
@@ -198,7 +197,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createCoreMockProjectFiles();
@@ -218,7 +216,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createCoreMockProjectFiles();
@@ -238,7 +235,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
fileSystem.file('pubspec.yaml').createSync();
@@ -246,7 +242,7 @@ void main() {
fileSystem.file(fileSystem.path.join('lib', 'main.dart'))
.createSync(recursive: true);
final bool supported = BuildIOSArchiveCommand(logger: BufferLogger.test(), verboseHelp: false).supported;
final bool supported = BuildIOSArchiveCommand(verboseHelp: false).supported;
expect(createTestCommandRunner(command).run(
const <String>['build', 'ipa', '--no-pub']
), supported ? throwsToolExit() : throwsA(isA<UsageException>()));
@@ -263,7 +259,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
@@ -292,7 +287,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
@@ -319,7 +313,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
@@ -348,7 +341,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
@@ -396,7 +388,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
@@ -445,7 +436,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
@@ -494,7 +484,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
@@ -542,7 +531,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
@@ -568,7 +556,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
@@ -617,7 +604,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
@@ -640,7 +626,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
@@ -697,7 +682,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
@@ -731,7 +715,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
@@ -762,7 +745,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
@@ -794,7 +776,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
@@ -828,7 +809,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
@@ -857,7 +837,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
fakeProcessManager.addCommands(<FakeCommand>[
@@ -909,7 +888,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
@@ -963,7 +941,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
@@ -1013,7 +990,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
@@ -1052,7 +1028,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
@@ -1133,7 +1108,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
@@ -1212,7 +1186,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
@@ -1271,7 +1244,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
@@ -1330,7 +1302,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
@@ -1389,7 +1360,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
@@ -1449,7 +1419,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
@@ -1553,7 +1522,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
@@ -1633,7 +1601,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(
@@ -1711,7 +1678,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
await createTestCommandRunner(command).run(

View File

@@ -6,7 +6,6 @@ import 'package:args/command_runner.dart';
import 'package:file/memory.dart';
import 'package:file_testing/file_testing.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/os.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/base/utils.dart';
@@ -113,7 +112,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
setUpMockCoreProjectFiles();
@@ -135,7 +133,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
setUpMockProjectFilesForBuild();
@@ -155,7 +152,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
setUpMockProjectFilesForBuild();
@@ -175,7 +171,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
processManager = FakeProcessManager.list(<FakeCommand>[
@@ -202,7 +197,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
setUpMockProjectFilesForBuild();
@@ -225,7 +219,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
setUpMockProjectFilesForBuild();
@@ -252,7 +245,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
setUpMockProjectFilesForBuild();
@@ -283,7 +275,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
setUpMockProjectFilesForBuild();
@@ -343,7 +334,6 @@ ERROR: No file or variants found for asset: images/a_dot_burr.jpeg
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
setUpMockProjectFilesForBuild();
@@ -377,7 +367,6 @@ ERROR: No file or variants found for asset: images/a_dot_burr.jpeg
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
setUpMockProjectFilesForBuild();
@@ -402,7 +391,6 @@ ERROR: No file or variants found for asset: images/a_dot_burr.jpeg
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: CustomFakeOperatingSystemUtils(hostPlatform: HostPlatform.linux_arm64),
);
setUpMockProjectFilesForBuild();
@@ -426,7 +414,6 @@ ERROR: No file or variants found for asset: images/a_dot_burr.jpeg
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
setUpMockProjectFilesForBuild();
@@ -451,7 +438,6 @@ ERROR: No file or variants found for asset: images/a_dot_burr.jpeg
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: CustomFakeOperatingSystemUtils(hostPlatform: HostPlatform.linux_arm64),
);
setUpMockProjectFilesForBuild();
@@ -475,7 +461,6 @@ ERROR: No file or variants found for asset: images/a_dot_burr.jpeg
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: CustomFakeOperatingSystemUtils(hostPlatform: HostPlatform.linux_arm64),
);
@@ -492,7 +477,6 @@ ERROR: No file or variants found for asset: images/a_dot_burr.jpeg
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
setUpMockProjectFilesForBuild();
@@ -585,7 +569,6 @@ set(BINARY_NAME "fizz_bar")
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
));
@@ -596,14 +579,14 @@ set(BINARY_NAME "fizz_bar")
});
testUsingContext('hidden when not enabled on Linux host', () {
expect(BuildLinuxCommand(logger: BufferLogger.test(), operatingSystemUtils: FakeOperatingSystemUtils()).hidden, true);
expect(BuildLinuxCommand(operatingSystemUtils: FakeOperatingSystemUtils()).hidden, true);
}, overrides: <Type, Generator>{
FeatureFlags: () => TestFeatureFlags(),
Platform: () => notLinuxPlatform,
});
testUsingContext('Not hidden when enabled and on Linux host', () {
expect(BuildLinuxCommand(logger: BufferLogger.test(), operatingSystemUtils: FakeOperatingSystemUtils()).hidden, false);
expect(BuildLinuxCommand(operatingSystemUtils: FakeOperatingSystemUtils()).hidden, false);
}, overrides: <Type, Generator>{
FeatureFlags: () => TestFeatureFlags(isLinuxEnabled: true),
Platform: () => linuxPlatform,
@@ -614,7 +597,6 @@ set(BINARY_NAME "fizz_bar")
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
setUpMockProjectFilesForBuild();
@@ -665,7 +647,6 @@ set(BINARY_NAME "fizz_bar")
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: CustomFakeOperatingSystemUtils(hostPlatform: HostPlatform.linux_arm64),
);
setUpMockProjectFilesForBuild();

View File

@@ -142,7 +142,6 @@ STDERR STUFF
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createCoreMockProjectFiles();
@@ -164,7 +163,6 @@ STDERR STUFF
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
fileSystem.file('pubspec.yaml').createSync();
@@ -186,7 +184,6 @@ STDERR STUFF
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
fileSystem.file('pubspec.yaml').createSync();
@@ -208,7 +205,6 @@ STDERR STUFF
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
@@ -238,7 +234,6 @@ STDERR STUFF
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
@@ -260,7 +255,6 @@ STDERR STUFF
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
@@ -283,7 +277,6 @@ STDERR STUFF
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
@@ -306,7 +299,6 @@ STDERR STUFF
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
@@ -328,7 +320,6 @@ STDERR STUFF
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
@@ -419,7 +410,6 @@ STDERR STUFF
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: fileSystem,
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
@@ -441,7 +431,6 @@ STDERR STUFF
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();
@@ -476,11 +465,10 @@ STDERR STUFF
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
));
final bool supported = BuildMacosCommand(logger: BufferLogger.test(), verboseHelp: false).supported;
final bool supported = BuildMacosCommand(verboseHelp: false).supported;
expect(() => runner.run(<String>['build', 'macos', '--no-pub']),
supported ? throwsToolExit() : throwsA(isA<UsageException>()));
}, overrides: <Type, Generator>{
@@ -488,14 +476,14 @@ STDERR STUFF
});
testUsingContext('hidden when not enabled on macOS host', () {
expect(BuildMacosCommand(logger: BufferLogger.test(), verboseHelp: false).hidden, true);
expect(BuildMacosCommand(verboseHelp: false).hidden, true);
}, overrides: <Type, Generator>{
FeatureFlags: () => TestFeatureFlags(),
Platform: () => macosPlatform,
});
testUsingContext('Not hidden when enabled and on macOS host', () {
expect(BuildMacosCommand(logger: BufferLogger.test(), verboseHelp: false).hidden, false);
expect(BuildMacosCommand(verboseHelp: false).hidden, false);
}, overrides: <Type, Generator>{
FeatureFlags: () => TestFeatureFlags(isMacOSEnabled: true),
Platform: () => macosPlatform,
@@ -506,7 +494,6 @@ STDERR STUFF
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
createMinimalMockProjectFiles();

View File

@@ -5,7 +5,6 @@
import 'package:args/command_runner.dart';
import 'package:file/memory.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/build_system/build_system.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/commands/build.dart';
@@ -44,7 +43,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
try {
@@ -66,7 +64,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
testLogger.printWarning('Warning: Mild annoyance Will Robinson!');
@@ -88,7 +85,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
testLogger.printWarning('Warning: Mild annoyance Will Robinson!');
@@ -107,7 +103,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
testLogger.printError('Error: Danger Will Robinson!');
@@ -147,11 +142,10 @@ class FakeBuildCommand extends BuildCommand {
required super.fileSystem,
required super.buildSystem,
required super.osUtils,
required Logger logger,
required super.androidSdk,
bool verboseHelp = false,
}) : super(logger: logger, verboseHelp: verboseHelp,) {
addSubcommand(FakeBuildSubcommand(logger: logger, verboseHelp: verboseHelp));
}) : super(verboseHelp: verboseHelp,) {
addSubcommand(FakeBuildSubcommand(verboseHelp: verboseHelp));
}
@override
@@ -167,7 +161,7 @@ class FakeBuildCommand extends BuildCommand {
}
class FakeBuildSubcommand extends BuildSubCommand {
FakeBuildSubcommand({required super.logger, required super.verboseHelp});
FakeBuildSubcommand({required super.verboseHelp});
@override
String get description => '';

View File

@@ -5,7 +5,6 @@
import 'package:args/command_runner.dart';
import 'package:file/memory.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/build_system/build_system.dart';
@@ -50,7 +49,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
));
@@ -70,7 +68,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: fileSystem,
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
));
@@ -87,7 +84,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
));
@@ -107,7 +103,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: fileSystem,
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
final CommandRunner<void> runner = createTestCommandRunner(buildCommand);
@@ -148,7 +143,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: fileSystem,
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
final CommandRunner<void> runner = createTestCommandRunner(buildCommand);
@@ -194,7 +188,7 @@ void main() {
});
testUsingContext('hidden if feature flag is not enabled', () async {
expect(BuildWebCommand(fileSystem: fileSystem, logger: BufferLogger.test(), verboseHelp: false).hidden, true);
expect(BuildWebCommand(fileSystem: fileSystem, verboseHelp: false).hidden, true);
}, overrides: <Type, Generator>{
Platform: () => fakePlatform,
FileSystem: () => fileSystem,
@@ -203,7 +197,7 @@ void main() {
});
testUsingContext('not hidden if feature flag is enabled', () async {
expect(BuildWebCommand(fileSystem: fileSystem, logger: BufferLogger.test(), verboseHelp: false).hidden, false);
expect(BuildWebCommand(fileSystem: fileSystem, verboseHelp: false).hidden, false);
}, overrides: <Type, Generator>{
Platform: () => fakePlatform,
FileSystem: () => fileSystem,
@@ -307,7 +301,6 @@ class TestWebBuildCommand extends FlutterCommand {
TestWebBuildCommand({ required FileSystem fileSystem, bool verboseHelp = false }) :
webCommand = BuildWebCommand(
fileSystem: fileSystem,
logger: BufferLogger.test(),
verboseHelp: verboseHelp) {
addSubcommand(webCommand);
}

View File

@@ -5,7 +5,6 @@
import 'package:file/memory.dart';
import 'package:file_testing/file_testing.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/commands/build_windows.dart';
@@ -117,7 +116,7 @@ void main() {
}
testUsingContext('Windows build fails when there is no cmake path', () async {
final BuildWindowsCommand command = BuildWindowsCommand(logger: BufferLogger.test())
final BuildWindowsCommand command = BuildWindowsCommand()
..visualStudioOverride = FakeVisualStudio(cmakePath: null);
setUpMockProjectFilesForBuild();
@@ -133,7 +132,7 @@ void main() {
testUsingContext('Windows build fails when there is no windows project', () async {
final FakeVisualStudio fakeVisualStudio = FakeVisualStudio();
final BuildWindowsCommand command = BuildWindowsCommand(logger: BufferLogger.test())
final BuildWindowsCommand command = BuildWindowsCommand()
..visualStudioOverride = fakeVisualStudio;
setUpMockCoreProjectFiles();
@@ -151,7 +150,7 @@ void main() {
testUsingContext('Windows build fails on non windows platform', () async {
final FakeVisualStudio fakeVisualStudio = FakeVisualStudio();
final BuildWindowsCommand command = BuildWindowsCommand(logger: BufferLogger.test())
final BuildWindowsCommand command = BuildWindowsCommand()
..visualStudioOverride = fakeVisualStudio;
setUpMockProjectFilesForBuild();
@@ -167,7 +166,7 @@ void main() {
testUsingContext('Windows build fails when feature is disabled', () async {
final FakeVisualStudio fakeVisualStudio = FakeVisualStudio();
final BuildWindowsCommand command = BuildWindowsCommand(logger: BufferLogger.test())
final BuildWindowsCommand command = BuildWindowsCommand()
..visualStudioOverride = fakeVisualStudio;
setUpMockProjectFilesForBuild();
@@ -183,7 +182,7 @@ void main() {
testUsingContext('Windows build does not spew stdout to status logger', () async {
final FakeVisualStudio fakeVisualStudio = FakeVisualStudio();
final BuildWindowsCommand command = BuildWindowsCommand(logger: BufferLogger.test())
final BuildWindowsCommand command = BuildWindowsCommand()
..visualStudioOverride = fakeVisualStudio;
setUpMockProjectFilesForBuild();
@@ -208,7 +207,7 @@ void main() {
testUsingContext('Windows build extracts errors from stdout', () async {
final FakeVisualStudio fakeVisualStudio = FakeVisualStudio();
final BuildWindowsCommand command = BuildWindowsCommand(logger: BufferLogger.test())
final BuildWindowsCommand command = BuildWindowsCommand()
..visualStudioOverride = fakeVisualStudio;
setUpMockProjectFilesForBuild();
@@ -266,7 +265,7 @@ C:\foo\windows\runner\main.cpp(17,1): error C2065: 'Baz': undeclared identifier
testUsingContext('Windows verbose build sets VERBOSE_SCRIPT_LOGGING', () async {
final FakeVisualStudio fakeVisualStudio = FakeVisualStudio();
final BuildWindowsCommand command = BuildWindowsCommand(logger: BufferLogger.test())
final BuildWindowsCommand command = BuildWindowsCommand()
..visualStudioOverride = fakeVisualStudio;
setUpMockProjectFilesForBuild();
@@ -292,7 +291,7 @@ C:\foo\windows\runner\main.cpp(17,1): error C2065: 'Baz': undeclared identifier
testUsingContext('Windows build works around CMake generation bug', () async {
final FakeVisualStudio fakeVisualStudio = FakeVisualStudio(displayVersion: '17.1.0');
final BuildWindowsCommand command = BuildWindowsCommand(logger: BufferLogger.test())
final BuildWindowsCommand command = BuildWindowsCommand()
..visualStudioOverride = fakeVisualStudio;
setUpMockProjectFilesForBuild();
@@ -428,7 +427,7 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
testUsingContext('Windows build invokes build and writes generated files', () async {
final FakeVisualStudio fakeVisualStudio = FakeVisualStudio();
final BuildWindowsCommand command = BuildWindowsCommand(logger: BufferLogger.test())
final BuildWindowsCommand command = BuildWindowsCommand()
..visualStudioOverride = fakeVisualStudio;
setUpMockProjectFilesForBuild();
@@ -498,7 +497,7 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
testUsingContext('Windows profile build passes Profile configuration', () async {
final FakeVisualStudio fakeVisualStudio = FakeVisualStudio();
final BuildWindowsCommand command = BuildWindowsCommand(logger: BufferLogger.test())
final BuildWindowsCommand command = BuildWindowsCommand()
..visualStudioOverride = fakeVisualStudio;
setUpMockProjectFilesForBuild();
@@ -521,7 +520,7 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
const String generator = 'A different generator';
final FakeVisualStudio fakeVisualStudio = FakeVisualStudio(
cmakeGenerator: generator);
final BuildWindowsCommand command = BuildWindowsCommand(logger: BufferLogger.test())
final BuildWindowsCommand command = BuildWindowsCommand()
..visualStudioOverride = fakeVisualStudio;
setUpMockProjectFilesForBuild();
@@ -542,7 +541,7 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
testUsingContext("Windows build uses pubspec's version", () async {
final FakeVisualStudio fakeVisualStudio = FakeVisualStudio();
final BuildWindowsCommand command = BuildWindowsCommand(logger: BufferLogger.test())
final BuildWindowsCommand command = BuildWindowsCommand()
..visualStudioOverride = fakeVisualStudio;
setUpMockProjectFilesForBuild();
@@ -588,7 +587,7 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
testUsingContext('Windows build uses build-name and build-number', () async {
final FakeVisualStudio fakeVisualStudio = FakeVisualStudio();
final BuildWindowsCommand command = BuildWindowsCommand(logger: BufferLogger.test())
final BuildWindowsCommand command = BuildWindowsCommand()
..visualStudioOverride = fakeVisualStudio;
setUpMockProjectFilesForBuild();
@@ -632,7 +631,7 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
testUsingContext('Windows build build-name overrides pubspec', () async {
final FakeVisualStudio fakeVisualStudio = FakeVisualStudio();
final BuildWindowsCommand command = BuildWindowsCommand(logger: BufferLogger.test())
final BuildWindowsCommand command = BuildWindowsCommand()
..visualStudioOverride = fakeVisualStudio;
setUpMockProjectFilesForBuild();
@@ -679,7 +678,7 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
testUsingContext('Windows build build-number overrides pubspec', () async {
final FakeVisualStudio fakeVisualStudio = FakeVisualStudio();
final BuildWindowsCommand command = BuildWindowsCommand(logger: BufferLogger.test())
final BuildWindowsCommand command = BuildWindowsCommand()
..visualStudioOverride = fakeVisualStudio;
setUpMockProjectFilesForBuild();
@@ -726,7 +725,7 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
testUsingContext('Windows build build-name and build-number override pubspec', () async {
final FakeVisualStudio fakeVisualStudio = FakeVisualStudio();
final BuildWindowsCommand command = BuildWindowsCommand(logger: BufferLogger.test())
final BuildWindowsCommand command = BuildWindowsCommand()
..visualStudioOverride = fakeVisualStudio;
setUpMockProjectFilesForBuild();
@@ -774,7 +773,7 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
testUsingContext('Windows build warns on non-numeric build-number', () async {
final FakeVisualStudio fakeVisualStudio = FakeVisualStudio();
final BuildWindowsCommand command = BuildWindowsCommand(logger: BufferLogger.test())
final BuildWindowsCommand command = BuildWindowsCommand()
..visualStudioOverride = fakeVisualStudio;
setUpMockProjectFilesForBuild();
@@ -824,7 +823,7 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
testUsingContext('Windows build warns on complex build-number', () async {
final FakeVisualStudio fakeVisualStudio = FakeVisualStudio();
final BuildWindowsCommand command = BuildWindowsCommand(logger: BufferLogger.test())
final BuildWindowsCommand command = BuildWindowsCommand()
..visualStudioOverride = fakeVisualStudio;
setUpMockProjectFilesForBuild();
@@ -873,14 +872,14 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
});
testUsingContext('hidden when not enabled on Windows host', () {
expect(BuildWindowsCommand(logger: BufferLogger.test()).hidden, true);
expect(BuildWindowsCommand().hidden, true);
}, overrides: <Type, Generator>{
FeatureFlags: () => TestFeatureFlags(),
Platform: () => windowsPlatform,
});
testUsingContext('Not hidden when enabled and on Windows host', () {
expect(BuildWindowsCommand(logger: BufferLogger.test()).hidden, false);
expect(BuildWindowsCommand().hidden, false);
}, overrides: <Type, Generator>{
FeatureFlags: () => TestFeatureFlags(isWindowsEnabled: true),
Platform: () => windowsPlatform,
@@ -888,7 +887,7 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
testUsingContext('Performs code size analysis and sends analytics', () async {
final FakeVisualStudio fakeVisualStudio = FakeVisualStudio();
final BuildWindowsCommand command = BuildWindowsCommand(logger: BufferLogger.test())
final BuildWindowsCommand command = BuildWindowsCommand()
..visualStudioOverride = fakeVisualStudio;
setUpMockProjectFilesForBuild();
@@ -940,7 +939,7 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
// is resolved on the VS side, we can allow these paths again
testUsingContext('Test bad path characters', () async {
final FakeVisualStudio fakeVisualStudio = FakeVisualStudio();
final BuildWindowsCommand command = BuildWindowsCommand(logger: BufferLogger.test())
final BuildWindowsCommand command = BuildWindowsCommand()
..visualStudioOverride = fakeVisualStudio;
fileSystem.currentDirectory = fileSystem.directory("test_'path")
..createSync();

View File

@@ -381,7 +381,6 @@ void main() {
'--trace-skia',
'--trace-systrace',
'--verbose-system-logs',
'--null-assertions',
'--native-null-assertions',
'--enable-impeller',
'--trace-systrace',
@@ -397,7 +396,6 @@ void main() {
expect(options.traceSkia, true);
expect(options.traceSystrace, true);
expect(options.verboseSystemLogs, true);
expect(options.nullAssertions, true);
expect(options.nativeNullAssertions, true);
expect(options.enableImpeller, true);
expect(options.traceSystrace, true);

View File

@@ -1005,7 +1005,6 @@ void main() {
'--trace-skia',
'--trace-systrace',
'--verbose-system-logs',
'--null-assertions',
'--native-null-assertions',
'--enable-impeller',
'--trace-systrace',
@@ -1022,7 +1021,6 @@ void main() {
expect(options.traceSkia, true);
expect(options.traceSystrace, true);
expect(options.verboseSystemLogs, true);
expect(options.nullAssertions, true);
expect(options.nativeNullAssertions, true);
expect(options.traceSystrace, true);
expect(options.enableImpeller, true);

View File

@@ -7,7 +7,6 @@ import 'package:flutter_tools/src/android/android_builder.dart';
import 'package:flutter_tools/src/android/android_sdk.dart';
import 'package:flutter_tools/src/android/android_studio.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/commands/build_aar.dart';
@@ -31,7 +30,6 @@ void main() {
final BuildAarCommand command = BuildAarCommand(
androidSdk: FakeAndroidSdk(),
fileSystem: globals.fs,
logger: BufferLogger.test(),
verboseHelp: false,
);
final CommandRunner<void> runner = createTestCommandRunner(command);
@@ -189,7 +187,6 @@ void main() {
expect(buildInfo.splitDebugInfoPath, '/project-name/v1.2.3/');
expect(buildInfo.dartObfuscation, isTrue);
expect(buildInfo.dartDefines.contains('foo=bar'), isTrue);
expect(buildInfo.nullSafetyMode, NullSafetyMode.sound);
}, overrides: <Type, Generator>{
AndroidBuilder: () => fakeAndroidBuilder,
});
@@ -309,7 +306,6 @@ Future<BuildAarCommand> runBuildAarCommand(
final BuildAarCommand command = BuildAarCommand(
androidSdk: androidSdk,
fileSystem: globals.fs,
logger: BufferLogger.test(),
verboseHelp: false,
);
final CommandRunner<void> runner = createTestCommandRunner(command);

View File

@@ -7,7 +7,6 @@ import 'package:flutter_tools/src/android/android_builder.dart';
import 'package:flutter_tools/src/android/android_sdk.dart';
import 'package:flutter_tools/src/android/android_studio.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/commands/build_apk.dart';
import 'package:flutter_tools/src/globals.dart' as globals;
@@ -430,7 +429,7 @@ Future<BuildApkCommand> runBuildApkCommand(
String target, {
List<String>? arguments,
}) async {
final BuildApkCommand command = BuildApkCommand(logger: BufferLogger.test());
final BuildApkCommand command = BuildApkCommand();
final CommandRunner<void> runner = createTestCommandRunner(command);
await runner.run(<String>[
'apk',

View File

@@ -6,7 +6,6 @@ import 'package:args/command_runner.dart';
import 'package:flutter_tools/src/android/android_builder.dart';
import 'package:flutter_tools/src/android/android_sdk.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/commands/build_appbundle.dart';
import 'package:flutter_tools/src/globals.dart' as globals;
@@ -214,7 +213,7 @@ Future<BuildAppBundleCommand> runBuildAppBundleCommand(
String target, {
List<String>? arguments,
}) async {
final BuildAppBundleCommand command = BuildAppBundleCommand(logger: BufferLogger.test());
final BuildAppBundleCommand command = BuildAppBundleCommand();
final CommandRunner<void> runner = createTestCommandRunner(command);
await runner.run(<String>[
'appbundle',

View File

@@ -5,7 +5,6 @@
import 'package:args/command_runner.dart';
import 'package:file/memory.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/build_system/build_system.dart';
import 'package:flutter_tools/src/bundle.dart';
@@ -47,7 +46,6 @@ void main() {
Future<BuildBundleCommand> runCommandIn(String projectPath, { List<String>? arguments }) async {
final BuildBundleCommand command = BuildBundleCommand(
logger: BufferLogger.test(),
bundleBuilder: fakeBundleBuilder,
);
final CommandRunner<void> runner = createTestCommandRunner(command);
@@ -91,9 +89,7 @@ void main() {
globals.fs.file(globals.fs.path.join('lib', 'main.dart')).createSync(recursive: true);
globals.fs.file('pubspec.yaml').createSync(recursive: true);
globals.fs.file('.packages').createSync(recursive: true);
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand(
logger: BufferLogger.test(),
));
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand());
expect(() => runner.run(<String>[
'bundle',
@@ -111,9 +107,7 @@ void main() {
globals.fs.file(globals.fs.path.join('lib', 'main.dart')).createSync(recursive: true);
globals.fs.file('pubspec.yaml').createSync();
globals.fs.file('.packages').createSync();
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand(
logger: BufferLogger.test(),
));
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand());
expect(() => runner.run(<String>[
'bundle',
@@ -131,9 +125,7 @@ void main() {
globals.fs.file(globals.fs.path.join('lib', 'main.dart')).createSync(recursive: true);
globals.fs.file('pubspec.yaml').createSync();
globals.fs.file('.packages').createSync();
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand(
logger: BufferLogger.test(),
));
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand());
expect(() => runner.run(<String>[
'bundle',
@@ -151,9 +143,7 @@ void main() {
globals.fs.file(globals.fs.path.join('lib', 'main.dart')).createSync(recursive: true);
globals.fs.file('pubspec.yaml').createSync();
globals.fs.file('.packages').createSync();
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand(
logger: BufferLogger.test(),
));
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand());
expect(() => runner.run(<String>[
'bundle',
@@ -170,9 +160,7 @@ void main() {
globals.fs.file(globals.fs.path.join('lib', 'main.dart')).createSync(recursive: true);
globals.fs.file('pubspec.yaml').createSync();
globals.fs.file('.packages').createSync();
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand(
logger: BufferLogger.test(),
));
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand());
await runner.run(<String>[
'bundle',
@@ -190,9 +178,7 @@ void main() {
globals.fs.file(globals.fs.path.join('lib', 'main.dart')).createSync(recursive: true);
globals.fs.file('pubspec.yaml').createSync();
globals.fs.file('.packages').createSync();
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand(
logger: BufferLogger.test(),
));
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand());
await runner.run(<String>[
'bundle',
@@ -210,9 +196,7 @@ void main() {
globals.fs.file(globals.fs.path.join('lib', 'main.dart')).createSync(recursive: true);
globals.fs.file('pubspec.yaml').createSync();
globals.fs.file('.packages').createSync();
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand(
logger: BufferLogger.test(),
));
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand());
await runner.run(<String>[
'bundle',
@@ -230,9 +214,7 @@ void main() {
globals.fs.file(globals.fs.path.join('lib', 'main.dart')).createSync(recursive: true);
globals.fs.file('pubspec.yaml').createSync();
globals.fs.file('.packages').createSync();
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand(
logger: BufferLogger.test(),
));
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand());
await runner.run(<String>[
'bundle',
@@ -262,9 +244,7 @@ void main() {
globals.fs.file(globals.fs.path.join('lib', 'main.dart')).createSync(recursive: true);
globals.fs.file('pubspec.yaml').createSync();
globals.fs.file('.packages').createSync();
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand(
logger: BufferLogger.test(),
));
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand());
await runner.run(<String>[
'bundle',
@@ -295,9 +275,7 @@ void main() {
globals.fs.file(globals.fs.path.join('lib', 'main.dart')).createSync(recursive: true);
globals.fs.file('pubspec.yaml').createSync();
globals.fs.file('.packages').createSync();
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand(
logger: BufferLogger.test(),
));
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand());
await runner.run(<String>[
'bundle',
@@ -327,9 +305,7 @@ void main() {
globals.fs.file(globals.fs.path.join('lib', 'main.dart')).createSync(recursive: true);
globals.fs.file('pubspec.yaml').createSync();
globals.fs.file('.packages').createSync();
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand(
logger: BufferLogger.test(),
));
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand());
await runner.run(<String>[
'bundle',
@@ -360,9 +336,7 @@ void main() {
globals.fs.file(globals.fs.path.join('lib', 'main.dart')).createSync(recursive: true);
globals.fs.file('pubspec.yaml').createSync();
globals.fs.file('.packages').createSync();
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand(
logger: BufferLogger.test(),
));
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand());
await runner.run(<String>[
'bundle',
@@ -393,9 +367,7 @@ void main() {
globals.fs.file(globals.fs.path.join('lib', 'main.dart')).createSync(recursive: true);
globals.fs.file('pubspec.yaml').createSync();
globals.fs.file('.packages').createSync();
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand(
logger: BufferLogger.test(),
));
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand());
await runner.run(<String>[
'bundle',
@@ -426,9 +398,7 @@ void main() {
globals.fs.file(globals.fs.path.join('lib', 'main.dart')).createSync(recursive: true);
globals.fs.file('pubspec.yaml').createSync();
globals.fs.file('.packages').createSync();
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand(
logger: BufferLogger.test(),
));
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand());
await runner.run(<String>[
'bundle',
@@ -467,9 +437,7 @@ void main() {
globals.fs.file(globals.fs.path.join('lib', 'main.dart')).createSync(recursive: true);
globals.fs.file('pubspec.yaml').createSync();
globals.fs.file('.packages').createSync();
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand(
logger: BufferLogger.test(),
));
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand());
await runner.run(<String>[
'bundle',
@@ -525,9 +493,7 @@ void main() {
}
'''
);
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand(
logger: BufferLogger.test(),
));
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand());
await runner.run(<String>[
'bundle',
@@ -564,9 +530,7 @@ void main() {
}
'''
);
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand(
logger: BufferLogger.test(),
));
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand());
await runner.run(<String>[
'bundle',
@@ -587,9 +551,7 @@ void main() {
globals.fs.file('pubspec.yaml').createSync();
globals.fs.file('.packages').createSync();
globals.fs.directory('config').createSync();
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand(
logger: BufferLogger.test(),
));
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand());
expect(() => runner.run(<String>[
'bundle',
@@ -616,9 +578,7 @@ void main() {
}
'''
);
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand(
logger: BufferLogger.test(),
));
final CommandRunner<void> runner = createTestCommandRunner(BuildBundleCommand());
expect(() => runner.run(<String>[
'bundle',

View File

@@ -9,7 +9,6 @@ import 'package:flutter_tools/src/android/android_workflow.dart';
import 'package:flutter_tools/src/base/config.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/base/time.dart';
import 'package:flutter_tools/src/build_system/build_system.dart';
@@ -220,7 +219,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
final FlutterCommand buildApkCommand = buildCommand.subcommands['apk']! as FlutterCommand;

View File

@@ -250,7 +250,7 @@ void main() {
'--ez', 'verify-entry-points', 'true',
'--ez', 'start-paused', 'true',
'--ez', 'disable-service-auth-codes', 'true',
'--es', 'dart-flags', 'foo,--null_assertions',
'--es', 'dart-flags', 'foo',
'--ez', 'use-test-fonts', 'true',
'--ez', 'verbose-logging', 'true',
'--user', '10',
@@ -278,7 +278,6 @@ void main() {
purgePersistentCache: true,
useTestFonts: true,
verboseSystemLogs: true,
nullAssertions: true,
enableImpeller: true,
),
platformArgs: <String, dynamic>{},

View File

@@ -152,22 +152,6 @@ void main() {
});
testWithoutContext('precompiled web artifact paths are correct', () {
expect(
artifacts.getHostArtifact(HostArtifact.webPrecompiledSdk).path,
'root/bin/cache/flutter_web_sdk/kernel/amd/dart_sdk.js',
);
expect(
artifacts.getHostArtifact(HostArtifact.webPrecompiledSdkSourcemaps).path,
'root/bin/cache/flutter_web_sdk/kernel/amd/dart_sdk.js.map',
);
expect(
artifacts.getHostArtifact(HostArtifact.webPrecompiledCanvaskitSdk).path,
'root/bin/cache/flutter_web_sdk/kernel/amd-canvaskit/dart_sdk.js',
);
expect(
artifacts.getHostArtifact(HostArtifact.webPrecompiledCanvaskitSdkSourcemaps).path,
'root/bin/cache/flutter_web_sdk/kernel/amd-canvaskit/dart_sdk.js.map',
);
expect(
artifacts.getHostArtifact(HostArtifact.webPrecompiledSoundSdk).path,
'root/bin/cache/flutter_web_sdk/kernel/amd-sound/dart_sdk.js',

View File

@@ -2,29 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:args/args.dart';
import 'package:args/command_runner.dart';
import 'package:file/memory.dart';
import 'package:flutter_tools/src/artifacts.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/base/signals.dart';
import 'package:flutter_tools/src/base/terminal.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/build_system/build_system.dart';
import 'package:flutter_tools/src/commands/attach.dart';
import 'package:flutter_tools/src/commands/build.dart';
import 'package:flutter_tools/src/commands/build_aar.dart';
import 'package:flutter_tools/src/commands/build_apk.dart';
import 'package:flutter_tools/src/commands/build_appbundle.dart';
import 'package:flutter_tools/src/commands/build_ios.dart';
import 'package:flutter_tools/src/commands/build_ios_framework.dart';
import 'package:flutter_tools/src/commands/build_linux.dart';
import 'package:flutter_tools/src/commands/build_macos.dart';
import 'package:flutter_tools/src/commands/build_web.dart';
import 'package:flutter_tools/src/commands/build_windows.dart';
import 'package:flutter_tools/src/runner/flutter_command.dart';
import 'package:test/fake.dart';
@@ -46,78 +30,11 @@ class FakeProcessInfo extends Fake implements ProcessInfo {
}
void main() {
testUsingContext('All build commands support null safety options', () {
final FileSystem fileSystem = MemoryFileSystem.test();
final Platform platform = FakePlatform();
final BufferLogger logger = BufferLogger.test();
final List<FlutterCommand> commands = <FlutterCommand>[
BuildWindowsCommand(logger: BufferLogger.test()),
BuildLinuxCommand(logger: BufferLogger.test(), operatingSystemUtils: FakeOperatingSystemUtils()),
BuildMacosCommand(logger: BufferLogger.test(), verboseHelp: false),
BuildWebCommand(fileSystem: fileSystem, logger: BufferLogger.test(), verboseHelp: false),
BuildApkCommand(logger: BufferLogger.test()),
BuildIOSCommand(logger: BufferLogger.test(), verboseHelp: false),
BuildIOSArchiveCommand(logger: BufferLogger.test(), verboseHelp: false),
BuildAppBundleCommand(logger: BufferLogger.test()),
BuildAarCommand(
logger: BufferLogger.test(),
androidSdk: FakeAndroidSdk(),
fileSystem: fileSystem,
verboseHelp: false,
),
BuildIOSFrameworkCommand(
logger: BufferLogger.test(),
verboseHelp: false,
buildSystem: FlutterBuildSystem(
fileSystem: fileSystem,
platform: platform,
logger: logger,
),
),
AttachCommand(
artifacts: Artifacts.test(),
stdio: FakeStdio(),
logger: logger,
terminal: FakeTerminal(),
signals: Signals.test(),
platform: platform,
processInfo: FakeProcessInfo(),
fileSystem: MemoryFileSystem.test(),
),
];
for (final FlutterCommand command in commands) {
final ArgResults results = command.argParser.parse(<String>[
'--sound-null-safety',
'--enable-experiment=non-nullable',
]);
expect(results.wasParsed('sound-null-safety'), true);
expect(results.wasParsed('enable-experiment'), true);
}
});
testUsingContext('BuildSubCommand displays current null safety mode',
() async {
const BuildInfo unsound = BuildInfo(
BuildMode.debug,
'',
nullSafetyMode: NullSafetyMode.unsound,
treeShakeIcons: false,
);
final BufferLogger logger = BufferLogger.test();
FakeBuildSubCommand(logger).test(unsound);
expect(logger.statusText,
contains('Building without sound null safety ⚠️'));
});
testUsingContext('Include only supported sub commands', () {
final BuildCommand command = BuildCommand(
androidSdk: FakeAndroidSdk(),
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
fileSystem: MemoryFileSystem.test(),
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
);
for (final Command<void> x in command.subcommands.values) {
@@ -127,7 +44,7 @@ void main() {
}
class FakeBuildSubCommand extends BuildSubCommand {
FakeBuildSubCommand(Logger logger) : super(logger: logger, verboseHelp: false);
FakeBuildSubCommand() : super(verboseHelp: false);
@override
String get description => throw UnimplementedError();
@@ -136,7 +53,8 @@ class FakeBuildSubCommand extends BuildSubCommand {
String get name => throw UnimplementedError();
void test(BuildInfo buildInfo) {
displayNullSafetyMode(buildInfo);
throw UnimplementedError('TODO what should we do here?');
//displayNullSafetyMode(buildInfo);
}
@override

View File

@@ -159,10 +159,9 @@ void main() {
'FLUTTER_ENGINE_SWITCH_14': 'verify-entry-points=true',
'FLUTTER_ENGINE_SWITCH_15': 'start-paused=true',
'FLUTTER_ENGINE_SWITCH_16': 'disable-service-auth-codes=true',
'FLUTTER_ENGINE_SWITCH_17': 'dart-flags=--null_assertions',
'FLUTTER_ENGINE_SWITCH_18': 'use-test-fonts=true',
'FLUTTER_ENGINE_SWITCH_19': 'verbose-logging=true',
'FLUTTER_ENGINE_SWITCHES': '19',
'FLUTTER_ENGINE_SWITCH_17': 'use-test-fonts=true',
'FLUTTER_ENGINE_SWITCH_18': 'verbose-logging=true',
'FLUTTER_ENGINE_SWITCHES': '18',
}
),
]);
@@ -190,7 +189,6 @@ void main() {
purgePersistentCache: true,
useTestFonts: true,
verboseSystemLogs: true,
nullAssertions: true,
),
);

View File

@@ -701,11 +701,9 @@ void main() {
});
});
testWithoutContext('computeDartVmFlags handles various combinations of Dart VM flags and null_assertions', () {
testWithoutContext('computeDartVmFlags handles various combinations of Dart VM flags', () {
expect(computeDartVmFlags(DebuggingOptions.enabled(BuildInfo.debug)), '');
expect(computeDartVmFlags(DebuggingOptions.enabled(BuildInfo.debug, dartFlags: '--foo')), '--foo');
expect(computeDartVmFlags(DebuggingOptions.enabled(BuildInfo.debug, nullAssertions: true)), '--null_assertions');
expect(computeDartVmFlags(DebuggingOptions.enabled(BuildInfo.debug, dartFlags: '--foo', nullAssertions: true)), '--foo,--null_assertions');
});
group('JSON encode DebuggingOptions', () {
@@ -757,7 +755,6 @@ void main() {
cacheSkSL: true,
purgePersistentCache: true,
verboseSystemLogs: true,
nullAssertions: true,
enableImpeller: true,
deviceVmServicePort: 0,
hostVmServicePort: 1,
@@ -778,7 +775,7 @@ void main() {
'--disable-service-auth-codes',
'--disable-vm-service-publication',
'--start-paused',
'--dart-flags="--foo,--null_assertions"',
'--dart-flags="--foo"',
'--use-test-fonts',
'--enable-checked-mode',
'--verify-entry-points',
@@ -917,7 +914,6 @@ void main() {
cacheSkSL: true,
purgePersistentCache: true,
verboseSystemLogs: true,
nullAssertions: true,
enableImpeller: true,
deviceVmServicePort: 0,
hostVmServicePort: 1,
@@ -938,7 +934,7 @@ void main() {
'--disable-service-auth-codes',
'--disable-vm-service-publication',
'--start-paused',
'--dart-flags=--foo,--null_assertions',
'--dart-flags=--foo',
'--use-test-fonts',
'--enable-checked-mode',
'--verify-entry-points',

View File

@@ -337,7 +337,7 @@ void main() {
'--disable-service-auth-codes',
'--disable-vm-service-publication',
'--start-paused',
'--dart-flags="--foo,--null_assertions"',
'--dart-flags="--foo"',
'--use-test-fonts',
'--enable-checked-mode',
'--verify-entry-points',
@@ -404,7 +404,6 @@ void main() {
cacheSkSL: true,
purgePersistentCache: true,
verboseSystemLogs: true,
nullAssertions: true,
enableImpeller: true,
enableEmbedderApi: true,
),

View File

@@ -1041,7 +1041,6 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
cacheSkSL: true,
purgePersistentCache: true,
dartFlags: '--baz',
nullAssertions: true,
enableImpeller: true,
hostVmServicePort: 0,
);
@@ -1065,7 +1064,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
'--verbose-logging',
'--cache-sksl',
'--purge-persistent-cache',
'--dart-flags=--baz,--null_assertions',
'--dart-flags=--baz',
'--enable-impeller',
'--vm-service-port=0',
]));

View File

@@ -2,10 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/doctor_validator.dart';
import 'package:flutter_tools/src/reporting/reporting.dart';
import 'package:package_config/package_config.dart';
import '../../src/common.dart';
@@ -56,74 +54,6 @@ void main() {
const TestUsageEvent('doctor-result', 'FakeGroupedValidator', label: 'crash'),
));
});
testWithoutContext('Reports null safe analytics events', () {
final TestUsage usage = TestUsage();
final PackageConfig packageConfig = PackageConfig(<Package>[
Package('foo', Uri.parse('file:///foo/'), languageVersion: LanguageVersion(2, 12)),
Package('bar', Uri.parse('file:///fizz/'), languageVersion: LanguageVersion(2, 1)),
Package('baz', Uri.parse('file:///bar/'), languageVersion: LanguageVersion(2, 2)),
]);
NullSafetyAnalysisEvent(
packageConfig,
NullSafetyMode.sound,
'foo',
usage,
).send();
expect(usage.events, unorderedEquals(<TestUsageEvent>[
const TestUsageEvent(NullSafetyAnalysisEvent.kNullSafetyCategory, 'runtime-mode', label: 'NullSafetyMode.sound'),
TestUsageEvent(NullSafetyAnalysisEvent.kNullSafetyCategory, 'stats', parameters: CustomDimensions.fromMap(<String, String>{
'cd49': '1', 'cd50': '3',
})),
const TestUsageEvent(NullSafetyAnalysisEvent.kNullSafetyCategory, 'language-version', label: '2.12'),
]));
});
testWithoutContext('Does not crash if main package is missing', () {
final TestUsage usage = TestUsage();
final PackageConfig packageConfig = PackageConfig(<Package>[
Package('foo', Uri.parse('file:///foo/lib/'), languageVersion: LanguageVersion(2, 12)),
Package('bar', Uri.parse('file:///fizz/lib/'), languageVersion: LanguageVersion(2, 1)),
Package('baz', Uri.parse('file:///bar/lib/'), languageVersion: LanguageVersion(2, 2)),
]);
NullSafetyAnalysisEvent(
packageConfig,
NullSafetyMode.sound,
'something-unrelated',
usage,
).send();
expect(usage.events, unorderedEquals(<TestUsageEvent>[
const TestUsageEvent(NullSafetyAnalysisEvent.kNullSafetyCategory, 'runtime-mode', label: 'NullSafetyMode.sound'),
TestUsageEvent(NullSafetyAnalysisEvent.kNullSafetyCategory, 'stats', parameters: CustomDimensions.fromMap(<String, String>{
'cd49': '1', 'cd50': '3',
})),
]));
});
testWithoutContext('a null language version is treated as unmigrated', () {
final TestUsage usage = TestUsage();
final PackageConfig packageConfig = PackageConfig(<Package>[
Package('foo', Uri.parse('file:///foo/lib/')),
]);
NullSafetyAnalysisEvent(
packageConfig,
NullSafetyMode.sound,
'something-unrelated',
usage,
).send();
expect(usage.events, unorderedEquals(<TestUsageEvent>[
const TestUsageEvent(NullSafetyAnalysisEvent.kNullSafetyCategory, 'runtime-mode', label: 'NullSafetyMode.sound'),
TestUsageEvent(NullSafetyAnalysisEvent.kNullSafetyCategory, 'stats', parameters: CustomDimensions.fromMap(<String, String>{
'cd49': '0', 'cd50': '1',
})),
]));
});
}
class FakeGroupedValidator extends GroupedValidator {

View File

@@ -1960,45 +1960,13 @@ flutter:
BuildMode.debug,
'',
treeShakeIcons: false,
nullSafetyMode: NullSafetyMode.unsound,
),
target: null,
platform: FakePlatform(),
)).generator as DefaultResidentCompiler?;
expect(residentCompiler!.initializeFromDill,
globals.fs.path.join(getBuildDirectory(), 'fbbe6a61fb7a1de317d381f8df4814e5.cache.dill'));
expect(residentCompiler.librariesSpec,
globals.fs.file(globals.artifacts!.getHostArtifact(HostArtifact.flutterWebLibrariesJson))
.uri.toString());
expect(residentCompiler.targetModel, TargetModel.dartdevc);
expect(residentCompiler.sdkRoot,
'${globals.artifacts!.getHostArtifact(HostArtifact.flutterWebSdk).path}/');
expect(residentCompiler.platformDill, 'file:///HostArtifact.webPlatformKernelFolder/ddc_outline.dill');
}, overrides: <Type, Generator>{
Artifacts: () => Artifacts.test(),
FileSystem: () => MemoryFileSystem.test(),
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('FlutterDevice uses dartdevc configuration when targeting web with null-safety autodetected', () async {
fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[]);
final FakeDevice device = FakeDevice(targetPlatform: TargetPlatform.web_javascript);
final DefaultResidentCompiler? residentCompiler = (await FlutterDevice.create(
device,
buildInfo: const BuildInfo(
BuildMode.debug,
'',
treeShakeIcons: false,
extraFrontEndOptions: <String>['--enable-experiment=non-nullable'],
),
target: null,
platform: FakePlatform(),
)).generator as DefaultResidentCompiler?;
expect(residentCompiler!.initializeFromDill,
globals.fs.path.join(getBuildDirectory(), '80b1a4cf4e7b90e1ab5f72022a0bc624.cache.dill'));
globals.fs.path.join(getBuildDirectory(), 'cache.dill'));
expect(residentCompiler.librariesSpec,
globals.fs.file(globals.artifacts!.getHostArtifact(HostArtifact.flutterWebLibrariesJson))
.uri.toString());

View File

@@ -497,82 +497,6 @@ void main() {
));
});
testUsingContext('reports null safety analytics when reportNullSafety is true', () async {
globals.fs.file('lib/main.dart')
..createSync(recursive: true)
..writeAsStringSync('// @dart=2.12');
globals.fs.file('pubspec.yaml')
.writeAsStringSync('name: example\n');
globals.fs.file('.dart_tool/package_config.json')
..createSync(recursive: true)
..writeAsStringSync(r'''
{
"configVersion": 2,
"packages": [
{
"name": "example",
"rootUri": "../",
"packageUri": "lib/",
"languageVersion": "2.12"
}
],
"generated": "2020-12-02T19:30:53.862346Z",
"generator": "pub",
"generatorVersion": "2.12.0-76.0.dev"
}
''');
final FakeReportingNullSafetyCommand command = FakeReportingNullSafetyCommand();
final CommandRunner<void> runner = createTestCommandRunner(command);
await runner.run(<String>['test']);
expect(usage.events, containsAll(<TestUsageEvent>[
const TestUsageEvent(
NullSafetyAnalysisEvent.kNullSafetyCategory,
'runtime-mode',
label: 'NullSafetyMode.sound',
),
TestUsageEvent(
NullSafetyAnalysisEvent.kNullSafetyCategory,
'stats',
parameters: CustomDimensions.fromMap(<String, String>{
'cd49': '1', 'cd50': '1',
}),
),
const TestUsageEvent(
NullSafetyAnalysisEvent.kNullSafetyCategory,
'language-version',
label: '2.12',
),
]));
}, overrides: <Type, Generator>{
Pub: () => FakePub(),
Usage: () => usage,
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('tool exits on non-sound-null-safe code when explicit flag not passed', () async {
final DummyFlutterCommand flutterCommand = DummyFlutterCommand(packagesPath: 'foo');
flutterCommand.argParser
..addFlag(FlutterOptions.kNullSafety, defaultsTo: true)
..addOption('target');
final File targetFile = fileSystem.file('targetFile.dart')
..writeAsStringSync('// @dart = 2.11');
expect(
() async => flutterCommand.getBuildInfo(
forcedBuildMode: BuildMode.debug,
forcedTargetFile: targetFile,
),
throwsToolExit(
message: 'This application does not support sound null-safety (its language version is 2.11)',
),
);
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
});
testUsingContext('use packagesPath to generate BuildInfo', () async {
final DummyFlutterCommand flutterCommand = DummyFlutterCommand(packagesPath: 'foo');
final BuildInfo buildInfo = await flutterCommand.getBuildInfo(forcedBuildMode: BuildMode.debug);
@@ -777,9 +701,6 @@ class FakeReportingNullSafetyCommand extends FlutterCommand {
@override
bool get shouldRunPub => true;
@override
bool get reportNullSafety => true;
@override
Future<FlutterCommandResult> runCommand() async {
return FlutterCommandResult.success();

View File

@@ -35,7 +35,7 @@ void main() {
platform: platform,
);
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
FakeCommand(command: <Pattern>[
const FakeCommand(command: <String>[
'Artifact.engineDartBinary.TargetPlatform.web_javascript',
'--disable-dart-dev',
'Artifact.frontendServerSnapshotForEngineDartSdk.TargetPlatform.web_javascript',
@@ -58,11 +58,10 @@ void main() {
'--filesystem-scheme',
'org-dartlang-app',
'--initialize-from-dill',
RegExp(r'^build\/(?:[a-z0-9]{32})\.cache\.dill$'),
r'build/cache.dill',
'--platform',
'file:///HostArtifact.webPlatformKernelFolder/ddc_outline_sound.dill',
'--verbosity=error',
'--sound-null-safety'
], stdout: 'result abc\nline0\nline1\nabc\nabc build/out 0')
]);
final WebTestCompiler compiler = WebTestCompiler(

View File

@@ -49,7 +49,6 @@ void main() {
test('generateMainModule removes timeout from requireJS', () {
final String result = generateMainModule(
entrypoint: 'foo/bar/main.js',
nullAssertions: false,
nativeNullAssertions: false,
);
@@ -65,7 +64,6 @@ void main() {
test('generateMainModule embeds urls correctly', () {
final String result = generateMainModule(
entrypoint: 'foo/bar/main.js',
nullAssertions: false,
nativeNullAssertions: false,
);
// bootstrap main module has correct defined module.
@@ -76,7 +74,6 @@ void main() {
test('generateMainModule can set bootstrap name', () {
final String result = generateMainModule(
entrypoint: 'foo/bar/main.js',
nullAssertions: false,
nativeNullAssertions: false,
bootstrapModule: 'foo_module.bootstrap',
);
@@ -88,22 +85,18 @@ void main() {
test('generateMainModule includes null safety switches', () {
final String result = generateMainModule(
entrypoint: 'foo/bar/main.js',
nullAssertions: true,
nativeNullAssertions: true,
);
expect(result, contains('''dart_sdk.dart.nonNullAsserts(true);'''));
expect(result, contains('''dart_sdk.dart.nativeNonNullAsserts(true);'''));
});
test('generateMainModule can disable null safety switches', () {
final String result = generateMainModule(
entrypoint: 'foo/bar/main.js',
nullAssertions: false,
nativeNullAssertions: false,
);
expect(result, contains('''dart_sdk.dart.nonNullAsserts(false);'''));
expect(result, contains('''dart_sdk.dart.nativeNonNullAsserts(false);'''));
});

View File

@@ -65,7 +65,6 @@ void main() {
InternetAddress.loopbackIPv4,
<String, String>{},
<String, String>{},
NullSafetyMode.unsound,
);
releaseAssetServer = ReleaseAssetServer(
globals.fs.file('main.dart').uri,
@@ -290,7 +289,6 @@ void main() {
InternetAddress.loopbackIPv4,
<String, String>{},
<String, String>{},
NullSafetyMode.unsound,
);
expect(webAssetServer.basePath, 'foo/bar');
@@ -309,7 +307,6 @@ void main() {
InternetAddress.loopbackIPv4,
<String, String>{},
<String, String>{},
NullSafetyMode.unsound,
);
// Defaults to "/" when there's no base element.
@@ -330,7 +327,6 @@ void main() {
InternetAddress.loopbackIPv4,
<String, String>{},
<String, String>{},
NullSafetyMode.unsound,
),
throwsToolExit(),
);
@@ -350,7 +346,6 @@ void main() {
InternetAddress.loopbackIPv4,
<String, String>{},
<String, String>{},
NullSafetyMode.unsound,
),
throwsToolExit(),
);
@@ -666,13 +661,11 @@ void main() {
useSseForDebugProxy: true,
useSseForDebugBackend: true,
useSseForInjectedClient: true,
nullAssertions: true,
nativeNullAssertions: true,
buildInfo: const BuildInfo(
BuildMode.debug,
'',
treeShakeIcons: false,
nullSafetyMode: NullSafetyMode.unsound,
),
enableDwds: false,
enableDds: false,
@@ -680,7 +673,6 @@ void main() {
testMode: true,
expressionCompiler: null, // ignore: avoid_redundant_argument_values
chromiumLauncher: null, // ignore: avoid_redundant_argument_values
nullSafetyMode: NullSafetyMode.unsound,
);
webDevFS.requireJS.createSync(recursive: true);
webDevFS.stackTraceMapper.createSync(recursive: true);
@@ -688,13 +680,13 @@ void main() {
final Uri uri = await webDevFS.create();
webDevFS.webAssetServer.entrypointCacheDirectory = globals.fs.currentDirectory;
final String webPrecompiledSdk = globals.artifacts!
.getHostArtifact(HostArtifact.webPrecompiledSdk).path;
.getHostArtifact(HostArtifact.webPrecompiledSoundSdk).path;
final String webPrecompiledSdkSourcemaps = globals.artifacts!
.getHostArtifact(HostArtifact.webPrecompiledSdkSourcemaps).path;
.getHostArtifact(HostArtifact.webPrecompiledSoundSdkSourcemaps).path;
final String webPrecompiledCanvaskitSdk = globals.artifacts!
.getHostArtifact(HostArtifact.webPrecompiledCanvaskitSdk).path;
.getHostArtifact(HostArtifact.webPrecompiledCanvaskitSoundSdk).path;
final String webPrecompiledCanvaskitSdkSourcemaps = globals.artifacts!
.getHostArtifact(HostArtifact.webPrecompiledCanvaskitSdkSourcemaps).path;
.getHostArtifact(HostArtifact.webPrecompiledCanvaskitSoundSdkSourcemaps).path;
globals.fs.currentDirectory
.childDirectory('lib')
.childFile('web_entrypoint.dart')
@@ -779,7 +771,6 @@ void main() {
useSseForDebugProxy: true,
useSseForDebugBackend: true,
useSseForInjectedClient: true,
nullAssertions: true,
nativeNullAssertions: true,
buildInfo: const BuildInfo(
BuildMode.debug,
@@ -792,7 +783,6 @@ void main() {
testMode: true,
expressionCompiler: null, // ignore: avoid_redundant_argument_values
chromiumLauncher: null, // ignore: avoid_redundant_argument_values
nullSafetyMode: NullSafetyMode.sound,
);
webDevFS.requireJS.createSync(recursive: true);
webDevFS.stackTraceMapper.createSync(recursive: true);
@@ -888,7 +878,6 @@ void main() {
useSseForDebugProxy: true,
useSseForDebugBackend: true,
useSseForInjectedClient: true,
nullAssertions: true,
nativeNullAssertions: true,
buildInfo: const BuildInfo(
BuildMode.debug,
@@ -901,7 +890,6 @@ void main() {
testMode: true,
expressionCompiler: null,
chromiumLauncher: null,
nullSafetyMode: NullSafetyMode.sound,
);
webDevFS.requireJS.createSync(recursive: true);
webDevFS.stackTraceMapper.createSync(recursive: true);
@@ -957,9 +945,7 @@ void main() {
testMode: true,
expressionCompiler: null, // ignore: avoid_redundant_argument_values
chromiumLauncher: null, // ignore: avoid_redundant_argument_values
nullAssertions: true,
nativeNullAssertions: true,
nullSafetyMode: NullSafetyMode.sound,
);
webDevFS.requireJS.createSync(recursive: true);
webDevFS.stackTraceMapper.createSync(recursive: true);
@@ -985,7 +971,6 @@ void main() {
useSseForDebugProxy: true,
useSseForDebugBackend: true,
useSseForInjectedClient: true,
nullAssertions: true,
nativeNullAssertions: true,
buildInfo: const BuildInfo(
BuildMode.debug,
@@ -1001,7 +986,6 @@ void main() {
testMode: true,
expressionCompiler: null, // ignore: avoid_redundant_argument_values
chromiumLauncher: null, // ignore: avoid_redundant_argument_values
nullSafetyMode: NullSafetyMode.sound,
);
webDevFS.requireJS.createSync(recursive: true);
webDevFS.stackTraceMapper.createSync(recursive: true);
@@ -1028,7 +1012,6 @@ void main() {
useSseForDebugProxy: true,
useSseForDebugBackend: true,
useSseForInjectedClient: true,
nullAssertions: true,
nativeNullAssertions: true,
buildInfo: const BuildInfo(
BuildMode.debug,
@@ -1044,7 +1027,6 @@ void main() {
testMode: true,
expressionCompiler: null, // ignore: avoid_redundant_argument_values
chromiumLauncher: null, // ignore: avoid_redundant_argument_values
nullSafetyMode: NullSafetyMode.sound,
);
webDevFS.requireJS.createSync(recursive: true);
webDevFS.stackTraceMapper.createSync(recursive: true);
@@ -1074,7 +1056,6 @@ void main() {
false,
Uri.base,
null,
NullSafetyMode.unsound,
testMode: true);
expect(webAssetServer.defaultResponseHeaders['x-frame-options'], null);
@@ -1108,7 +1089,6 @@ void main() {
InternetAddress.anyIPv4,
<String, String>{},
<String, String>{},
NullSafetyMode.sound,
);
expect(await webAssetServer.metadataContents('foo/main_module.ddc_merged_metadata'), null);
@@ -1138,7 +1118,6 @@ void main() {
useSseForDebugProxy: true,
useSseForDebugBackend: true,
useSseForInjectedClient: true,
nullAssertions: true,
nativeNullAssertions: true,
buildInfo: BuildInfo.debug,
enableDwds: false,
@@ -1147,7 +1126,6 @@ void main() {
testMode: true,
expressionCompiler: null, // ignore: avoid_redundant_argument_values
chromiumLauncher: null, // ignore: avoid_redundant_argument_values
nullSafetyMode: NullSafetyMode.unsound,
);
webDevFS.requireJS.createSync(recursive: true);
webDevFS.stackTraceMapper.createSync(recursive: true);

View File

@@ -4,7 +4,6 @@
import 'package:file/memory.dart';
import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/build_system/build_system.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/commands/build.dart';
@@ -50,7 +49,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: buildSystem,
fileSystem: fileSystem,
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
))
.run(<String>['build', 'web', '--no-pub']);
@@ -73,7 +71,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: buildSystem,
fileSystem: fileSystem,
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
))
.run(<String>['build', 'web', '--no-pub']);
@@ -95,7 +92,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: buildSystem,
fileSystem: fileSystem,
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
))
.run(<String>['build', 'web', '--no-pub']);
@@ -116,7 +112,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: buildSystem,
fileSystem: fileSystem,
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
))
.run(<String>['build', 'web', '--no-pub']);
@@ -139,7 +134,6 @@ void main() {
androidSdk: FakeAndroidSdk(),
buildSystem: buildSystem,
fileSystem: fileSystem,
logger: BufferLogger.test(),
osUtils: FakeOperatingSystemUtils(),
))
.run(<String>['build', 'web', '--no-pub']);

View File

@@ -1,83 +0,0 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:file/file.dart';
import 'package:flutter_tools/src/base/io.dart';
import '../src/common.dart';
import 'test_utils.dart';
void main() {
late Directory tempDir;
late Directory projectRoot;
late String flutterBin;
final List<String> targetPlatforms = <String>[
'apk',
'web',
if (platform.isWindows) 'windows',
if (platform.isMacOS) ...<String>['macos', 'ios'],
];
setUpAll(() {
tempDir = createResolvedTempDirectorySync('build_null_unsafe_test.');
flutterBin = fileSystem.path.join(
getFlutterRoot(),
'bin',
'flutter',
);
processManager.runSync(<String>[
flutterBin,
'config',
'--enable-macos-desktop',
'--enable-windows-desktop',
'--enable-web',
]);
processManager.runSync(<String>[
flutterBin,
...getLocalEngineArguments(),
'create',
'hello',
], workingDirectory: tempDir.path);
projectRoot = tempDir.childDirectory('hello');
writeFile(fileSystem.path.join(projectRoot.path, 'pubspec.yaml'), '''
name: hello
environment:
sdk: '>=2.12.0 <4.0.0'
''');
writeFile(fileSystem.path.join(projectRoot.path, 'lib', 'main.dart'), '''
import 'unsafe.dart';
void main() {
print(unsafeString);
}
''');
writeFile(fileSystem.path.join(projectRoot.path, 'lib', 'unsafe.dart'), '''
// @dart=2.9
String unsafeString = null;
''');
});
tearDownAll(() {
tryToDelete(tempDir);
});
for (final String targetPlatform in targetPlatforms) {
testWithoutContext('flutter build $targetPlatform --no-sound-null-safety', () {
final ProcessResult result = processManager.runSync(<String>[
flutterBin,
...getLocalEngineArguments(),
'build',
targetPlatform,
'--no-pub',
'--no-sound-null-safety',
if (targetPlatform == 'ios') '--no-codesign',
], workingDirectory: projectRoot.path);
if (result.exitCode != 0) {
fail('build --no-sound-null-safety failed: ${result.exitCode}\n${result.stderr}\n${result.stdout}');
}
});
}
}