devicelab benchmarks run on Windows (#8814)
* devicelab benchmarks run on Windows * fix analyzer issue * fix test * fix pubspec
This commit is contained in:
committed by
GitHub
parent
4c91b6e725
commit
d87f19817f
@@ -382,9 +382,9 @@ String get adbPath {
|
||||
throw 'ANDROID_HOME environment variable missing. This variable must '
|
||||
'point to the Android SDK directory containing platform-tools.';
|
||||
|
||||
final File adbPath = file(path.join(androidHome, 'platform-tools/adb'));
|
||||
final String adbPath = path.join(androidHome, 'platform-tools/adb');
|
||||
|
||||
if (!adbPath.existsSync()) throw 'adb not found at: $adbPath';
|
||||
if (!canRun(adbPath)) throw 'adb not found at: $adbPath';
|
||||
|
||||
return adbPath.absolute.path;
|
||||
return path.absolute(adbPath);
|
||||
}
|
||||
|
||||
@@ -8,12 +8,14 @@ import 'dart:io';
|
||||
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:process/process.dart';
|
||||
import 'package:stack_trace/stack_trace.dart';
|
||||
|
||||
/// Virtual current working directory, which affect functions, such as [exec].
|
||||
String cwd = Directory.current.path;
|
||||
|
||||
List<ProcessInfo> _runningProcesses = <ProcessInfo>[];
|
||||
ProcessManager _processManager = new LocalProcessManager();
|
||||
|
||||
class ProcessInfo {
|
||||
ProcessInfo(this.command, this.process);
|
||||
@@ -118,7 +120,7 @@ void section(String title) {
|
||||
|
||||
Future<String> getDartVersion() async {
|
||||
// The Dart VM returns the version text to stderr.
|
||||
final ProcessResult result = Process.runSync(dartBin, <String>['--version']);
|
||||
final ProcessResult result = _processManager.runSync(<String>[dartBin, '--version']);
|
||||
String version = result.stderr.trim();
|
||||
|
||||
// Convert:
|
||||
@@ -167,9 +169,8 @@ Future<Process> startProcess(
|
||||
print('Executing: $command');
|
||||
environment ??= <String, String>{};
|
||||
environment['BOT'] = 'true';
|
||||
final Process process = await Process.start(
|
||||
executable,
|
||||
arguments,
|
||||
final Process process = await _processManager.start(
|
||||
<String>[executable]..addAll(arguments),
|
||||
environment: environment,
|
||||
workingDirectory: workingDirectory ?? cwd,
|
||||
);
|
||||
@@ -448,3 +449,5 @@ Future<int> findAvailablePort() async {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool canRun(String path) => _processManager.canRun(path);
|
||||
Reference in New Issue
Block a user