Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tool/lib/commands/update_flutter_sdk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,23 @@ class UpdateFlutterSdkCommand extends Command {
}

// Next, update (or clone) the tool/flutter-sdk copy.

// On Windows LCUI trybots, some of the flutter repo paths cause
// "Filename too long" errors. Filenames such as:
// engine/src/flutter/testing/ios_scenario_app/ios/Scenarios/
// ScenariosUITests/
// golden_platform_view_clippath_with_transform_multiple_clips_impeller_iPhone SE (3rd generation)_26.2_simulator.png'.
final gitLongFilesCommand = CliCommand.git([

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we just run this once before the if / else statement instead of calling it in each block?

'config',
'core.longpaths',
'true',
]);

if (Directory(toolSdkPath).existsSync()) {
log.stdout('Updating Flutter at $toolSdkPath');
await processManager.runAll(
commands: [
gitLongFilesCommand,
CliCommand.git(['fetch']),
CliCommand.git(['checkout', flutterVersion, '-f']),
CliCommand.flutter(['--version']),
Expand All @@ -101,13 +114,15 @@ class UpdateFlutterSdkCommand extends Command {
await processManager.runProcess(
CliCommand.git([
'clone',
'--no-checkout',
'https://github.com/flutter/flutter',
flutterSdkDirName,
]),
workingDirectory: repo.toolDirectoryPath,
);
await processManager.runAll(
commands: [
gitLongFilesCommand,
CliCommand.git(['checkout', flutterVersion, '-f']),
CliCommand.flutter(['--version']),
],
Expand Down
1 change: 1 addition & 0 deletions tool/lib/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ extension DevToolsProcessManagerExtension on ProcessManager {
);
}

/// Runs [commands] in serial, from [workingDirectory].
Future<void> runAll({
required List<CliCommand> commands,
String? workingDirectory,
Expand Down
Loading