Update for flutter 3.10.0 (#182)
Signed-off-by: Hidenori Matsubayashi <[email protected]>
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
// Copyright 2022 Sony Group Corporation. All rights reserved.
|
||||
// Copyright 2023 Sony Group Corporation. All rights reserved.
|
||||
// Copyright 2020 Samsung Electronics Co., Ltd. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:flutter_tools/src/commands/analyze.dart';
|
||||
import 'package:flutter_tools/src/globals.dart' as globals;
|
||||
import 'package:flutter_tools/src/project_validator.dart';
|
||||
@@ -12,17 +10,23 @@ import 'package:flutter_tools/src/project_validator.dart';
|
||||
import '../elinux_plugins.dart';
|
||||
|
||||
class ELinuxAnalyzeCommand extends AnalyzeCommand with ELinuxExtension {
|
||||
ELinuxAnalyzeCommand({bool verboseHelp = false})
|
||||
ELinuxAnalyzeCommand({super.verboseHelp})
|
||||
: super(
|
||||
verboseHelp: verboseHelp,
|
||||
fileSystem: globals.fs,
|
||||
platform: globals.platform,
|
||||
processManager: globals.processManager,
|
||||
logger: globals.logger,
|
||||
terminal: globals.terminal,
|
||||
artifacts: globals.artifacts,
|
||||
artifacts: globals.artifacts!,
|
||||
// new ProjectValidators should be added here for the --suggestions to run
|
||||
allProjectValidators: <ProjectValidator>[
|
||||
GeneralInfoProjectValidator()
|
||||
GeneralInfoProjectValidator(),
|
||||
VariableDumpMachineProjectValidator(
|
||||
logger: globals.logger,
|
||||
fileSystem: globals.fs,
|
||||
platform: globals.platform,
|
||||
),
|
||||
],
|
||||
suppressAnalytics: globals.flutterUsage.suppressAnalytics,
|
||||
);
|
||||
}
|
||||
|
||||
+4
-10
@@ -3,8 +3,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:flutter_tools/src/android/build_validation.dart' as android;
|
||||
import 'package:flutter_tools/src/base/analyze_size.dart';
|
||||
import 'package:flutter_tools/src/base/common.dart';
|
||||
@@ -57,7 +55,6 @@ class BuildPackageCommand extends BuildSubCommand
|
||||
);
|
||||
argParser.addOption(
|
||||
'target-compiler-triple',
|
||||
defaultsTo: null,
|
||||
help: 'Target compiler triple for which the app is compiled. '
|
||||
'e.g. aarch64-linux-gnu',
|
||||
);
|
||||
@@ -70,12 +67,10 @@ class BuildPackageCommand extends BuildSubCommand
|
||||
);
|
||||
argParser.addOption(
|
||||
'target-toolchain',
|
||||
defaultsTo: null,
|
||||
help: 'The toolchain path for Clang.',
|
||||
);
|
||||
argParser.addOption(
|
||||
'system-include-directories',
|
||||
defaultsTo: null,
|
||||
help:
|
||||
'The additional system include paths to cross-compile for target platform. '
|
||||
'This option is valid only '
|
||||
@@ -83,7 +78,6 @@ class BuildPackageCommand extends BuildSubCommand
|
||||
);
|
||||
argParser.addOption(
|
||||
'target-compiler-flags',
|
||||
defaultsTo: null,
|
||||
help: 'The extra compile flags to be applied to C and C++ compiler',
|
||||
);
|
||||
}
|
||||
@@ -118,7 +112,7 @@ class BuildPackageCommand extends BuildSubCommand
|
||||
@override
|
||||
Future<FlutterCommandResult> runCommand() async {
|
||||
// Not supported cross-building for x64 on arm64.
|
||||
final String targetArch = stringArg('target-arch');
|
||||
final String? targetArch = stringArg('target-arch');
|
||||
final String hostArch = _getCurrentHostPlatformArchName();
|
||||
if (hostArch != targetArch && hostArch == 'arm64') {
|
||||
globals.logger
|
||||
@@ -129,10 +123,10 @@ class BuildPackageCommand extends BuildSubCommand
|
||||
final BuildInfo buildInfo = await getBuildInfo();
|
||||
final ELinuxBuildInfo eLinuxBuildInfo = ELinuxBuildInfo(
|
||||
buildInfo,
|
||||
targetArch: targetArch,
|
||||
targetBackendType: stringArg('target-backend-type'),
|
||||
targetArch: targetArch!,
|
||||
targetBackendType: stringArg('target-backend-type')!,
|
||||
targetCompilerTriple: stringArg('target-compiler-triple'),
|
||||
targetSysroot: stringArg('target-sysroot'),
|
||||
targetSysroot: stringArg('target-sysroot')!,
|
||||
targetCompilerFlags: stringArg('target-compiler-flags'),
|
||||
targetToolchain: stringArg('target-toolchain'),
|
||||
systemIncludeDirectories: stringArg('system-include-directories'),
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// Copyright 2021 Sony Group Corporation. All rights reserved.
|
||||
// Copyright 2023 Sony Group Corporation. All rights reserved.
|
||||
// Copyright 2020 Samsung Electronics Co., Ltd. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:file/file.dart';
|
||||
import 'package:flutter_tools/src/base/logger.dart';
|
||||
import 'package:flutter_tools/src/commands/clean.dart';
|
||||
@@ -16,7 +14,7 @@ import 'package:path/path.dart';
|
||||
import '../elinux_cmake_project.dart';
|
||||
|
||||
class ELinuxCleanCommand extends CleanCommand {
|
||||
ELinuxCleanCommand({bool verbose = false}) : super(verbose: verbose);
|
||||
ELinuxCleanCommand({super.verbose});
|
||||
|
||||
/// See: [CleanCommand.runCommand] in `clean.dart`
|
||||
@override
|
||||
@@ -48,7 +46,7 @@ class ELinuxCleanCommand extends CleanCommand {
|
||||
} on FileSystemException catch (error) {
|
||||
globals.printError('Failed to remove $path: $error');
|
||||
} finally {
|
||||
status?.stop();
|
||||
status.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-13
@@ -1,11 +1,9 @@
|
||||
// Copyright 2022 Sony Group Corporation. All rights reserved.
|
||||
// Copyright 2023 Sony Group Corporation. All rights reserved.
|
||||
// Copyright 2020 Samsung Electronics Co., Ltd. All rights reserved.
|
||||
// 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.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_tools/src/base/common.dart';
|
||||
@@ -30,11 +28,10 @@ const List<String> _kAvailablePlatforms = <String>[
|
||||
];
|
||||
|
||||
class ELinuxCreateCommand extends CreateCommand {
|
||||
ELinuxCreateCommand({bool verboseHelp = false})
|
||||
: super(verboseHelp: verboseHelp);
|
||||
ELinuxCreateCommand({super.verboseHelp});
|
||||
|
||||
@override
|
||||
void addPlatformsOptions({String customHelp}) {
|
||||
void addPlatformsOptions({String? customHelp}) {
|
||||
argParser.addMultiOption(
|
||||
'platforms',
|
||||
help: customHelp,
|
||||
@@ -47,7 +44,7 @@ class ELinuxCreateCommand extends CreateCommand {
|
||||
Future<int> renderTemplate(
|
||||
String templateName,
|
||||
Directory directory,
|
||||
Map<String, Object> context, {
|
||||
Map<String, Object?> context, {
|
||||
bool overwrite = false,
|
||||
bool printStatusWhenWriting = true,
|
||||
}) async {
|
||||
@@ -67,7 +64,7 @@ class ELinuxCreateCommand extends CreateCommand {
|
||||
Future<int> renderMerged(
|
||||
List<String> names,
|
||||
Directory directory,
|
||||
Map<String, Object> context, {
|
||||
Map<String, Object?> context, {
|
||||
bool overwrite = false,
|
||||
bool printStatusWhenWriting = true,
|
||||
}) async {
|
||||
@@ -79,14 +76,14 @@ class ELinuxCreateCommand extends CreateCommand {
|
||||
fileSystem: globals.fs,
|
||||
logger: globals.logger,
|
||||
templateRenderer: globals.templateRenderer,
|
||||
templateManifest: null,
|
||||
templateManifest: <Uri>{},
|
||||
);
|
||||
return template.render(directory, context, overwriteExisting: overwrite);
|
||||
}
|
||||
|
||||
/// See: [CreateCommand._getProjectType] in `create.dart`
|
||||
bool get _shouldGeneratePlugin {
|
||||
if (argResults['template'] != null) {
|
||||
if (argResults!['template'] != null) {
|
||||
return stringArg('template') == 'plugin';
|
||||
} else if (projectDir.existsSync() && projectDir.listSync().isNotEmpty) {
|
||||
return determineTemplateType() == FlutterProjectType.plugin;
|
||||
@@ -114,7 +111,7 @@ class ELinuxCreateCommand extends CreateCommand {
|
||||
// The dart project_name is in snake_case, this variable is the Title Case of the Project Name.
|
||||
final String titleCaseProjectName = snakeCaseToTitleCase(projectName);
|
||||
|
||||
final Map<String, Object> templateContext = createTemplateContext(
|
||||
final Map<String, Object?> templateContext = createTemplateContext(
|
||||
organization: '',
|
||||
projectName: projectName,
|
||||
flutterRoot: '',
|
||||
@@ -140,12 +137,12 @@ class ELinuxCreateCommand extends CreateCommand {
|
||||
/// - [Template.render] in `template.dart`
|
||||
@override
|
||||
Future<FlutterCommandResult> runCommand() async {
|
||||
if (argResults.rest.isEmpty) {
|
||||
if (argResults!.rest.isEmpty) {
|
||||
return super.runCommand();
|
||||
}
|
||||
final List<String> platforms = stringsArg('platforms');
|
||||
bool shouldRenderELinuxTemplate = platforms.contains('elinux');
|
||||
if (_shouldGeneratePlugin && !argResults.wasParsed('platforms')) {
|
||||
if (_shouldGeneratePlugin && !argResults!.wasParsed('platforms')) {
|
||||
shouldRenderELinuxTemplate = false;
|
||||
}
|
||||
if (!shouldRenderELinuxTemplate) {
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:flutter_tools/src/commands/drive.dart';
|
||||
import 'package:flutter_tools/src/globals.dart' as globals;
|
||||
|
||||
@@ -13,9 +11,8 @@ import '../elinux_plugins.dart';
|
||||
|
||||
class ELinuxDriveCommand extends DriveCommand
|
||||
with ELinuxExtension, ELinuxRequiredArtifacts {
|
||||
ELinuxDriveCommand({bool verboseHelp = false})
|
||||
ELinuxDriveCommand({super.verboseHelp})
|
||||
: super(
|
||||
verboseHelp: verboseHelp,
|
||||
fileSystem: globals.fs,
|
||||
logger: globals.logger,
|
||||
platform: globals.platform,
|
||||
|
||||
+20
-21
@@ -1,13 +1,12 @@
|
||||
// Copyright 2021 Sony Group Corporation. All rights reserved.
|
||||
// Copyright 2023 Sony Group Corporation. All rights reserved.
|
||||
// Copyright 2020 Samsung Electronics Co., Ltd. All rights reserved.
|
||||
// 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.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:flutter_tools/src/base/os.dart';
|
||||
import 'package:flutter_tools/src/commands/packages.dart';
|
||||
import 'package:flutter_tools/src/dart/pub.dart';
|
||||
import 'package:flutter_tools/src/globals.dart' as globals;
|
||||
import 'package:flutter_tools/src/project.dart';
|
||||
import 'package:flutter_tools/src/runner/flutter_command.dart';
|
||||
@@ -21,13 +20,18 @@ import '../elinux_plugins.dart';
|
||||
/// Source: [PackagesCommand] in `packages.dart`
|
||||
class ELinuxPackagesCommand extends FlutterCommand {
|
||||
ELinuxPackagesCommand() {
|
||||
addSubcommand(ELinuxPackagesGetCommand('get', false));
|
||||
addSubcommand(ELinuxPackagesInteractiveGetCommand('upgrade',
|
||||
"Upgrade the current package's dependencies to latest versions."));
|
||||
addSubcommand(ELinuxPackagesInteractiveGetCommand(
|
||||
'add', 'Add a dependency to pubspec.yaml.'));
|
||||
addSubcommand(ELinuxPackagesInteractiveGetCommand(
|
||||
'remove', 'Removes a dependency from the current package.'));
|
||||
addSubcommand(ELinuxPackagesGetCommand(
|
||||
'get', "Get the current package's dependencies.", PubContext.pubGet));
|
||||
addSubcommand(ELinuxPackagesGetCommand(
|
||||
'upgrade',
|
||||
"Upgrade the current package's dependencies to latest versions.",
|
||||
PubContext.pubUpgrade));
|
||||
addSubcommand(ELinuxPackagesGetCommand(
|
||||
'add', 'Add a dependency to pubspec.yaml.', PubContext.pubAdd));
|
||||
addSubcommand(ELinuxPackagesGetCommand(
|
||||
'remove',
|
||||
'Removes a dependency from the current package.',
|
||||
PubContext.pubRemove));
|
||||
addSubcommand(PackagesTestCommand());
|
||||
addSubcommand(PackagesForwardCommand(
|
||||
'publish', 'Publish the current package to pub.dartlang.org',
|
||||
@@ -65,18 +69,13 @@ class ELinuxPackagesCommand extends FlutterCommand {
|
||||
final String description = 'Commands for managing Flutter packages.';
|
||||
|
||||
@override
|
||||
Future<FlutterCommandResult> runCommand() async => null;
|
||||
Future<FlutterCommandResult> runCommand() async =>
|
||||
FlutterCommandResult.fail();
|
||||
}
|
||||
|
||||
class ELinuxPackagesGetCommand extends PackagesGetCommand
|
||||
with _PostRunPluginInjection {
|
||||
ELinuxPackagesGetCommand(String name, bool upgrade) : super(name, upgrade);
|
||||
}
|
||||
|
||||
class ELinuxPackagesInteractiveGetCommand extends PackagesInteractiveGetCommand
|
||||
with _PostRunPluginInjection {
|
||||
ELinuxPackagesInteractiveGetCommand(String commandName, String description)
|
||||
: super(commandName, description);
|
||||
ELinuxPackagesGetCommand(super.commandName, super.description, super.context);
|
||||
}
|
||||
|
||||
mixin _PostRunPluginInjection on FlutterCommand {
|
||||
@@ -86,9 +85,9 @@ mixin _PostRunPluginInjection on FlutterCommand {
|
||||
final FlutterCommandResult result = await super.runCommand();
|
||||
|
||||
if (result == FlutterCommandResult.success()) {
|
||||
final String workingDirectory =
|
||||
argResults.rest.isNotEmpty ? argResults.rest[0] : null;
|
||||
final String target = findProjectRoot(globals.fs, workingDirectory);
|
||||
final String? workingDirectory =
|
||||
argResults!.rest.isNotEmpty ? argResults!.rest[0] : null;
|
||||
final String? target = findProjectRoot(globals.fs, workingDirectory);
|
||||
if (target == null) {
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,41 +1,26 @@
|
||||
// Copyright 2021 Sony Group Corporation. All rights reserved.
|
||||
// Copyright 2023 Sony Group Corporation. All rights reserved.
|
||||
// Copyright 2021 Samsung Electronics Co., Ltd. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
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/precache.dart';
|
||||
import 'package:flutter_tools/src/features.dart';
|
||||
import 'package:flutter_tools/src/runner/flutter_command.dart';
|
||||
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
import '../elinux_cache.dart';
|
||||
|
||||
class ELinuxPrecacheCommand extends PrecacheCommand {
|
||||
ELinuxPrecacheCommand({
|
||||
bool verboseHelp = false,
|
||||
@required Cache cache,
|
||||
@required Platform platform,
|
||||
@required Logger logger,
|
||||
@required FeatureFlags featureFlags,
|
||||
super.verboseHelp,
|
||||
required super.cache,
|
||||
required super.platform,
|
||||
required super.logger,
|
||||
required super.featureFlags,
|
||||
}) : _cache = cache,
|
||||
_platform = platform,
|
||||
super(
|
||||
verboseHelp: verboseHelp,
|
||||
cache: cache,
|
||||
platform: platform,
|
||||
logger: logger,
|
||||
featureFlags: featureFlags,
|
||||
) {
|
||||
_platform = platform {
|
||||
argParser.addFlag(
|
||||
'elinux',
|
||||
negatable: true,
|
||||
defaultsTo: false,
|
||||
help: 'Precache artifacts for Embedded Linux development.',
|
||||
);
|
||||
}
|
||||
@@ -46,7 +31,7 @@ class ELinuxPrecacheCommand extends PrecacheCommand {
|
||||
bool get _includeOtherPlatforms =>
|
||||
boolArg('android') ||
|
||||
DevelopmentArtifact.values.any((DevelopmentArtifact artifact) =>
|
||||
boolArg(artifact.name) && argResults.wasParsed(artifact.name));
|
||||
boolArg(artifact.name) && argResults!.wasParsed(artifact.name));
|
||||
|
||||
@override
|
||||
Future<FlutterCommandResult> runCommand() async {
|
||||
@@ -73,7 +58,7 @@ class ELinuxPrecacheCommand extends PrecacheCommand {
|
||||
if (includeAllPlatforms || includeDefaults || _includeOtherPlatforms) {
|
||||
// If the '--force' option is used, the super.runCommand() will delete
|
||||
// the elinux's stamp file. It should be restored.
|
||||
final String elinuxStamp = _cache.getStampFor(elinuxStampName);
|
||||
final String? elinuxStamp = _cache.getStampFor(elinuxStampName);
|
||||
final FlutterCommandResult result = await super.runCommand();
|
||||
if (elinuxStamp != null) {
|
||||
_cache.setStampFor(elinuxStampName, elinuxStamp);
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// Copyright 2021 Sony Group Corporation. All rights reserved.
|
||||
// Copyright 2023 Sony Group Corporation. All rights reserved.
|
||||
// Copyright 2020 Samsung Electronics Co., Ltd. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:flutter_tools/src/base/os.dart';
|
||||
import 'package:flutter_tools/src/build_info.dart';
|
||||
import 'package:flutter_tools/src/cache.dart';
|
||||
@@ -15,8 +13,7 @@ import '../elinux_plugins.dart';
|
||||
|
||||
class ELinuxRunCommand extends RunCommand
|
||||
with ELinuxExtension, ELinuxRequiredArtifacts {
|
||||
ELinuxRunCommand({bool verboseHelp = false})
|
||||
: super(verboseHelp: verboseHelp);
|
||||
ELinuxRunCommand({super.verboseHelp});
|
||||
|
||||
@override
|
||||
Future<Set<DevelopmentArtifact>> get requiredArtifacts async =>
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
// Copyright 2021 Sony Group Corporation. All rights reserved.
|
||||
// Copyright 2023 Sony Group Corporation. All rights reserved.
|
||||
// Copyright 2021 Samsung Electronics Co., Ltd. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:flutter_tools/src/commands/test.dart';
|
||||
|
||||
import '../elinux_plugins.dart';
|
||||
|
||||
class ELinuxTestCommand extends TestCommand with ELinuxExtension {
|
||||
ELinuxTestCommand({bool verboseHelp = false})
|
||||
: super(verboseHelp: verboseHelp);
|
||||
ELinuxTestCommand({super.verboseHelp});
|
||||
}
|
||||
|
||||
+21
-23
@@ -3,8 +3,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'dart:convert';
|
||||
import 'dart:core';
|
||||
|
||||
@@ -24,8 +22,8 @@ import 'package:meta/meta.dart';
|
||||
/// Source: [UpgradeCommand] in `upgrade.dart`
|
||||
class ELinuxUpgradeCommand extends UpgradeCommand {
|
||||
ELinuxUpgradeCommand({
|
||||
@required bool verboseHelp,
|
||||
}) : super(verboseHelp: verboseHelp);
|
||||
required super.verboseHelp,
|
||||
});
|
||||
|
||||
@override
|
||||
Future<FlutterCommandResult> runCommand() {
|
||||
@@ -50,25 +48,25 @@ class ELinuxGitTagVersion {
|
||||
);
|
||||
|
||||
/// The git hash (or an abbreviation thereof) for this commit.
|
||||
final String hash;
|
||||
final String? hash;
|
||||
|
||||
/// The git short hash (or an abbreviation thereof) for this commit.
|
||||
final String hashShort;
|
||||
|
||||
/// The git tag that is this version's closest ancestor.
|
||||
final String gitTag;
|
||||
final String? gitTag;
|
||||
}
|
||||
|
||||
/// Source: [UpgradeCommandRunner] in `upgrade.dart`
|
||||
@visibleForTesting
|
||||
class ELinuxUpgradeCommandRunner {
|
||||
String workingDirectory;
|
||||
String? workingDirectory;
|
||||
|
||||
Future<FlutterCommandResult> runCommand({
|
||||
@required bool force,
|
||||
@required bool continueFlow,
|
||||
@required bool testFlow,
|
||||
@required bool verifyOnly,
|
||||
required bool force,
|
||||
required bool continueFlow,
|
||||
required bool testFlow,
|
||||
required bool verifyOnly,
|
||||
}) async {
|
||||
if (!continueFlow) {
|
||||
await runCommandFirstHalf(
|
||||
@@ -83,9 +81,9 @@ class ELinuxUpgradeCommandRunner {
|
||||
}
|
||||
|
||||
Future<void> runCommandFirstHalf({
|
||||
@required bool force,
|
||||
@required bool testFlow,
|
||||
@required bool verifyOnly,
|
||||
required bool force,
|
||||
required bool testFlow,
|
||||
required bool verifyOnly,
|
||||
}) async {
|
||||
ELinuxGitTagVersion upstreamVersion = await fetchTaggedLatestVersion();
|
||||
final ELinuxGitTagVersion currentVersion = await fetchCurrentVersion();
|
||||
@@ -98,7 +96,7 @@ class ELinuxUpgradeCommandRunner {
|
||||
|
||||
if (currentVersion.hash == upstreamVersion.hash) {
|
||||
globals.printStatus('flutter-elinux is already up to date');
|
||||
globals.printStatus(upstreamVersion.gitTag);
|
||||
globals.printStatus(upstreamVersion.gitTag!);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -206,8 +204,8 @@ class ELinuxUpgradeCommandRunner {
|
||||
}
|
||||
|
||||
Future<ELinuxGitTagVersion> fetchCurrentVersion() async {
|
||||
String tag;
|
||||
String latestRevision;
|
||||
String? tag;
|
||||
String? latestRevision;
|
||||
try {
|
||||
RunResult result = await globals.processUtils.run(
|
||||
<String>['git', 'rev-parse', '--verify', 'HEAD'],
|
||||
@@ -243,14 +241,14 @@ class ELinuxUpgradeCommandRunner {
|
||||
}
|
||||
}
|
||||
return ELinuxGitTagVersion(
|
||||
latestRevision, latestRevision.substring(0, 10), tag);
|
||||
latestRevision, latestRevision!.substring(0, 10), tag);
|
||||
}
|
||||
|
||||
/// Source: [attemptReset] in `upgrade.dart` (exact copy)
|
||||
Future<void> attemptReset(String newRevision) async {
|
||||
Future<void> attemptReset(String? newRevision) async {
|
||||
try {
|
||||
await globals.processUtils.run(
|
||||
<String>['git', 'reset', '--hard', newRevision],
|
||||
<String>['git', 'reset', '--hard', newRevision!],
|
||||
throwOnError: true,
|
||||
workingDirectory: workingDirectory,
|
||||
);
|
||||
@@ -280,12 +278,12 @@ class ELinuxUpgradeCommandRunner {
|
||||
/// Source: [runCommandSecondHalf] in `upgrade.dart`
|
||||
Future<void> runCommandSecondHalf() async {
|
||||
// Make sure the welcome message re-display is delayed until the end.
|
||||
globals.persistentToolState.setShouldRedisplayWelcomeMessage(false);
|
||||
globals.persistentToolState?.setShouldRedisplayWelcomeMessage(false);
|
||||
await precacheArtifacts();
|
||||
await updatePackages();
|
||||
await runDoctor();
|
||||
// Force the welcome message to re-display following the upgrade.
|
||||
globals.persistentToolState.setShouldRedisplayWelcomeMessage(true);
|
||||
globals.persistentToolState?.setShouldRedisplayWelcomeMessage(true);
|
||||
}
|
||||
|
||||
/// Source: [precacheArtifacts] in `upgrade.dart`
|
||||
@@ -311,7 +309,7 @@ class ELinuxUpgradeCommandRunner {
|
||||
/// Source: [updatePackages] in `upgrade.dart`
|
||||
Future<void> updatePackages() async {
|
||||
globals.printStatus('');
|
||||
final String projectRoot = findProjectRoot(globals.fs);
|
||||
final String? projectRoot = findProjectRoot(globals.fs);
|
||||
if (projectRoot != null) {
|
||||
globals.printStatus('');
|
||||
await pub.get(
|
||||
|
||||
Reference in New Issue
Block a user