Skip to content

Commit 2d4a5cc

Browse files
Merge branch 'main' into CaoGiaHieu-dev/main
* main: (56 commits) [go_router_builder] Support extension types (flutter#9458) Roll Flutter from e2a347b14a18 to 34c2a3b158b2 (41 revisions) (flutter#9803) [go_router_builder] Migrate to Element2 API and update dependencies (flutter#9649) [in_app_purchase_storekit] Add support for quantity in consumable product purchases (#171570) (flutter#9698) [pigeon] Improves documentation of `ProxyApi` and moves helper functions to a separate file (flutter#9756) Roll Flutter from 1590543f6794 to e2a347b14a18 (1 revision) (flutter#9784) [camera_avfoundation] Implementation swift migration - part 11 (flutter#9690) [camera_avfoundation] Fix crash when streaming while recording (flutter#9691) Roll Flutter from 38217906e95c to 1590543f6794 (14 revisions) (flutter#9780) Roll Flutter from 92a6bfbfd6ef to 38217906e95c (17 revisions) (flutter#9778) [video_player] Improve KVO handling on iOS (flutter#9718) [dependabot]: Bump the test-dependencies group across 15 directories with 7 updates (flutter#9736) Roll Flutter from 9de63a03428f to 92a6bfbfd6ef (11 revisions) (flutter#9769) [google_maps_flutter_platform_interface] Add Advanced markers support (flutter#9737) [camera_android_camerax] Re-land "Force new Surface for each SurfaceRequest" (flutter#9760) [google_maps_flutter] Add ability to perform Google Maps SDK warmup (flutter#9674) Roll Flutter from 59fc766c6fdf to 9de63a03428f (6 revisions) (flutter#9764) [webview_flutter_wkwebview] Extended Web View API on iOS to add flexibility when working with local HTML content (flutter#8787) [local_auth] Differentiate iOS authentication errors (flutter#9705) manual roll to 59fc766c6fdfd03d0983fc95ce8b76793a300dd5 (flutter#9758) ... # Conflicts: # packages/go_router_builder/lib/src/type_helpers.dart # packages/go_router_builder/pubspec.yaml
2 parents 6b77867 + eab16dd commit 2d4a5cc

File tree

344 files changed

+16123
-6327
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

344 files changed

+16123
-6327
lines changed

.ci.yaml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,6 @@ targets:
250250
251251
# Wasm unit tests in master
252252
- name: Linux_web web_dart_unit_test_wasm_shard_1 master
253-
# Broken on master. See flutter/flutter#170433 and
254-
# flutter/flutter#170434
255-
bringup: true
256253
recipe: packages/packages
257254
timeout: 60
258255
properties:
@@ -268,9 +265,6 @@ targets:
268265
}
269266
270267
- name: Linux_web web_dart_unit_test_wasm_shard_2 master
271-
# Broken on master. See flutter/flutter#170433 and
272-
# flutter/flutter#170434
273-
bringup: true
274268
recipe: packages/packages
275269
timeout: 60
276270
properties:
@@ -400,7 +394,7 @@ targets:
400394
### Android tasks ###
401395
- name: Linux_android android_build_all_packages master
402396
recipe: packages/packages
403-
timeout: 30
397+
timeout: 60
404398
properties:
405399
version_file: flutter_master.version
406400
# This builds the all_packages app only in a current JDK.
@@ -413,7 +407,7 @@ targets:
413407
414408
- name: Linux_android android_build_all_packages stable
415409
recipe: packages/packages
416-
timeout: 30
410+
timeout: 60
417411
properties:
418412
add_recipes_cq: "true"
419413
version_file: flutter_stable.version
@@ -1437,7 +1431,6 @@ targets:
14371431
recipe: packages/packages
14381432
presubmit: false
14391433
timeout: 30
1440-
bringup: true # https://github.com/flutter/flutter/issues/134083
14411434
properties:
14421435
add_recipes_cq: "true"
14431436
target_file: windows_build_all_packages.yaml
@@ -1472,7 +1465,6 @@ targets:
14721465
recipe: packages/packages
14731466
presubmit: false
14741467
timeout: 30
1475-
bringup: true
14761468
properties:
14771469
target_file: windows_build_all_packages.yaml
14781470
channel: stable

.ci/flutter_master.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
70cdc0c933d6b84817d216891953b6eb56e22007
1+
34c2a3b158b2b395cd31351c1e8a94ed4d9892b4

.ci/flutter_stable.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
d7b523b356d15fb81e7d340bbe52b47f93937323
1+
edada7c56edf4a183c1735310e123c7f923584f1

