Skip to content
Closed
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
4 changes: 2 additions & 2 deletions dev/benchmarks/multiple_flutters/module/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies:
meta: 1.15.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path: 1.9.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path_provider: 2.1.4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path_provider_android: 2.2.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path_provider_android: 2.2.10 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path_provider_foundation: 2.4.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path_provider_linux: 2.2.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path_provider_platform_interface: 2.1.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
Expand All @@ -47,4 +47,4 @@ flutter:
androidPackage: com.example.multiple_flutters_module
iosBundleIdentifier: com.example.multipleFluttersModule

# PUBSPEC CHECKSUM: 2736
# PUBSPEC CHECKSUM: 0666
4 changes: 2 additions & 2 deletions dev/conductor/core/lib/src/git.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Git {
_reportFailureAndExit(args, workingDirectory, result, explanation);
}

Future<int> run(
Future<ProcessResult> run(
List<String> args,
String explanation, {
bool allowNonZeroExitCode = false,
Expand All @@ -48,7 +48,7 @@ class Git {
if (result.exitCode != 0 && !allowNonZeroExitCode) {
_reportFailureAndExit(args, workingDirectory, result, explanation);
}
return result.exitCode;
return result;
}

Future<ProcessResult> _run(List<String> args, String workingDirectory) async {
Expand Down
8 changes: 6 additions & 2 deletions dev/conductor/core/lib/src/packages_autoroller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,13 @@ This PR was generated by the automated

Future<void> roll() async {
try {
await framework.checkout('revert-154555-revert-154441-add-logging-to-packages-autoroller'); // TODO delete
await authLogin();
final bool openPrAlready = await hasOpenPrs();
if (openPrAlready) {
// Don't open multiple roll PRs.
return;
//return; // TODO un-comment!
print("there's already an open PR, but we're testing this");
}
final bool didUpdate = await updatePackages();
if (!didUpdate) {
Expand Down Expand Up @@ -140,7 +142,7 @@ This PR was generated by the automated
}

Future<void> _regenerateGradleLockfiles(Directory repoRoot) async {
await framework.runDart(<String>[
await framework.streamDart(<String>[
'${repoRoot.path}/dev/tools/bin/generate_gradle_lockfiles.dart',
'--no-gradle-generation',
'--no-exclusion',
Expand All @@ -149,8 +151,10 @@ This PR was generated by the automated
// If the git checkout is clean, we did not update any lockfiles and we do
// not need an additional commit.
case NoDiff():
stdio.printTrace('No diff after calling generate_gradle_lockfiles.dart');
return;
case OnlyLockfileChanges():
stdio.printTrace('Committing Gradle lockfile changes...');
await framework.commit(
'Re-generate Gradle lockfiles',
addFirst: true,
Expand Down
70 changes: 47 additions & 23 deletions dev/conductor/core/lib/src/repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ abstract class Repository {

/// Determines if one ref is an ancestor for another.
Future<bool> isAncestor(String possibleAncestor, String possibleDescendant) async {
final int exitcode = await git.run(
final io.ProcessResult result = await git.run(
<String>[
'merge-base',
'--is-ancestor',
Expand All @@ -391,18 +391,18 @@ abstract class Repository {
allowNonZeroExitCode: true,
workingDirectory: (await checkoutDirectory).path,
);
return exitcode == 0;
return result.exitCode == 0;
}

/// Determines if a given commit has a tag.
Future<bool> isCommitTagged(String commit) async {
final int exitcode = await git.run(
final io.ProcessResult result = await git.run(
<String>['describe', '--exact-match', '--tags', commit],
'verify $commit is already tagged',
allowNonZeroExitCode: true,
workingDirectory: (await checkoutDirectory).path,
);
return exitcode == 0;
return result.exitCode == 0;
}

/// Resets repository HEAD to [ref].
Expand Down Expand Up @@ -480,16 +480,27 @@ abstract class Repository {
}
authorArg = '--author="$author"';
}
await git.run(
<String>[
'commit',
'--message',
message,
if (authorArg != null) authorArg,
],
final List<String> commitCmd = <String>[
'commit',
'--message',
message,
if (authorArg != null) authorArg,
];
stdio.printTrace('Executing git $commitCmd...');
final io.ProcessResult commitResult = await git.run(
commitCmd,
'commit changes',
workingDirectory: (await checkoutDirectory).path,
);
final String stdout = commitResult.stdout as String;
if (stdout.isNotEmpty) {
stdio.printTrace(stdout);
}
final String stderr = commitResult.stderr as String;
if (stderr.isNotEmpty) {
stdio.printTrace(stderr);
}

return reverseParse('HEAD');
}

Expand Down Expand Up @@ -608,13 +619,6 @@ class FrameworkRepository extends Repository {
]);
}

Future<io.ProcessResult> runDart(List<String> args) async {
return processManager.run(<String>[
fileSystem.path.join((await checkoutDirectory).path, 'bin', 'dart'),
...args,
]);
}

Future<io.ProcessResult> runFlutter(List<String> args) async {
await _ensureToolReady();
return processManager.run(<String>[
Expand All @@ -623,16 +627,27 @@ class FrameworkRepository extends Repository {
]);
}

Future<void> streamDart(List<String> args) async => _streamProcess(<String>[
fileSystem.path.join((await checkoutDirectory).path, 'bin', 'dart'),
...args,
]);

Future<io.Process> streamFlutter(
List<String> args, {
void Function(String)? stdoutCallback,
void Function(String)? stderrCallback,
}) async => _streamProcess(<String>[
fileSystem.path.join((await checkoutDirectory).path, 'bin', 'flutter'),
...args,
]);

Future<io.Process> _streamProcess(
List<String> cmd, {
void Function(String)? stdoutCallback,
void Function(String)? stderrCallback,
}) async {
await _ensureToolReady();
final io.Process process = await processManager.start(<String>[
fileSystem.path.join((await checkoutDirectory).path, 'bin', 'flutter'),
...args,
]);
stdio.printTrace('Executing $cmd...');
final io.Process process = await processManager.start(cmd);
process
.stdout
.transform(utf8.decoder)
Expand All @@ -643,6 +658,15 @@ class FrameworkRepository extends Repository {
.transform(utf8.decoder)
.transform(const LineSplitter())
.listen(stderrCallback ?? stdio.printError);
final int exitCode = await process.exitCode;
if (exitCode != 0) {
throw io.ProcessException(
cmd.first,
cmd.sublist(1),
'Process failed',
exitCode,
);
}
return process;
}

Expand Down
8 changes: 0 additions & 8 deletions dev/conductor/core/test/packages_autoroller_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,6 @@ void main() {
'-b',
'packages-autoroller-branch-1',
]),
const FakeCommand(command: <String>[
'$checkoutsParentDirectory/flutter_conductor_checkouts/framework/bin/flutter',
'help',
]),
const FakeCommand(command: <String>[
'$checkoutsParentDirectory/flutter_conductor_checkouts/framework/bin/flutter',
'--verbose',
Expand Down Expand Up @@ -389,10 +385,6 @@ void main() {
'-b',
'packages-autoroller-branch-1',
]),
const FakeCommand(command: <String>[
'$checkoutsParentDirectory/flutter_conductor_checkouts/framework/bin/flutter',
'help',
]),
const FakeCommand(command: <String>[
'$checkoutsParentDirectory/flutter_conductor_checkouts/framework/bin/flutter',
'--verbose',
Expand Down
4 changes: 2 additions & 2 deletions dev/integration_tests/android_views/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
path_provider: 2.1.4
# This made non-transitive to allow exact pinning
# https://github.com/flutter/flutter/issues/116376
path_provider_android: 2.2.1
path_provider_android: 2.2.10
collection: 1.19.0
assets_for_android_views:
git:
Expand Down Expand Up @@ -95,4 +95,4 @@ dev_dependencies:
flutter:
uses-material-design: true

# PUBSPEC CHECKSUM: 23dd
# PUBSPEC CHECKSUM: 450e
4 changes: 2 additions & 2 deletions dev/integration_tests/hybrid_android_views/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies:
material_color_utilities: 0.11.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
meta: 1.15.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path: 1.9.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path_provider_android: 2.2.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path_provider_android: 2.2.10 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path_provider_foundation: 2.4.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path_provider_linux: 2.2.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path_provider_platform_interface: 2.1.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
Expand Down Expand Up @@ -93,4 +93,4 @@ dev_dependencies:
flutter:
uses-material-design: true

# PUBSPEC CHECKSUM: 23dd
# PUBSPEC CHECKSUM: 450e
4 changes: 2 additions & 2 deletions dev/integration_tests/new_gallery/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies:
nested: 1.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path: 1.9.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path_provider: 2.1.4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path_provider_android: 2.2.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path_provider_android: 2.2.10 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path_provider_foundation: 2.4.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path_provider_linux: 2.2.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path_provider_platform_interface: 2.1.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
Expand Down Expand Up @@ -311,4 +311,4 @@ flutter:
fonts:
- asset: packages/flutter_gallery_assets/fonts/GalleryIcons.ttf

# PUBSPEC CHECKSUM: 5314
# PUBSPEC CHECKSUM: f344
1 change: 0 additions & 1 deletion packages/flutter_tools/lib/src/update_packages_pins.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const Map<String, String> kManuallyPinnedDependencies = <String, String>{
'leak_tracker': '10.0.7', // https://github.com/flutter/devtools/issues/3951
'leak_tracker_testing': '3.0.1', // https://github.com/flutter/devtools/issues/3951
'leak_tracker_flutter_testing': '3.0.8', // https://github.com/flutter/devtools/issues/3951
'path_provider_android': '2.2.1', // https://github.com/flutter/flutter/issues/140796
};

/// These are packages that are explicitly excluded from appearing in the list
Expand Down