Change some required nullable parameters in tool to non-null (#114115)
This commit is contained in:
parent
48457d736b
commit
c1d2b854ef
@ -14,7 +14,7 @@ import '../runner/flutter_command.dart';
|
||||
class PrecacheCommand extends FlutterCommand {
|
||||
PrecacheCommand({
|
||||
bool verboseHelp = false,
|
||||
required Cache? cache,
|
||||
required Cache cache,
|
||||
required Platform platform,
|
||||
required Logger logger,
|
||||
required FeatureFlags featureFlags,
|
||||
@ -58,7 +58,7 @@ class PrecacheCommand extends FlutterCommand {
|
||||
help: 'Precache the unsigned macOS binaries when available.', hide: !verboseHelp);
|
||||
}
|
||||
|
||||
final Cache? _cache;
|
||||
final Cache _cache;
|
||||
final Logger _logger;
|
||||
final Platform _platform;
|
||||
final FeatureFlags _featureFlags;
|
||||
@ -133,21 +133,21 @@ class PrecacheCommand extends FlutterCommand {
|
||||
Future<FlutterCommandResult> runCommand() async {
|
||||
// Re-lock the cache.
|
||||
if (_platform.environment['FLUTTER_ALREADY_LOCKED'] != 'true') {
|
||||
await _cache!.lock();
|
||||
await _cache.lock();
|
||||
}
|
||||
if (boolArgDeprecated('force')) {
|
||||
_cache!.clearStampFiles();
|
||||
_cache.clearStampFiles();
|
||||
}
|
||||
|
||||
final bool includeAllPlatforms = boolArgDeprecated('all-platforms');
|
||||
if (includeAllPlatforms) {
|
||||
_cache!.includeAllPlatforms = true;
|
||||
_cache.includeAllPlatforms = true;
|
||||
}
|
||||
if (boolArgDeprecated('use-unsigned-mac-binaries')) {
|
||||
_cache!.useUnsignedMacBinaries = true;
|
||||
_cache.useUnsignedMacBinaries = true;
|
||||
}
|
||||
final Set<String> explicitlyEnabled = _explicitArtifactSelections();
|
||||
_cache!.platformOverrideArtifacts = explicitlyEnabled;
|
||||
_cache.platformOverrideArtifacts = explicitlyEnabled;
|
||||
|
||||
// If the user did not provide any artifact flags, then download
|
||||
// all artifacts that correspond to an enabled platform.
|
||||
@ -164,8 +164,8 @@ class PrecacheCommand extends FlutterCommand {
|
||||
requiredArtifacts.add(artifact);
|
||||
}
|
||||
}
|
||||
if (!await _cache!.isUpToDate()) {
|
||||
await _cache!.updateAll(requiredArtifacts);
|
||||
if (!await _cache.isUpToDate()) {
|
||||
await _cache.updateAll(requiredArtifacts);
|
||||
} else {
|
||||
_logger.printStatus('Already up-to-date.');
|
||||
}
|
||||
|
@ -97,17 +97,13 @@ final RegExp _certificateOrganizationalUnitExtractionPattern = RegExp(r'OU=([a-z
|
||||
/// Will return null if none are found, if the user cancels or if the Xcode
|
||||
/// project has a development team set in the project's build settings.
|
||||
Future<Map<String, String>?> getCodeSigningIdentityDevelopmentTeamBuildSetting({
|
||||
required Map<String, String>? buildSettings,
|
||||
required Map<String, String> buildSettings,
|
||||
required ProcessManager processManager,
|
||||
required Platform platform,
|
||||
required Logger logger,
|
||||
required Config config,
|
||||
required Terminal terminal,
|
||||
}) async {
|
||||
if (buildSettings == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// If the user already has it set in the project build settings itself,
|
||||
// continue with that.
|
||||
if (_isNotEmpty(buildSettings[_developmentTeamBuildSettingName])) {
|
||||
|
@ -83,11 +83,11 @@ const String _kDefaultIndex = '''
|
||||
/// This is only used in development mode.
|
||||
class WebExpressionCompiler implements ExpressionCompiler {
|
||||
WebExpressionCompiler(this._generator, {
|
||||
required FileSystem? fileSystem,
|
||||
required FileSystem fileSystem,
|
||||
}) : _fileSystem = fileSystem;
|
||||
|
||||
final ResidentCompiler _generator;
|
||||
final FileSystem? _fileSystem;
|
||||
final FileSystem _fileSystem;
|
||||
|
||||
@override
|
||||
Future<ExpressionCompilationResult> compileExpressionToJs(
|
||||
@ -106,7 +106,7 @@ class WebExpressionCompiler implements ExpressionCompiler {
|
||||
|
||||
if (compilerOutput != null && compilerOutput.outputFilename != null) {
|
||||
final String content = utf8.decode(
|
||||
_fileSystem!.file(compilerOutput.outputFilename).readAsBytesSync());
|
||||
_fileSystem.file(compilerOutput.outputFilename).readAsBytesSync());
|
||||
return ExpressionCompilationResult(
|
||||
content, compilerOutput.errorCount > 0);
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ class TestGoldenComparator {
|
||||
TestGoldenComparator(this.shellPath, this.compilerFactory, {
|
||||
required Logger logger,
|
||||
required FileSystem fileSystem,
|
||||
required ProcessManager? processManager,
|
||||
required ProcessManager processManager,
|
||||
required this.webRenderer,
|
||||
}) : tempDir = fileSystem.systemTempDirectory.createTempSync('flutter_web_platform.'),
|
||||
_logger = logger,
|
||||
@ -39,7 +39,7 @@ class TestGoldenComparator {
|
||||
final TestCompiler Function() compilerFactory;
|
||||
final Logger _logger;
|
||||
final FileSystem _fileSystem;
|
||||
final ProcessManager? _processManager;
|
||||
final ProcessManager _processManager;
|
||||
final WebRendererMode webRenderer;
|
||||
|
||||
TestCompiler? _compiler;
|
||||
@ -95,7 +95,7 @@ class TestGoldenComparator {
|
||||
'FLUTTER_TEST_BROWSER': 'chrome',
|
||||
'FLUTTER_WEB_RENDERER': webRenderer == WebRendererMode.html ? 'html' : 'canvaskit',
|
||||
};
|
||||
return _processManager!.start(command, environment: environment);
|
||||
return _processManager.start(command, environment: environment);
|
||||
}
|
||||
|
||||
Future<String?> compareGoldens(Uri testUri, Uint8List bytes, Uri goldenKey, bool? updateGoldens) async {
|
||||
|
@ -39,7 +39,7 @@ void main() {
|
||||
|
||||
testWithoutContext('No auto-sign if Xcode project settings are not available', () async {
|
||||
final Map<String, String>? signingConfigs = await getCodeSigningIdentityDevelopmentTeamBuildSetting(
|
||||
buildSettings: null,
|
||||
buildSettings: <String, String>{},
|
||||
processManager: FakeProcessManager.empty(),
|
||||
platform: macosPlatform,
|
||||
logger: logger,
|
||||
|
Loading…
x
Reference in New Issue
Block a user