.ci/legacy_project/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,17 @@ and then deleting everything but `android/` from it:
4141
`build.gradle` to maintain compatibility with plugins that use
4242
Flutter's most recently supported API version.
4343
- Modifies `gradle-wrapper.properties` to upgrade the Gradle version
44-
from 6.7 to 8.4. If a user runs into an error with the Gradle
44+
from 8.4 to 8.7. If a user runs into an error with the Gradle
4545
version, the warning is clear on how to upgrade the version to
4646
one that we support.
4747
- Modifies `settings.gradle` to upgrade the Android Gradle Plugin (AGP)
48-
from version 4.1.0 (originally set in `build.gradle`; see bullet below)
49-
to 8.3.0. If a user runs into an error with the AGP version, the warning
48+
from version 8.3.0 (originally set in `build.gradle`; see bullet below)
49+
to 8.6.0. If a user runs into an error with the AGP version, the warning
5050
is clear on how to upgrade the version to one that we support.
5151
- Refactor plugin to use declarative Gradle apply instead of the
5252
imperative apply (this includes moving where the Android Gradle
5353
Plugin (AGP) version is set from `build.gradle` to `settings.gradle`).
54+
- Modifies `settings.gradle` to upgrade the Kotlin Gradle Plugin (KGP)
55+
from version 1.9.0 to 2.1.0. If a user runs into an error with the AGP version,
56+
the warning is clear on how to upgrade the version to one that we support.
57+
- Modifies `gradle.properties` to not set android.enableJetifier=true.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
org.gradle.jvmargs=-Xmx4G
22
android.useAndroidX=true
3-
android.enableJetifier=true

.ci/legacy_project/all_packages/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip

