flutter/dev/integration_tests
Gray Mackall d1d9954c45
Support host android apps with kts gradle files for add to app (#156502)
Allows applying of `include_flutter.groovy` via the `apply from:` syntax, which allows using a host app that is using the Gradle Kotlin DSL (the default these days when creating an Android app in AS).

Explanation: The `include_flutter.groovy` script is currently not able to be called by Kotlin gradle files, because it is [intended to be invoked with the following lines](https://docs.flutter.dev/add-to-app/android/project-setup#depend-on-the-modules-source-code):
```
setBinding(new Binding([gradle: this]))                                // new
evaluate(new File(                                                     // new
    settingsDir.parentFile,                                            // new
    'flutter_module/.android/include_flutter.groovy'                   // new
))
```

`setBinding` isn't part of the Kotlin gradle DSL, and there isn't (that I can find) an easy Kotlin equivalent. If this binding isn't set, the reference to `gradle` in `include_flutter.groovy` is wrong, which breaks the script.

This PR modifies `include_flutter.groovy` to also support being invoked through the standard way of invoking a script via the Gradle Groovy/Kotlin DSLs, which is `apply from:` (or it's slightly different Kotlin syntax). The start of the script identifies which of the two approaches is being used by checking if the binding is set, and then initializes some variables differently depending on the case.

If we land this, I believe we should update the example Gradle files for both the `kts` and `groovy` cases to prefer the `apply from` syntax as I think this is the syntax most developers would be more familiar with already seeing in their Gradle files.
2024-10-16 22:47:27 +00:00
..
abstract_method_smoke_test Manual roll to 48ddaf578fb0c8326d5b4b680b0f49ea72e33216 (#155070) 2024-09-12 17:58:12 +00:00
android_embedding_v2_smoke_test Roll pub packages (#155846) 2024-10-01 22:45:08 +00:00
android_module_host_with_custom_build_v2_embedding/app/src/main/java/io/flutter/addtoapp Fix package declarations for add-to-app integration tests (#77648) 2021-03-30 14:19:02 -07:00
android_semantics_testing Reverts "Manual pub roll (#156549)" (#156607) 2024-10-11 18:52:18 +00:00
android_verified_input Reverts "Manual pub roll (#156549)" (#156607) 2024-10-11 18:52:18 +00:00
android_views Reverts "Manual pub roll (#156549)" (#156607) 2024-10-11 18:52:18 +00:00
channels Reverts "Manual pub roll (#156549)" (#156607) 2024-10-11 18:52:18 +00:00
deferred_components_test Reverts "Manual pub roll (#156549)" (#156607) 2024-10-11 18:52:18 +00:00
external_textures Reverts "Manual pub roll (#156549)" (#156607) 2024-10-11 18:52:18 +00:00
flavors Reverts "Manual pub roll (#156549)" (#156607) 2024-10-11 18:52:18 +00:00
flutter_gallery Reverts "Manual pub roll (#156549)" (#156607) 2024-10-11 18:52:18 +00:00
gradle_deprecated_settings Reverts "Manual pub roll (#156549)" (#156607) 2024-10-11 18:52:18 +00:00
hybrid_android_views Reverts "Manual pub roll (#156549)" (#156607) 2024-10-11 18:52:18 +00:00
ios_add2app_life_cycle Roll pub packages (#155846) 2024-10-01 22:45:08 +00:00
ios_app_with_extensions Roll pub packages (#155846) 2024-10-01 22:45:08 +00:00
ios_host_app Added missing code block language in docs (#147481) 2024-05-01 14:44:27 +00:00
ios_host_app_swift [iOS] Migrate @UIApplicationMain attribute to @main (#146707) 2024-04-16 22:13:03 +00:00
ios_platform_view_tests Reverts "Manual pub roll (#156549)" (#156607) 2024-10-11 18:52:18 +00:00
link_hook Reverts "Manual pub roll (#156549)" (#156607) 2024-10-11 18:52:18 +00:00
module_host_with_custom_build/.gradle Reland "Branch out android platform view perf testing #60238" 2nd time (#61748) 2020-07-22 18:36:11 -07:00
module_host_with_custom_build_v2_embedding Reland "Update template/test compileSdk, targetSdk, ndk versions" (#153795) 2024-08-21 18:27:00 +00:00
native_driver_test [devicelab] try waiting for first frame. (#156907) 2024-10-15 20:37:09 +00:00
new_gallery Reverts "Manual pub roll (#156549)" (#156607) 2024-10-11 18:52:18 +00:00
non_nullable Roll pub packages (#155846) 2024-10-01 22:45:08 +00:00
platform_interaction Reverts "Manual pub roll (#156549)" (#156607) 2024-10-11 18:52:18 +00:00
pure_android_host_apps Support host android apps with kts gradle files for add to app (#156502) 2024-10-16 22:47:27 +00:00
release_smoke_test Roll pub packages (#155846) 2024-10-01 22:45:08 +00:00
spell_check Roll pub packages (#155846) 2024-10-01 22:45:08 +00:00
ui Reverts "Manual pub roll (#156549)" (#156607) 2024-10-11 18:52:18 +00:00
web Roll pub packages (#155640) 2024-09-25 00:03:57 +00:00
web_compile_tests Manual dependency bump (#152881) 2024-08-06 02:40:27 +00:00
web_e2e_tests Reverts "Manual pub roll (#156549)" (#156607) 2024-10-11 18:52:18 +00:00
wide_gamut_test Roll pub packages (#155846) 2024-10-01 22:45:08 +00:00
windows_startup_test Reverts "Manual pub roll (#156549)" (#156607) 2024-10-11 18:52:18 +00:00
README.md Added missing code block language in docs (#147481) 2024-05-01 14:44:27 +00:00

Automated Flutter integration test suites

Each suite consists of either a complete Flutter app and a flutter_driver specification that drives tests from the UI, or a native app that is meant to integrate with Flutter for testing.

Intended for use with devicelab tests.

If you want to run a driver test locally, to debug a problem with a test, you can use this command from the appropriate subdirectory:

flutter drive -t <test> --driver <driver>

For example:

flutter drive -t lib/keyboard_resize.dart --driver test_driver/keyboard_resize_test.dart