Fix windows hostonly_devicelab tests. (#66195)
This commit is contained in:
@@ -9,6 +9,9 @@ import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/utils.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
final String platformLineSep = Platform.isWindows ? '\r\n': '\n';
|
||||
|
||||
|
||||
final String gradlew = Platform.isWindows ? 'gradlew.bat' : 'gradlew';
|
||||
final String gradlewExecutable = Platform.isWindows ? '.\\$gradlew' : './$gradlew';
|
||||
|
||||
@@ -58,12 +61,12 @@ Future<void> main() async {
|
||||
final File modulePubspec = File(path.join(projectDir.path, 'pubspec.yaml'));
|
||||
String content = modulePubspec.readAsStringSync();
|
||||
content = content.replaceFirst(
|
||||
'\ndependencies:\n',
|
||||
'\ndependencies:\n'
|
||||
' plugin_with_android:\n'
|
||||
' path: ../plugin_with_android\n'
|
||||
' plugin_without_android:\n'
|
||||
' path: ../plugin_without_android\n',
|
||||
'${platformLineSep}dependencies:$platformLineSep',
|
||||
'${platformLineSep}dependencies:$platformLineSep'
|
||||
' plugin_with_android:$platformLineSep'
|
||||
' path: ../plugin_with_android$platformLineSep'
|
||||
' plugin_without_android:$platformLineSep'
|
||||
' path: ../plugin_without_android$platformLineSep',
|
||||
);
|
||||
modulePubspec.writeAsStringSync(content, flush: true);
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import 'package:path/path.dart' as path;
|
||||
|
||||
final String gradlew = Platform.isWindows ? 'gradlew.bat' : 'gradlew';
|
||||
final String gradlewExecutable = Platform.isWindows ? '.\\$gradlew' : './$gradlew';
|
||||
final String platformLineSep = Platform.isWindows ? '\r\n': '\n';
|
||||
|
||||
/// Tests that Jetifier can translate plugins that use support libraries.
|
||||
Future<void> main() async {
|
||||
@@ -43,8 +44,8 @@ Future<void> main() async {
|
||||
final File pubspec = File(path.join(projectDir.path, 'pubspec.yaml'));
|
||||
String content = pubspec.readAsStringSync();
|
||||
content = content.replaceFirst(
|
||||
'\ndependencies:\n',
|
||||
'\ndependencies:\n firebase_auth: 0.7.0\n',
|
||||
'${platformLineSep}dependencies:$platformLineSep',
|
||||
'${platformLineSep}dependencies:$platformLineSep firebase_auth: 0.7.0$platformLineSep',
|
||||
);
|
||||
pubspec.writeAsStringSync(content, flush: true);
|
||||
await inDirectory(projectDir, () async {
|
||||
|
||||
@@ -12,6 +12,7 @@ import 'package:path/path.dart' as path;
|
||||
final String gradlew = Platform.isWindows ? 'gradlew.bat' : 'gradlew';
|
||||
final String gradlewExecutable = Platform.isWindows ? '.\\$gradlew' : './$gradlew';
|
||||
final String fileReadWriteMode = Platform.isWindows ? 'rw-rw-rw-' : 'rw-r--r--';
|
||||
final String platformLineSep = Platform.isWindows ? '\r\n': '\n';
|
||||
|
||||
/// Tests that the Flutter module project template works and supports
|
||||
/// adding Flutter to an existing Android app.
|
||||
@@ -60,8 +61,8 @@ Future<void> main() async {
|
||||
final File pubspec = File(path.join(projectDir.path, 'pubspec.yaml'));
|
||||
String content = await pubspec.readAsString();
|
||||
content = content.replaceFirst(
|
||||
'\n # assets:\n',
|
||||
'\n assets:\n - assets/read-only.txt\n',
|
||||
'$platformLineSep # assets:$platformLineSep',
|
||||
'$platformLineSep assets:$platformLineSep - assets/read-only.txt$platformLineSep',
|
||||
);
|
||||
await pubspec.writeAsString(content, flush: true);
|
||||
|
||||
@@ -69,8 +70,8 @@ Future<void> main() async {
|
||||
|
||||
content = await pubspec.readAsString();
|
||||
content = content.replaceFirst(
|
||||
'\ndependencies:\n',
|
||||
'\ndependencies:\n device_info: 0.4.1\n package_info: 0.4.0+9\n',
|
||||
'${platformLineSep}dependencies:$platformLineSep',
|
||||
'${platformLineSep}dependencies:$platformLineSep device_info: 0.4.1$platformLineSep package_info: 0.4.0+9$platformLineSep',
|
||||
);
|
||||
await pubspec.writeAsString(content, flush: true);
|
||||
await inDirectory(projectDir, () async {
|
||||
|
||||
@@ -12,6 +12,7 @@ import 'package:path/path.dart' as path;
|
||||
final String gradlew = Platform.isWindows ? 'gradlew.bat' : 'gradlew';
|
||||
final String gradlewExecutable = Platform.isWindows ? '.\\$gradlew' : './$gradlew';
|
||||
final String fileReadWriteMode = Platform.isWindows ? 'rw-rw-rw-' : 'rw-r--r--';
|
||||
final String platformLineSep = Platform.isWindows ? '\r\n': '\n';
|
||||
|
||||
/// Tests that the Flutter module project template works and supports
|
||||
/// adding Flutter to an existing Android app.
|
||||
@@ -60,8 +61,8 @@ Future<void> main() async {
|
||||
final File pubspec = File(path.join(projectDir.path, 'pubspec.yaml'));
|
||||
String content = await pubspec.readAsString();
|
||||
content = content.replaceFirst(
|
||||
'\n # assets:\n',
|
||||
'\n assets:\n - assets/read-only.txt\n',
|
||||
'$platformLineSep # assets:$platformLineSep',
|
||||
'$platformLineSep assets:$platformLineSep - assets/read-only.txt$platformLineSep',
|
||||
);
|
||||
await pubspec.writeAsString(content, flush: true);
|
||||
|
||||
@@ -69,8 +70,8 @@ Future<void> main() async {
|
||||
|
||||
content = await pubspec.readAsString();
|
||||
content = content.replaceFirst(
|
||||
'\ndependencies:\n',
|
||||
'\ndependencies:\n device_info: 0.4.1\n package_info: 0.4.0+9\n',
|
||||
'${platformLineSep}dependencies:$platformLineSep',
|
||||
'${platformLineSep}dependencies:$platformLineSep device_info: 0.4.1$platformLineSep package_info: 0.4.0+9$platformLineSep',
|
||||
);
|
||||
await pubspec.writeAsString(content, flush: true);
|
||||
await inDirectory(projectDir, () async {
|
||||
|
||||
@@ -9,6 +9,8 @@ import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/utils.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
final String platformLineSep = Platform.isWindows ? '\r\n': '\n';
|
||||
|
||||
/// Tests that a plugin A can depend on platform code from a plugin B
|
||||
/// as long as plugin B is defined as a pub dependency of plugin A.
|
||||
///
|
||||
@@ -150,14 +152,14 @@ public class DummyPluginBClass {
|
||||
final File pluginApubspec = File(path.join(pluginADirectory.path, 'pubspec.yaml'));
|
||||
String pluginApubspecContent = await pluginApubspec.readAsString();
|
||||
pluginApubspecContent = pluginApubspecContent.replaceFirst(
|
||||
'\ndependencies:\n',
|
||||
'\ndependencies:\n'
|
||||
' plugin_b:\n'
|
||||
' path: ${pluginBDirectory.path}\n'
|
||||
' plugin_c:\n'
|
||||
' path: ${pluginCDirectory.path}\n'
|
||||
' plugin_d:\n'
|
||||
' path: ${pluginDDirectory.path}\n',
|
||||
'${platformLineSep}dependencies:$platformLineSep',
|
||||
'${platformLineSep}dependencies:$platformLineSep'
|
||||
' plugin_b:$platformLineSep'
|
||||
' path: ${pluginBDirectory.path}$platformLineSep'
|
||||
' plugin_c:$platformLineSep'
|
||||
' path: ${pluginCDirectory.path}$platformLineSep'
|
||||
' plugin_d:$platformLineSep'
|
||||
' path: ${pluginDDirectory.path}$platformLineSep',
|
||||
);
|
||||
await pluginApubspec.writeAsString(pluginApubspecContent, flush: true);
|
||||
|
||||
|
||||
@@ -72,12 +72,6 @@
|
||||
"task_name": "linux_gradle_plugin_fat_apk_test",
|
||||
"flaky": false
|
||||
},
|
||||
{
|
||||
"name": "Linux gradle_plugin_light_apk_test",
|
||||
"repo": "flutter",
|
||||
"task_name": "linux_gradle_plugin_light_apk_test",
|
||||
"flaky": false
|
||||
},
|
||||
{
|
||||
"name": "Linux gradle_r8_test",
|
||||
"repo": "flutter",
|
||||
@@ -264,6 +258,12 @@
|
||||
"task_name": "mac_tool_tests",
|
||||
"flaky": false
|
||||
},
|
||||
{
|
||||
"name": "Windows build_aar_module_test",
|
||||
"repo": "flutter",
|
||||
"task_name": "win_build_aar_module_test",
|
||||
"flaky": false
|
||||
},
|
||||
{
|
||||
"name": "Windows build_tests",
|
||||
"repo": "flutter",
|
||||
@@ -288,6 +288,18 @@
|
||||
"task_name": "win_gradle_fast_start_test",
|
||||
"flaky": false
|
||||
},
|
||||
{
|
||||
"name": "Windows gradle_jetifier_test",
|
||||
"repo": "flutter",
|
||||
"task_name": "win_gradle_jetifier_test",
|
||||
"flaky": false
|
||||
},
|
||||
{
|
||||
"name": "Windows gradle_plugin_light_apk_test",
|
||||
"repo": "flutter",
|
||||
"task_name": "win_gradle_plugin_light_apk_test",
|
||||
"flaky": false
|
||||
},
|
||||
{
|
||||
"name": "Windows gradle_non_android_plugin_test",
|
||||
"repo": "flutter",
|
||||
@@ -312,12 +324,30 @@
|
||||
"task_name": "win_gradle_r8_test",
|
||||
"flaky": false
|
||||
},
|
||||
{
|
||||
"name": "Windows module_custom_host_app_name_test",
|
||||
"repo": "flutter",
|
||||
"task_name": "win_module_custom_host_app_name_test",
|
||||
"flaky": false
|
||||
},
|
||||
{
|
||||
"name": "Windows module_host_with_custom_build_test",
|
||||
"repo": "flutter",
|
||||
"task_name": "win_module_host_with_custom_build_test",
|
||||
"flaky": false
|
||||
},
|
||||
{
|
||||
"name": "Windows module_test",
|
||||
"repo": "flutter",
|
||||
"task_name": "win_module_test",
|
||||
"flaky": false
|
||||
},
|
||||
{
|
||||
"name": "Windows plugin_dependencies_test",
|
||||
"repo": "flutter",
|
||||
"task_name": "win_plugin_dependencies_test",
|
||||
"flaky": false
|
||||
},
|
||||
{
|
||||
"name": "Windows plugin_test",
|
||||
"repo": "flutter",
|
||||
|
||||
@@ -302,6 +302,13 @@
|
||||
"enabled":true,
|
||||
"run_if":["dev/**", "packages/flutter_tools/**", "bin/**"]
|
||||
},
|
||||
{
|
||||
"name": "Windows build_aar_module_test",
|
||||
"repo": "flutter",
|
||||
"task_name": "win_build_aar_module_test",
|
||||
"enabled":true,
|
||||
"run_if":["dev/**", "bin/**"]
|
||||
},
|
||||
{
|
||||
"name": "Windows build_tests",
|
||||
"repo": "flutter",
|
||||
@@ -329,6 +336,13 @@
|
||||
"enabled":true,
|
||||
"run_if":["dev/**", "bin/**"]
|
||||
},
|
||||
{
|
||||
"name": "Windows gradle_jetifier_test",
|
||||
"repo": "flutter",
|
||||
"task_name": "win_gradle_jetifier_test",
|
||||
"enabled":true,
|
||||
"run_if":["dev/**", "bin/**"]
|
||||
},
|
||||
{
|
||||
"name": "Windows gradle_non_android_plugin_test",
|
||||
"repo": "flutter",
|
||||
@@ -350,6 +364,20 @@
|
||||
"enabled":true,
|
||||
"run_if":["dev/**", "bin/**"]
|
||||
},
|
||||
{
|
||||
"name": "Windows module_custom_host_app_name_test",
|
||||
"repo": "flutter",
|
||||
"task_name": "win_module_custom_host_app_name_test",
|
||||
"enabled":true,
|
||||
"run_if":["dev/**", "bin/**"]
|
||||
},
|
||||
{
|
||||
"name": "Windows module_test",
|
||||
"repo": "flutter",
|
||||
"task_name": "win_module_test",
|
||||
"enabled":true,
|
||||
"run_if":["dev/**", "bin/**"]
|
||||
},
|
||||
{
|
||||
"name": "Windows module_host_with_custom_build_test",
|
||||
"repo": "flutter",
|
||||
@@ -357,6 +385,13 @@
|
||||
"enabled":true,
|
||||
"run_if":["dev/**", "bin/**"]
|
||||
},
|
||||
{
|
||||
"name": "Windows plugin_dependencies_test",
|
||||
"repo": "flutter",
|
||||
"task_name": "win_plugin_dependencies_test",
|
||||
"enabled":true,
|
||||
"run_if":["dev/**", "bin/**"]
|
||||
},
|
||||
{
|
||||
"name": "Windows plugin_test",
|
||||
"repo": "flutter",
|
||||
|
||||
Reference in New Issue
Block a user