[flutter_tools] fix flutter create --offline#100941
[flutter_tools] fix flutter create --offline#100941christopherfujino merged 14 commits intoflutter:masterfrom
Conversation
| @@ -171,7 +171,14 @@ class PrecacheCommand extends FlutterCommand { | |||
| } | |||
| } | |||
| if (!await _cache.isUpToDate()) { | |||
There was a problem hiding this comment.
I don't think flutter precache --offline doesn't really make sense, as the point is to download pre-built binaries.
|
For testing, I would recommend adding a new test to test/commands.shard/hermetic/create_usage_test.dart and use the FakeProcessManager and FakeCommand like: https://github.com/flutter/flutter/blob/master/packages/flutter_tools/test/commands.shard/hermetic/build_ios_test.dart#L122 |
|
|
||
| /// Update the cache to contain all `requiredArtifacts`. | ||
| Future<void> updateAll(Set<DevelopmentArtifact> requiredArtifacts) async { | ||
| Future<void> updateAll(Set<DevelopmentArtifact> requiredArtifacts, [bool offline = false]) async { |
There was a problem hiding this comment.
for these optional parameters can you use named parameters instead?
|
|
||
| /// Update the cache to contain all `requiredArtifacts`. | ||
| Future<void> updateAll(Set<DevelopmentArtifact> requiredArtifacts) async { | ||
| Future<void> updateAll(Set<DevelopmentArtifact> requiredArtifacts, [bool offline = false]) async { |
There was a problem hiding this comment.
| Future<void> updateAll(Set<DevelopmentArtifact> requiredArtifacts, [bool offline = false]) async { | |
| Future<void> updateAll(Set<DevelopmentArtifact> requiredArtifacts, {bool offline = false}) async { |
1aca664 to
04bcbb1
Compare
…flutter into create_when_offline # Conflicts: # packages/flutter_tools/test/commands.shard/hermetic/create_usage_test.dart
| // ios-deploy on macOS) are required to determine `requiredArtifacts`. | ||
| await globals.cache.updateAll(<DevelopmentArtifact>{DevelopmentArtifact.universal}); | ||
| await globals.cache.updateAll(await requiredArtifacts); | ||
| bool offline; |
There was a problem hiding this comment.
| bool offline; | |
| final bool offline = argParser.options.containsKey('offline') ? boolArg('offline') : false; |
| fs.directory(directory).childFile('.packages').createSync(); | ||
| if (offline == true){ | ||
| calledGetOffline += 1; | ||
| } |
There was a problem hiding this comment.
style nit. else should be on this line, after }
|
This pull request is not suitable for automatic merging in its current state.
|
Fixes: #96286
Pre-launch Checklist
///).