fix default artifacts to exclude ios and android (#35303)

This commit is contained in:
Jonah Williams
2019-07-02 17:40:55 -07:00
committed by GitHub
parent 763ce632e5
commit 556e374e02
3 changed files with 23 additions and 4 deletions

View File

@@ -30,6 +30,17 @@ class DoctorCommand extends FlutterCommand {
@override
final String description = 'Show information about the installed tooling.';
@override
Future<Set<DevelopmentArtifact>> get requiredArtifacts async {
return <DevelopmentArtifact>{
DevelopmentArtifact.universal,
// This is required because we use gen_snapshot to check if the host
// machine can execute the provided artifacts. See `_genSnapshotRuns`
// in `doctor.dart`.
DevelopmentArtifact.android,
};
}
@override
Future<FlutterCommandResult> runCommand() async {
if (argResults.wasParsed('check-for-remote-artifacts')) {

View File

@@ -479,12 +479,9 @@ abstract class FlutterCommand extends Command<void> {
/// The set of development artifacts required for this command.
///
/// Defaults to [DevelopmentArtifact.universal],
/// [DevelopmentArtifact.android], and [DevelopmentArtifact.iOS].
/// Defaults to [DevelopmentArtifact.universal].
Future<Set<DevelopmentArtifact>> get requiredArtifacts async => const <DevelopmentArtifact>{
DevelopmentArtifact.universal,
DevelopmentArtifact.iOS,
DevelopmentArtifact.android,
};
/// Subclasses must implement this to execute the command.

View File

@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/commands/install.dart';
import 'package:mockito/mockito.dart';
@@ -11,6 +12,10 @@ import '../src/mocks.dart';
void main() {
group('install', () {
setUpAll(() {
Cache.disableLocking();
});
testUsingContext('returns 0 when Android is connected and ready for an install', () async {
final InstallCommand command = InstallCommand();
applyMocksToCommand(command);
@@ -21,6 +26,8 @@ void main() {
testDeviceManager.addDevice(device);
await createTestCommandRunner(command).run(<String>['install']);
}, overrides: <Type, Generator>{
Cache: () => MockCache(),
});
testUsingContext('returns 0 when iOS is connected and ready for an install', () async {
@@ -33,6 +40,10 @@ void main() {
testDeviceManager.addDevice(device);
await createTestCommandRunner(command).run(<String>['install']);
}, overrides: <Type, Generator>{
Cache: () => MockCache(),
});
});
}
class MockCache extends Mock implements Cache {}