Commit 726d3168 authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

drive: Replace manual pub get with usesPubOption() (#5803)

parent 5c4c1b8d
...@@ -11,9 +11,7 @@ import '../android/android_device.dart' show AndroidDevice; ...@@ -11,9 +11,7 @@ import '../android/android_device.dart' show AndroidDevice;
import '../application_package.dart'; import '../application_package.dart';
import '../base/file_system.dart'; import '../base/file_system.dart';
import '../base/common.dart'; import '../base/common.dart';
import '../base/logger.dart';
import '../base/os.dart'; import '../base/os.dart';
import '../base/process.dart';
import '../build_info.dart'; import '../build_info.dart';
import '../cache.dart'; import '../cache.dart';
import '../dart/package_map.dart'; import '../dart/package_map.dart';
...@@ -47,6 +45,7 @@ import 'run.dart'; ...@@ -47,6 +45,7 @@ import 'run.dart';
/// exit code. /// exit code.
class DriveCommand extends RunCommandBase { class DriveCommand extends RunCommandBase {
DriveCommand() { DriveCommand() {
usesPubOption();
argParser.addFlag( argParser.addFlag(
'keep-app-running', 'keep-app-running',
negatable: true, negatable: true,
...@@ -126,14 +125,6 @@ class DriveCommand extends RunCommandBase { ...@@ -126,14 +125,6 @@ class DriveCommand extends RunCommandBase {
printStatus('Will connect to already running application instance.'); printStatus('Will connect to already running application instance.');
} }
// Check for the existence of a `.packages` file.
PackageMap.globalPackagesPath = path.normalize(path.absolute(PackageMap.globalPackagesPath));
if (!new io.File(PackageMap.globalPackagesPath).existsSync()) {
Status status = logger.startProgress('Missing .packages file; running `pub get`:');
await runAsync(<String>[sdkBinaryName('pub'), 'get', '--no-precompile', '--no-packages-dir']);
status.stop(showElapsedTime: true);
}
Cache.releaseLockEarly(); Cache.releaseLockEarly();
try { try {
...@@ -334,6 +325,7 @@ void restoreTestRunner() { ...@@ -334,6 +325,7 @@ void restoreTestRunner() {
Future<int> runTests(List<String> testArgs) async { Future<int> runTests(List<String> testArgs) async {
printTrace('Running driver tests.'); printTrace('Running driver tests.');
PackageMap.globalPackagesPath = path.normalize(path.absolute(PackageMap.globalPackagesPath));
List<String> args = testArgs.toList() List<String> args = testArgs.toList()
..add('--packages=${PackageMap.globalPackagesPath}') ..add('--packages=${PackageMap.globalPackagesPath}')
..add('-rexpanded'); ..add('-rexpanded');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment