Test the Android embedding v2 (#42708)

* Test the Android embedding v2

* Update integration tests

* Split into shards
This commit is contained in:
Emmanuel Garcia
2019-10-16 21:26:10 -07:00
committed by GitHub
parent 3917e585c9
commit 08c645b3b2
55 changed files with 431 additions and 108 deletions

View File

@@ -13,6 +13,8 @@ import 'package:path/path.dart' as path;
final String gradlew = Platform.isWindows ? 'gradlew.bat' : 'gradlew';
final String gradlewExecutable = Platform.isWindows ? gradlew : './$gradlew';
final bool useAndroidEmbeddingV2 = Platform.environment['ENABLE_ANDROID_EMBEDDING_V2'] == 'true';
/// Tests that the Android app containing a Flutter module can be built when
/// it has custom build types and flavors.
Future<void> main() async {
@@ -53,7 +55,14 @@ Future<void> main() async {
final Directory hostAppDir = Directory(path.join(tempDir.path, 'hello_host_app_with_custom_build'));
mkdir(hostAppDir);
recursiveCopy(
Directory(path.join(flutterDirectory.path, 'dev', 'integration_tests', 'module_host_with_custom_build')),
Directory(
path.join(
flutterDirectory.path,
'dev',
'integration_tests',
useAndroidEmbeddingV2 ? 'module_host_with_custom_build_v2_embedding' : 'module_host_with_custom_build',
),
),
hostAppDir,
);
copy(

View File

@@ -13,9 +13,12 @@ import 'package:path/path.dart' as path;
final String gradlew = Platform.isWindows ? 'gradlew.bat' : 'gradlew';
final String gradlewExecutable = Platform.isWindows ? gradlew : './$gradlew';
final bool useAndroidEmbeddingV2 = Platform.environment['ENABLE_ANDROID_EMBEDDING_V2'] == 'true';
/// Tests that the Flutter module project template works and supports
/// adding Flutter to an existing Android app.
Future<void> main() async {
print(useAndroidEmbeddingV2);
await task(() async {
section('Find Java');
@@ -143,7 +146,14 @@ Future<void> main() async {
final Directory hostApp = Directory(path.join(tempDir.path, 'hello_host_app'));
mkdir(hostApp);
recursiveCopy(
Directory(path.join(flutterDirectory.path, 'dev', 'integration_tests', 'android_host_app')),
Directory(
path.join(
flutterDirectory.path,
'dev',
'integration_tests',
useAndroidEmbeddingV2 ? 'android_host_app_v2_embedding' : 'android_host_app',
),
),
hostApp,
);
copy(