mirror of
https://github.com/flutter/samples.git
synced 2026-08-25 01:21:59 +00:00
Release 3.47 (#2879)
Minor updates for release 3.47 ## Pre-launch Checklist - [x] I read the [Flutter Style Guide] _recently_, and have followed its advice. - [x] I signed the [CLA]. - [x] I read the [Contributors Guide]. - [x] I have added sample code updates to the [changelog]. - [x] I updated/added relevant documentation (doc comments with `///`). If you need help, consider asking for advice on the #hackers-devrel channel on [Discord]. <!-- Links --> [Flutter Style Guide]: https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md [CLA]: https://cla.developers.google.com/ [Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md [Contributors Guide]: https://github.com/flutter/samples/blob/main/CONTRIBUTING.md [changelog]: ../CHANGELOG.md --------- Co-authored-by: Parker Lougheed <parlough@gmail.com>
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
// ignore_for_file: avoid_print,
|
||||
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:yaml/yaml.dart';
|
||||
|
||||
@@ -38,8 +41,9 @@ Future<void> main() async {
|
||||
final packages = workspace
|
||||
.where((e) {
|
||||
if (skipCiList != null && skipCiList.contains(e)) return false;
|
||||
if (channelSkipList != null && channelSkipList.contains(e))
|
||||
if (channelSkipList != null && channelSkipList.contains(e)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
})
|
||||
.map((e) => e.toString())
|
||||
@@ -99,7 +103,9 @@ Future<String> _getFlutterChannel() async {
|
||||
'--machine',
|
||||
], runInShell: true);
|
||||
if (result.exitCode != 0) {
|
||||
print('Flutter version command failed with exit code ${result.exitCode}');
|
||||
print(
|
||||
'Flutter version command failed with exit code ${result.exitCode}',
|
||||
);
|
||||
print('Stdout: ${result.stdout}');
|
||||
print('Stderr: ${result.stderr}');
|
||||
return 'unknown';
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
// ignore_for_file: avoid_print,
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:args/args.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:yaml/yaml.dart';
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
// ignore_for_file: avoid_print,
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:yaml/yaml.dart';
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ class ReleaseScriptRunner {
|
||||
Future<bool> _processProject(String projectPath, String dartVersion) async {
|
||||
final projectName = p.basename(projectPath);
|
||||
final projectDir = Directory(projectPath);
|
||||
final issues = [];
|
||||
final issues = <String>[];
|
||||
|
||||
if (!projectDir.existsSync()) {
|
||||
log(red.wrap('Project directory not found: $projectPath'), stderr);
|
||||
@@ -174,7 +174,10 @@ class ReleaseScriptRunner {
|
||||
log(styleBold.wrap('Processing project: $projectName'), stdout);
|
||||
log(styleBold.wrap('=========================================')!, stdout);
|
||||
|
||||
log(blue.wrap('Updating SDK constraints to use Dart $dartVersion'), stdout);
|
||||
log(
|
||||
blue.wrap('Updating SDK constraints to use Dart $dartVersion'),
|
||||
stdout,
|
||||
);
|
||||
if (!_isDryRun) {
|
||||
if (!await _updateSdkConstraints(projectPath, dartVersion)) {
|
||||
log(
|
||||
@@ -191,7 +194,10 @@ class ReleaseScriptRunner {
|
||||
'--fatal-infos',
|
||||
'--fatal-warnings',
|
||||
]),
|
||||
Command('dart format', 'Running dart format...', 'dart', ['format', '.']),
|
||||
Command('dart format', 'Running dart format...', 'dart', [
|
||||
'format',
|
||||
'.',
|
||||
]),
|
||||
];
|
||||
|
||||
final testDir = Directory(p.join(projectPath, 'test'));
|
||||
@@ -211,7 +217,10 @@ class ReleaseScriptRunner {
|
||||
);
|
||||
|
||||
if (!didPass) {
|
||||
log(red.wrap('${command.displayName} failed for $projectName'), stderr);
|
||||
log(
|
||||
red.wrap('${command.displayName} failed for $projectName'),
|
||||
stderr,
|
||||
);
|
||||
|
||||
if (command.displayName == 'pub upgrade' ||
|
||||
command.displayName == 'pub get' &&
|
||||
@@ -255,7 +264,7 @@ class ReleaseScriptRunner {
|
||||
}
|
||||
|
||||
try {
|
||||
final newConstraint = '^${versionString}-0';
|
||||
final newConstraint = '^$versionString-0';
|
||||
|
||||
final content = await pubspecFile.readAsString();
|
||||
final editor = YamlEditor(content);
|
||||
@@ -307,16 +316,18 @@ class ReleaseScriptRunner {
|
||||
.transform(SystemEncoding().decoder)
|
||||
.forEach((line) {
|
||||
log(line, stdout);
|
||||
if (!_isOnlyWhitespace(line))
|
||||
output.writeln('${line.trim().padLeft(2)}');
|
||||
if (!_isOnlyWhitespace(line)) {
|
||||
output.writeln(line.trim().padLeft(2));
|
||||
}
|
||||
});
|
||||
|
||||
final stderrFuture = process.stderr
|
||||
.transform(SystemEncoding().decoder)
|
||||
.forEach((line) {
|
||||
log(red.wrap(line), stderr);
|
||||
if (!_isOnlyWhitespace(line))
|
||||
output.writeln('${line.trim().padLeft(2)}');
|
||||
if (!_isOnlyWhitespace(line)) {
|
||||
output.writeln(line.trim().padLeft(2));
|
||||
}
|
||||
});
|
||||
|
||||
await Future.wait([stdoutFuture, stderrFuture]);
|
||||
@@ -325,7 +336,10 @@ class ReleaseScriptRunner {
|
||||
}
|
||||
|
||||
void _printSummary(int total, List<String> failed) {
|
||||
log(styleBold.wrap('\n=========================================')!, stdout);
|
||||
log(
|
||||
styleBold.wrap('\n=========================================')!,
|
||||
stdout,
|
||||
);
|
||||
log(styleBold.wrap('Update Summary')!, stdout);
|
||||
log(styleBold.wrap('=========================================')!, stdout);
|
||||
log(blue.wrap('Total projects processed: $total'), stdout);
|
||||
|
||||
Reference in New Issue
Block a user