[ci] Add a legacy Android build-all test (#4005)

Adds the ability to replace portions of the `flutter create`d app with saved copies, and adds a second build-all phase for Android that uses a Flutter 2.0.6-created `android/` directory (AGP 4.1, Gradle 6.7) to catch issues like https://github.com/flutter/flutter/issues/125621 and https://github.com/flutter/flutter/issues/125482 prior to release.

Includes some incidental cleanup:
- Extracts a helper method for adjusting files, so that this doesn't add even more copies of basically identical code.
    - (This was motivated by an earlier version of the PR that added modifications to several more files, which I ended up undoing, but the cleanup seemed worth keeping.)
- Adds missing unit test coverage.
- Reworks the unit tests to use a mock process manager and dummy files, instead of each test actually calling `flutter create`, which made each new test add several seconds to the unit test suite.
    - While this reduces the integration-style coverage, in practice the integration tests of the repo tooling is the CI itself, so the unit tests should be true unit tests.
- Changes the non-legacy test to Kotlin; we were still testing with Java even though Kotlin has been the default for quite a while, so we weren't testing what most new users would actually be running. Since we now have a legacy test, I used Java there to cover both.
- Removes some dead code for modifying the AndroidManifest.xml; when trying to set up unit tests for it I discovered that it no longer matches anything in an actual project. It dates back to the original command, and seems to have been a camera-related hack, which we clearly no longer need since it wasn't working and camera still works in build-all.

This is captured somewhat in the README in the legacy project directory, but to document the approach here: originally I was going to add flags to change individual items (AGP version, Gradle version), but quickly ran into the fact that selective downgrading is extremely fragile. E.g.,:
- The Kotlin version set in current projects doesn't work when downgrading AGP and Gradle.
- The app template can unconditionally use anything (e.g., `namespace`) that the AGP version it uses supports, so arbitrary future breakage is possible.

It's also less useful as a real test of what a plugin client's project likely looks like. Starting with a complete platform directory, and doing whatever the minimal changes are to keep it working, will likely reflect a common real-world scenario. On the flip side, the reason this doesn't use a complete 2.0.6 project, but instead is based on specific platform directories, is that we don't want to waste time manually maintaining, e.g., old Dart code that is irrelevant to the goal of the test. For now this only uses Android because that's where we've seen problems in practice, but we can alway add other legacy platform tests later if we find a need.

Fixes https://github.com/flutter/flutter/issues/125689
27 files changed
tree: 74ddc9c5f0ba73fb4dc4878a5669819f26b62e85
  1. .ci/
  2. .github/
  3. packages/
  4. script/
  5. third_party/
  6. .ci.yaml
  7. .cirrus.yml
  8. .clang-format
  9. .gitattributes
  10. .gitignore
  11. .gitmodules
  12. .metadata
  13. analysis_options.yaml
  14. AUTHORS
  15. CODEOWNERS
  16. CONTRIBUTING.md
  17. customer_testing.bat
  18. customer_testing.sh
  19. LICENSE
  20. README.md
README.md

Flutter Packages

Build Status Release Status OpenSSF Scorecard

This repo is a companion repo to the main flutter repo. It contains the source code for Flutter's first-party packages (i.e., packages developed by the core Flutter team). Check the packages directory to see all packages.

These packages are also available on pub.

Issues

Please file any issues, bugs, or feature requests in the main flutter repo. Issues pertaining to this repository are labeled “package”.

Contributing

If you wish to contribute a new package to the Flutter ecosystem, please see the documentation for developing packages. You can store your package source code in any GitHub repository (the present repo is only intended for packages developed by the core Flutter team). Once your package is ready you can publish to the pub repository.

If you wish to contribute a change to any of the existing packages in this repo, please review our contribution guide, and send a pull request.

Packages

These are the packages hosted in this repository:

PackagePubPointsPopularityIssuesPull requests
animationspub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
camerapub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
cross_filepub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
css_colorspub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
cupertino_iconspub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
espressopub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
extension_google_sign_in_as_googleapis_authpub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
file_selectorpub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
flutter_adaptive_scaffoldpub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
flutter_imagepub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
flutter_lintspub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
flutter_markdownpub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
flutter_plugin_android_lifecyclepub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
flutter_template_imagespub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
go_routerpub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
go_router_builderpub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
google_maps_flutterpub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
google_sign_inpub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
image_pickerpub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
in_app_purchasepub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
ios_platform_imagespub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
local_authpub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
metrics_centerpub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
multicast_dnspub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
palette_generatorpub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
path_providerpub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
pigeonpub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
pointer_interceptorpub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
plugin_platform_interfacepub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
quick_actionspub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
rfwpub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
shared_preferencespub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
standard_message_codecpub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
url_launcherpub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
video_playerpub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
web_benchmarkspub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
webview_flutterpub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label
xdg_directoriespub packagepub pointspopularityGitHub issues by-labelGitHub pull requests by-label