Unverified Commit 3d124d25 authored by Abhishek Ghaskata's avatar Abhishek Ghaskata Committed by GitHub

migrate host agent (#84755)

parent a2fa6d43
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// @dart = 2.8
import 'package:file/file.dart'; import 'package:file/file.dart';
import 'package:file/local.dart'; import 'package:file/local.dart';
import 'package:meta/meta.dart'; import 'package:meta/meta.dart';
...@@ -14,7 +12,7 @@ HostAgent get hostAgent => HostAgent(platform: const LocalPlatform(), fileSystem ...@@ -14,7 +12,7 @@ HostAgent get hostAgent => HostAgent(platform: const LocalPlatform(), fileSystem
/// Host machine running the tests. /// Host machine running the tests.
class HostAgent { class HostAgent {
HostAgent({@required Platform platform, @required FileSystem fileSystem}) HostAgent({required Platform platform, required FileSystem fileSystem})
: _platform = platform, : _platform = platform,
_fileSystem = fileSystem; _fileSystem = fileSystem;
...@@ -22,19 +20,19 @@ class HostAgent { ...@@ -22,19 +20,19 @@ class HostAgent {
final FileSystem _fileSystem; final FileSystem _fileSystem;
/// Creates a directory to dump file artifacts. /// Creates a directory to dump file artifacts.
Directory/*?*/ get dumpDirectory { Directory? get dumpDirectory {
if (_dumpDirectory == null) { if (_dumpDirectory == null) {
// Set in LUCI recipe. // Set in LUCI recipe.
final String directoryPath = _platform.environment['FLUTTER_LOGS_DIR']; final String? directoryPath = _platform.environment['FLUTTER_LOGS_DIR'];
if (directoryPath != null) { if (directoryPath != null) {
_dumpDirectory = _fileSystem.directory(directoryPath)..createSync(recursive: true); _dumpDirectory = _fileSystem.directory(directoryPath)..createSync(recursive: true);
print('Found FLUTTER_LOGS_DIR dump directory ${_dumpDirectory.path}'); print('Found FLUTTER_LOGS_DIR dump directory ${_dumpDirectory?.path}');
} }
} }
return _dumpDirectory; return _dumpDirectory;
} }
static Directory/*?*/ _dumpDirectory; static Directory? _dumpDirectory;
@visibleForTesting @visibleForTesting
void resetDumpDirectory() { void resetDumpDirectory() {
......
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