.ci/legacy_project/all_packages/android/settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ pluginManagement {
1919
// See https://github.com/flutter/flutter/blob/master/docs/ecosystem/Plugins-and-Packages-repository-structure.md#gradle-structure for more info.
2020
plugins {
2121
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
22-
id "com.android.application" version "8.3.0" apply false
23-
id "org.jetbrains.kotlin.android" version "1.9.0" apply false
22+
id "com.android.application" version "8.6.0" apply false
23+
id "org.jetbrains.kotlin.android" version "2.1.0" apply false
2424
}
2525

2626
include ":app"

.ci/targets/macos_repo_checks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ tasks:
1313
always: true
1414
- name: validate iOS and macOS podspecs
1515
script: .ci/scripts/tool_runner.sh
16-
args: ["podspec-check"]
16+
args: ["podspec-check", "--exclude=script/configs/exclude_xcode_deprecation.yaml"]
1717
always: true

AGENTS.md

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# Agent Guide for the Flutter Packages Repository
2+
3+
This document provides guidance for AI agents to effectively contribute to the `flutter/packages` repository.
4+
5+
## Guiding Principles for Contributions
6+
7+
- **Format All Code**: Every code change must be formatted using the repository's tools.
8+
- **Pass All Tests**: All changes must pass linting, analysis, and relevant tests.
9+
- **Update CHANGELOGs**: Any user-facing change or bug fix in a package requires an update to its `CHANGELOG.md` and `pubspec.yaml` version.
10+
- **Follow Conventions**: Adhere to the repository's specific conventions, such as federated plugin structure and code generation steps.
11+
12+
## Agent Environment Setup
13+
14+
To ensure a consistent and functional environment, configure your VM with the following setup. This provides the necessary Flutter SDK and dependencies for building and testing packages.
15+
16+
```bash
17+
curl -L https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.32.8-stable.tar.xz | tar -xJ -C $HOME
18+
export FLUTTER_HOME=$HOME/flutter
19+
export PATH=$FLUTTER_HOME/bin:$PATH
20+
flutter --disable-analytics
21+
flutter precache --force
22+
# Sanity check the configuration.
23+
flutter doctor --verbose
24+
```
25+
26+
## Repository Overview
27+
28+
This is a monorepo containing many Flutter packages.
29+
- First-party packages developed entirely by the Flutter team are in `packages/`.
30+
- Packages that were originally developed by a third party, but are now maintained by the Flutter team are in `third_party/packages/`.
31+
- The repository tooling is in `script/tool/`.
32+
33+
Many packages are part of **federated plugins**. A federated plugin has a main package (e.g., `path_provider`) that defines the API used by plugin clients, a platform interface package (e.g., `path_provider_platform_interface`) that defines the interface that each platform implementation must implement, and one or more platform implementation packages (e.g., `path_provider_android`, `path_provider_ios`) that implement that platform interface. When working on a federated plugin, you may need to modify multiple packages.
34+
35+
For more details, see the main `README.md` and `CONTRIBUTING.md`.
36+
37+
## Core Tooling and Workflows
38+
39+
The primary tool for this repository is `flutter_plugin_tools.dart`.
40+
41+
### Initial Setup
42+
43+
First, initialize the tooling:
44+
```bash
45+
cd $REPO_ROOT/script/tool # $REPO_ROOT is the repository root
46+
dart pub get
47+
```
48+
49+
### Identifying Target Packages
50+
51+
Most tool commands take a `--packages` argument. You must correctly identify all packages affected by your changes. You can derive this from git diff.
52+
53+
For example, to find changed files against the main branch of the upstream remote (assuming the upstream remote is named `origin`):
54+
55+
```bash
56+
git diff --name-only origin/main...HEAD
57+
```
58+
59+
Then, for each file path, find its enclosing package. A package is a directory containing a `pubspec.yaml` file. The directory name is usually the package name. Ignore `pubspec.yaml` files within `example/` directories when determining the package for a file.
60+
61+
#### Targeting All Packages
62+
63+
Running a tool command without a `--packages` argument will run the command on all packages. For example, a dependency can be updated for all packages in the repository:
64+
65+
```bash
66+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart update-dependency --pub-package <dependency_name>
67+
```
68+
69+
### Common Commands
70+
71+
- **Formatting**: Always format your changes.
72+
73+
```bash
74+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart format --packages <changed_packages>
75+
```
76+
- **Testing**: All changes must pass analysis and tests:
77+
78+
```bash
79+
# Run static analysis
80+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart analyze --packages <changed_packages>
81+
# Run Dart unit tests
82+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart dart-test --packages <changed_packages>
83+
```
84+
85+
The tool can also run native and integration tests, but these may require a more complete environment than is available.
86+
- **Validation**: Run these checks to ensure that changes follow team guidelines:
87+
```bash
88+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart publish-check --packages <changed_packages>
89+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart readme-check --packages <changed_packages>
90+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart version-check --packages <changed_packages>
91+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart license-check
92+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart repo-package-info-check
93+
```
94+
95+
### Specialized Workflows
96+
97+
- **Federated Plugin Development**: If you change multiple packages in a federated plugin that depend on each other, use `make-deps-path-based` to make their pubspec.yaml files use `path:` dependencies. This allows you to test them together locally.
98+
```bash
99+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart make-deps-path-based --target-dependencies=<changed_plugin_packages>
100+
```
101+
102+
The CI system will run tests with path-based dependencies automatically, so this is not required for PRs, but can be useful for local testing.
103+
- **Updating Dependencies**: To update a dependency across multiple packages:
104+
```bash
105+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart update-dependency --pub-package <dependency_name> --packages <packages_to_update>
106+
```
107+
- **Updating README Code Samples**: If you change example code that is included in a README.md:
108+
```bash
109+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart update-excerpts --packages <changed_packages>
110+
```
111+
112+
## Code Generators
113+
114+
Some packages use code generators, and changes to those packages require running the relevant code generators.
115+
116+
- **Pigeon**: If you change a file in a `pigeons/` directory, you must run the Pigeon generator:
117+
```bash
118+
# Run from the package's directory
119+
dart run pigeon --input pigeons/<changed_file>.dart
120+
```
121+
- **Mockito**: If you change code in a package that uses `mockito` for tests (check `dev_dependencies` in `pubspec.yaml`), you must run its mock generator:
122+
```bash
123+
# Run from the package's directory
124+
dart run build_runner build -d
125+
```
126+
127+
## Code Style
128+
129+
All code must adhere to the repository's style guides. The `format` command handles most of this, but be aware of the specific style guides for each language, as detailed in [CONTRIBUTING.md](./CONTRIBUTING.md#style):
130+
- **Dart**: Flutter style, formatted with `dart format`.
131+
- **C++**: Google style, formatted with `clang-format`.
132+
- **Java**: Google style, formatted with `google-java-format`.
133+
- **Kotlin**: Android Kotlin style, formatted with `ktfmt`.
134+
- **Objective-C**: Google style, formatted with `clang-format`.
135+
- **Swift**: Google style, formatted with `swift-format`.
136+
137+
## Version and CHANGELOG updates
138+
139+
Any PR that changes non-test code in a package should update its version in pubspec.yaml and add a corresponding entry in CHANGELOG.md.
140+
141+
**This process can be automated**. The `update-release-info` command is the preferred way to handle this. It determines changed packages, bumps versions, and updates changelogs automatically.
142+
```bash
143+
dart run $REPO_ROOT/script/tool/bin/flutter_plugin_tools.dart update-release-info \
144+
--version=minimal \
145+
--base-branch=origin/main \
146+
--changelog="A description of the changes."
147+
```
148+
149+
- `--version=minimal`: Bumps patch for bug fixes, and skips unchanged packages. This is usually the best option unless a new feature is being added.
150+
- When making public API changes, use `--version=minor` instead.
151+
- `--base-branch=origin/main`: Diffs against the `main` branch to find changed packages.
152+
153+
If you update manually, follow semantic versioning and the repository's CHANGELOG format.

0 commit comments

Comments
 (0)