Unverified Commit a6a8a14d authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Do not cleanup Gradle in non-Android integration tests (#66487)

parent 1510865f
......@@ -10,7 +10,7 @@ import 'package:path/path.dart' as path;
import 'package:vm_service_client/vm_service_client.dart';
import 'package:flutter_devicelab/framework/utils.dart';
import 'package:flutter_devicelab/framework/adb.dart' show DeviceIdEnvName;
import 'package:flutter_devicelab/framework/adb.dart';
/// Runs a task in a separate Dart VM and collects the result using the VM
/// service protocol.
......@@ -123,6 +123,7 @@ Future<VMIsolateRef> _connectToRunnerIsolate(Uri vmServiceUri) async {
}
Future<void> cleanupSystem() async {
if (deviceOperatingSystem == null || deviceOperatingSystem == DeviceOperatingSystem.android) {
print('\n\nCleaning up system after task...');
final String javaHome = await findJavaHome();
if (javaHome != null) {
......@@ -148,7 +149,7 @@ Future<void> cleanupSystem() async {
await exec(
path.join(tempDir.path, gradlewBinaryName),
<String>['--stop'],
environment: <String, String>{ 'JAVA_HOME': javaHome },
environment: <String, String>{ 'JAVA_HOME': javaHome},
workingDirectory: tempDir.path,
canFail: true,
);
......@@ -162,4 +163,5 @@ Future<void> cleanupSystem() async {
// next devicelab task to fail.
// https://github.com/flutter/flutter/issues/65277
rmTree(dir('${Platform.environment['HOME']}/.gradle'));
}
}
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