// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:io'; import 'package:path/path.dart' as path; import '../utils.dart'; /// To run this test locally: /// /// 1. Connect an Android device or emulator. /// 2. Run `dart pub get` in dev/bots /// 3. Set flutter to use Java 17 /// flutter config --jdk-dir= /// On a Mac you can run `/usr/libexec/java_home -V1 to find the installed /// versions of java. Remember to clear this value after testing. /// `flutter config --jdk-dir=` /// 4. Run the following command from the root of the Flutter repository: /// /// ```sh /// SHARD=android_java17_tool_integration_tests bin/cache/dart-sdk/bin/dart dev/bots/test.dart /// ``` Future androidJava17IntegrationToolTestsRunner() async { final String toolsPath = path.join(flutterRoot, 'packages', 'flutter_tools'); final List allTests = Directory(path.join(toolsPath, 'test', 'android_java17_integration.shard')) .listSync(recursive: true) .whereType() .map((FileSystemEntity entry) => path.relative(entry.path, from: toolsPath)) .where((String testPath) => path.basename(testPath).endsWith('_test.dart')) .toList(); await runDartTest( toolsPath, forceSingleCore: true, testPaths: selectIndexOfTotalSubshard(allTests), collectMetrics: true, ); }