Removes `.flutter-plugins` reference from example by (1) deleting the `packages/animations/example/android` directory, (2) running (in the `packages/animations` directory)
```
flutter create example --platforms android -a kotlin --org "dev.flutter.packages.animations"
```
and then (3) manually made the following changes:
- Added back `packages/animations/example/android/.pluginToolsConfig.yaml` (removed by command)
- Updated the Gradle version from 8.7 to 8.3 (downgraded by command)
- Deleted `example/analysis_options.yaml` (added by command)
- Deleted `example/test/` (added by command)
- Added back artifact hub
- Removed template TODOs
- Bumped Kotlin Gradle version to 1.9.0
- Bumped AGP version from 8.1.0 to 8.5.1.
Part of https://github.com/flutter/flutter/issues/157660.
Now that `stable` requires AGP 7.0, which in turn requires Java 11+, we should be able to set our compatibility version to 11 (setting the min Flutter SDK version to current stable).
Also removes the gradle conditionals for setting namespace (and the repo tool checks that it is present), as that was only needed for AGP 4.1 compatibility.
Part of https://github.com/flutter/flutter/issues/156111
- Adds artifact hub check to gradle command
- Add tests for build.gradle and settings.gradle check
- Update all example build.gradle and settings.gradle files
flutter/flutter/issues/120119
Expansion of https://github.com/flutter/packages/pull/4567
https://github.com/flutter/packages/pull/3973 caused an out-of-band
failure after publishing, because an example that uses `url_launcher`
had a too-old Kotlin version set. This is not something we consider
client-breaking because `flutter` prodives a very clear error message
with a straightforward and actionable fix step (update the app's Kotlin
version), so the fix for the breakage is just to update our own
examples.
Since increasingly we're likely to hit problems where modern version of
dependencies don't work with old version of Kotlin, this adds repo-wide
CI enforcement that examples are set to a minimum version (matching the
current `flutter/flutter` template; we can increase this over time as we
feel it's useful to do so).
The recent change to add `namespace` to all plugins broke builds for apps using AGP 4.1 or earlier. This conditionalizes setting the namespace based on whether the property exists at all, making it compatible with both AGP 8.0 and AGP <4.2.
Updates tooling to enforce this for plugin (but not example app) build.gradle files.
Fixes https://github.com/flutter/flutter/issues/125621
While current docs about `targetCompatibility` say that it defaults to `sourceCompatibility`, for older toolchains (AGP?) that is apparently not the case, and it's a build error to set `sourceCompatibility` without `targetCompatibility`.
This adds enforcement that it's set to `gradle-check`, and fixes all of the violations.
Fixes https://github.com/flutter/flutter/issues/125482
Moves the checks for Android warning configuration from `lint-android`, where it made sense to put them at the time, to the new `check-gradle`, which is a newer command specifically for validating that our Gradle files are following best practices.
Makes minor changes to the Pigeon platform test projects to make them conform to the checks, since they are now included in the run. The changes shouldn't actually change the behavior of the Pigeon tests.
Adds a `namespace` attribute to the Android build.gradle, for compatibility with Android Gradle Plugin 8.0, and adds tooling to enforce that it's there.
This is necessary for plugins now; for examples this isn't needed yet, but since it will be needed to eventually update the apps to AGP 8.0 anyway, it's easiest to just enforce it everywhere now.
Adds a repo tool command to validate that all plugins set an explicit Java compatibility version, instead of using whatever the local toolchain happens to be (which creates the potential for issues like https://github.com/flutter/flutter/issues/124839 where our CI passes but builds fail for some clients because our default is newer than theirs).
Currently that's all it checks, but we can add any other gradle best practices we want to enforce here in the future.
This also enables the new check in CI, and fixes all the violations it found.
Fixes https://github.com/flutter/flutter/issues/124839