Turn back on macOS shard Cirrus caching (#50496)

This commit is contained in:
Jenn Magder
2020-02-11 10:37:53 -08:00
committed by GitHub
parent fa44a1cf37
commit e002698c35
2 changed files with 39 additions and 5 deletions

View File

@@ -75,6 +75,12 @@ class UpdatePackagesCommand extends FlutterCommand {
help: 'verifies the package checksum without changing or updating deps',
defaultsTo: false,
negatable: false,
)
..addFlag(
'offline',
help: 'Use cached packages instead of accessing the network',
defaultsTo: false,
negatable: false,
);
}
@@ -129,6 +135,13 @@ class UpdatePackagesCommand extends FlutterCommand {
final bool isPrintTransitiveClosure = boolArg('transitive-closure');
final bool isVerifyOnly = boolArg('verify-only');
final bool isConsumerOnly = boolArg('consumer-only');
final bool offline = boolArg('offline');
if (upgrade && offline) {
throwToolExit(
'--force-upgrade cannot be used with the --offline flag'
);
}
// "consumer" packages are those that constitute our public API (e.g. flutter, flutter_test, flutter_driver, flutter_localizations).
if (isConsumerOnly) {
@@ -268,6 +281,7 @@ class UpdatePackagesCommand extends FlutterCommand {
directory: tempDir.path,
upgrade: true,
checkLastModified: false,
offline: offline,
);
// Then we run "pub deps --style=compact" on the result. We pipe all the
// output to tree.fill(), which parses it so that it can create a graph
@@ -335,7 +349,12 @@ class UpdatePackagesCommand extends FlutterCommand {
int count = 0;
for (final Directory dir in packages) {
await pub.get(context: PubContext.updatePackages, directory: dir.path, checkLastModified: false);
await pub.get(
context: PubContext.updatePackages,
directory: dir.path,
checkLastModified: false,
offline: offline,
);
count += 1;
}