[flutter_tools] Remove sound null safety flag #2
This commit is contained in:
committed by
GitHub
parent
484c22682b
commit
f4c3facfdd
@@ -119,8 +119,6 @@ class FlutterTesterTestDevice extends TestDevice {
|
||||
'--packages=${debuggingOptions.buildInfo.packagesPath}',
|
||||
if (testAssetDirectory != null)
|
||||
'--flutter-assets-dir=$testAssetDirectory',
|
||||
if (debuggingOptions.nullAssertions)
|
||||
'--dart-flags=--null_assertions',
|
||||
...debuggingOptions.dartEntrypointArgs,
|
||||
entrypointPath,
|
||||
];
|
||||
|
||||
@@ -42,7 +42,6 @@ class FlutterWebPlatform extends PlatformPlugin {
|
||||
FlutterProject? flutterProject,
|
||||
String? shellPath,
|
||||
this.updateGoldens,
|
||||
this.nullAssertions,
|
||||
required this.buildInfo,
|
||||
required this.webMemoryFS,
|
||||
required FileSystem fileSystem,
|
||||
@@ -92,7 +91,6 @@ class FlutterWebPlatform extends PlatformPlugin {
|
||||
final Logger _logger;
|
||||
final Artifacts? _artifacts;
|
||||
final bool? updateGoldens;
|
||||
final bool? nullAssertions;
|
||||
final OneOffHandler _webSocketHandler = OneOffHandler();
|
||||
final AsyncMemoizer<void> _closeMemo = AsyncMemoizer<void>();
|
||||
final String _root;
|
||||
@@ -110,7 +108,6 @@ class FlutterWebPlatform extends PlatformPlugin {
|
||||
String? shellPath,
|
||||
bool updateGoldens = false,
|
||||
bool pauseAfterLoad = false,
|
||||
bool nullAssertions = false,
|
||||
required BuildInfo buildInfo,
|
||||
required WebMemoryFS webMemoryFS,
|
||||
required FileSystem fileSystem,
|
||||
@@ -145,7 +142,6 @@ class FlutterWebPlatform extends PlatformPlugin {
|
||||
chromiumLauncher: chromiumLauncher,
|
||||
artifacts: artifacts,
|
||||
logger: logger,
|
||||
nullAssertions: nullAssertions,
|
||||
processManager: processManager,
|
||||
testTimeRecorder: testTimeRecorder,
|
||||
);
|
||||
@@ -162,12 +158,6 @@ class FlutterWebPlatform extends PlatformPlugin {
|
||||
: WebRendererMode.html;
|
||||
}
|
||||
|
||||
NullSafetyMode get _nullSafetyMode {
|
||||
return buildInfo.nullSafetyMode == NullSafetyMode.sound
|
||||
? NullSafetyMode.sound
|
||||
: NullSafetyMode.unsound;
|
||||
}
|
||||
|
||||
final Configuration _config;
|
||||
final shelf.Server _server;
|
||||
Uri get url => _server.url;
|
||||
@@ -200,10 +190,10 @@ class FlutterWebPlatform extends PlatformPlugin {
|
||||
));
|
||||
|
||||
File get _dartSdk => _fileSystem.file(
|
||||
_artifacts!.getHostArtifact(kDartSdkJsArtifactMap[_rendererMode]![_nullSafetyMode]!));
|
||||
_artifacts!.getHostArtifact(kDartSdkJsArtifactMap[_rendererMode]!));
|
||||
|
||||
File get _dartSdkSourcemaps => _fileSystem.file(
|
||||
_artifacts!.getHostArtifact(kDartSdkJsMapArtifactMap[_rendererMode]![_nullSafetyMode]!));
|
||||
_artifacts!.getHostArtifact(kDartSdkJsMapArtifactMap[_rendererMode]!));
|
||||
|
||||
/// The precompiled test javascript.
|
||||
File get _testDartJs => _fileSystem.file(_fileSystem.path.join(
|
||||
@@ -244,7 +234,6 @@ class FlutterWebPlatform extends PlatformPlugin {
|
||||
final String leadingPath = request.url.path.split('.dart.bootstrap.js')[0];
|
||||
final String generatedFile = '${_fileSystem.path.split(leadingPath).join('_')}.dart.test.dart.js';
|
||||
return shelf.Response.ok(generateMainModule(
|
||||
nullAssertions: nullAssertions!,
|
||||
nativeNullAssertions: true,
|
||||
bootstrapModule: '${_fileSystem.path.basename(leadingPath)}.dart.bootstrap',
|
||||
entrypoint: '/$generatedFile'
|
||||
|
||||
@@ -161,7 +161,6 @@ class _FlutterTestRunnerImpl implements FlutterTestRunner {
|
||||
shellPath: shellPath,
|
||||
flutterProject: flutterProject,
|
||||
pauseAfterLoad: debuggingOptions.startPaused,
|
||||
nullAssertions: debuggingOptions.nullAssertions,
|
||||
buildInfo: debuggingOptions.buildInfo,
|
||||
webMemoryFS: result,
|
||||
logger: globals.logger,
|
||||
|
||||
@@ -49,24 +49,9 @@ class WebTestCompiler {
|
||||
required List<String> testFiles,
|
||||
required BuildInfo buildInfo,
|
||||
}) async {
|
||||
LanguageVersion languageVersion = LanguageVersion(2, 8);
|
||||
late final String platformDillName;
|
||||
|
||||
// TODO(zanderso): to support autodetect this would need to partition the source code into
|
||||
// a sound and unsound set and perform separate compilations
|
||||
final List<String> extraFrontEndOptions = List<String>.of(buildInfo.extraFrontEndOptions);
|
||||
if (buildInfo.nullSafetyMode == NullSafetyMode.unsound || buildInfo.nullSafetyMode == NullSafetyMode.autodetect) {
|
||||
platformDillName = 'ddc_outline.dill';
|
||||
if (!extraFrontEndOptions.contains('--no-sound-null-safety')) {
|
||||
extraFrontEndOptions.add('--no-sound-null-safety');
|
||||
}
|
||||
} else if (buildInfo.nullSafetyMode == NullSafetyMode.sound) {
|
||||
languageVersion = currentLanguageVersion(_fileSystem, Cache.flutterRoot!);
|
||||
platformDillName = 'ddc_outline_sound.dill';
|
||||
if (!extraFrontEndOptions.contains('--sound-null-safety')) {
|
||||
extraFrontEndOptions.add('--sound-null-safety');
|
||||
}
|
||||
}
|
||||
final LanguageVersion languageVersion = currentLanguageVersion(_fileSystem, Cache.flutterRoot!);
|
||||
const String platformDillName = 'ddc_outline_sound.dill';
|
||||
|
||||
final String platformDillPath = _fileSystem.path.join(
|
||||
getWebPlatformBinariesDirectory(_artifacts, buildInfo.webRenderer).path,
|
||||
|
||||
Reference in New Issue
Block a user