Several dev dependencies, most notably mockito, were only allow as exactly pinned versions, in order to avoid out-of-band breakage due to deprecations in minor version updates. Now that the policy for Flutter repos has changed to not include deprecation warnings in analysis, this is no longer an issue, so we can relax these dependencies to follow the more normal pattern of using ranges.
macOS privacy manifest enforcement is rolling out soon, so this brings all macOS plugins into alignment with our iOS policy of always having a manifest, including updating the repo tooling to enforce that.
Very few plugins are affected because most share the implementation package with iOS, and we didn't do any target platform switching when adding the manifests for iOS, automatically covering macOS as well.
Fixes https://github.com/flutter/flutter/issues/155564
Upgrades all AGP versions less than 8 to latest. The primary motivation is to prepare for https://github.com/flutter/flutter/issues/136879#issuecomment-2292073921, which requires that plugins use a non-7.3 version. We believe it only affects version 7.3 - I'm going to test this, but am not sure the exact range yet and updating is independently valuable, so I just updated all pre 8 versions (it doesn't affect 8+).
Also:
- Upgrades Gradle versions as required
- Marks the use of `Camera2Interop` with `@OptIn`, as it is required by the newer AGP version.
- Changes the Camerax example java directory path to align with the package xml attribute/AGP namespace attribute.
- Sets `android.buildFeatures.buildConfig` to true for compatibility with AGP 8.0+ in some places.
- Sets `exported=true` in a manifest, requires for AGP bump.
- Updates espresso in some examples, required by the AGP bump (0.2.0 isn't compatible with AGP 8.0+).
Also related to https://github.com/flutter/flutter/issues/146660
Attempt to re-enable integration tests on the `google_maps_flutter_web` package, post-package:web migration, see what happens.
Part of: https://github.com/flutter/packages/pull/7087
This PR:
* Modifies the `version_check_command` test so it checks the leading markdown of the first line of a CHANGELOG file, to ensure it's `'##'`.
* Fixes the CHANGELOG in two packages that were allowed by the tool before this fix:
* google_maps_flutter_web
* interactive_media_ads
## Issues
Fixes https://github.com/flutter/flutter/issues/152638
When running publish-check, any pre-publish hook must be run before the `publish --dry-run` step as the latter succeeding may depend on the former.
Part of https://github.com/flutter/flutter/issues/150210
I was unsure if we wanted to add a new platform option for this or add a `--wasm` flag to the command. Adding a `--wasm` flag seems more complicated since we would probably want to add extra handling around proper use of the flag, whereas adding a `web-wasm` platform should require no additional checks.
This is in preparation for https://github.com/flutter/flutter/issues/151664
Adds the ability for a package to specify a script that should be run before publishing. To minimize the chance of such a script breaking things only in the post-submit `release` step, if the script is present it will also be run during `publish-check`.
These should be used with caution since they can cause the published artifacts to be different from that is checked in, but in the intended use case of extension builds this risk is far preferable to the risks associated with checking in binaries that were built on local, ad-hoc basis. (Longer term, we may need an alternate solution however, as generating artifacts in CI can have its own supply chain validation issues.)
Also does some minor refactoring to custom test script code to make it follow the same pattern as this new code.
Fixes https://github.com/flutter/flutter/issues/150210
Configures the flutter/packages CI to run web tests using the `canvaskit` renderer, which is the new default for web apps.
It also does some minor changes:
* Skips tests on the web for `package:palette_generator` (cleanup issue created below)
* Makes the `palette_generator` example run on the web. This was used to manually verify that the package still works as expected with canvaskit.
* Tweaks the README of the `pointer_interceptor` example apps, so they match what's happening in there.
## Issues
* Fixes https://github.com/flutter/flutter/issues/143543
Co-authored-by: David Iglesias <ditman@gmail.com>
* Migrates to `package:web` https://github.com/flutter/flutter/issues/139749
* Updates `HttpRequestFactory.request` to use `package:http` `BrowserClient`
* Updates `ìndex.html` in the example to use `flutter_bootstrap.js`
* Updates minimum dart sdk requirement to `^3.3.0`
Would appreciate help with completing the mock tests if in case it does not work.
(I am somehow stuck with 'loading...' when attempting to test with mockito with --platform chrome)
Integration tests from what i was able to test passes.
Migrated to using BrowserClient for web due to issues creating mock tests with `XMLHttpRequest` which is returned from `package:web`'s `HttpRequest.request` following error:
`Bad state: Interface type 'XMLHttpRequest' which is nether an enum, nor a class, nor a mixin. This case is unknown, please report a bug.`
Co-authored-by: David Iglesias <ditman@gmail.com>
Co-authored-by: Navaron Bracke <brackenavaron@gmail.com>
Per https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#dependencies, we generally do not want third-party dependencies. `path_provider` in particular is a key part of the ecosystem (well over 1,000 packages depend directly on it, and transitively it's probably several times that at least), and thus the maintenance and security considerations are particularly acute.
This eliminates the dependency on `win32`, a large third-party dependency, in favor of direct FFI code written from scratch using the official Win32 reference documentation from Microsoft as the source. The only behavioral change that should result here is that the exceptions thrown in failure cases have changed, but they were never documented, and were entirely platform-specific, so it's relatively unlikely that people will be broken by that. (As noted in a TODO, the longer term solution is to provide real exceptions for this package, and use those across platforms.)
Fixes https://github.com/flutter/flutter/issues/130940
The logic for handling Dart unit test `test_on` directives was incorrect, causing it to skip packages that required vm testing, even when run in vm mode. This PR:
- Adds the missing tests for false negatives.
- Reworks the logic to explicitly fail for anything that isn't one of the exact patterns we are expecting, to make it much harder to re-introduce a bug like this in the future.
Currently if a PR follows the recommended combo PR process for a federated plugin, the main PR will have CI errors that say the PR isn't allowed to do what it is doing, which is confusing, especially to new contributors or reviewers.
This updates the tooling to detect the temporary overrides created by the tooling, and uses that to trigger a different error message that explains that the error is expected, and exists only to prevent accidental landing.
Fixes https://github.com/flutter/flutter/issues/129303
macOS 14 added new requirements that un-codesigned sandbox apps must be granted access when changed. Waiting for this UI caused macOS tests to fail on macOS 14. Additionally, adding codesigning is not sufficient, since it must still be approved before codesigning is enough to pass the check. As a workaround, this PR disables sandboxing for macOS tests in CI.

https://developer.apple.com/documentation/updates/security#June-2023)
> App Sandbox now associates your macOS app with its sandbox container using its code signature. The operating system asks the person using your app to grant permission if it tries to access a sandbox container associated with a different app. For more information, see [Accessing files from the macOS App Sandbox](https://developer.apple.com/documentation/security/app_sandbox/accessing_files_from_the_macos_app_sandbox).
And that link explains why this is happening on a macOS 14 update:
> In macOS 14 and later, the operating system uses your appâs code signature to associate it with its sandbox container. If your app tries to access the sandbox container owned by another app, the system asks the person using your app whether to grant access. If the person denies access and your app is already running, then it canât read or write the files in the other appâs sandbox container. If the person denies access while your app is launching and trying to enter the other appâs sandbox container, your app fails to launch.
>
> The operating system also tracks the association between an appâs code signing identity and its sandbox container for helper tools, including launch agents. If a person denies permission for a launch agent to enter its sandbox container and the app fails to start, launchd starts the launch agent again and the operating system re-requests access.
Fixes packages part of https://github.com/flutter/flutter/issues/149264.
Verified tests pass:
https://ci.chromium.org/ui/p/flutter/builders/staging.shadow/Mac_arm64%20macos_platform_tests%20master%20-%20packages/6/overview
In part of the documentation, Flutter is spelled out with a typo. I fixed it using a repository search.
- [] The title of the PR starts with the name of the package surrounded by square brackets, e.g. `[shared_preferences]`
Updates all links to the Flutter wiki to point to their new location in the flutter/flutter repository. (The sole exception is a link to a doc that doesn't have a final home yet, and is linked from legacy code anyway so doesn't really need to be updated.)
While touching the PR template, makes a few minor improvements:
- Removes the breaking change discussion that doesn't apply to this repository, as breaking changes are handled totally differently for packages (and is covered by the link to docs about Dart versioning).
- Adds text and a link to reflect the fact that some PRs can be changelog-exempt.
Converts native unit tests from Objective-C to Swift, as a first step toward an eventual plugin conversion. Since OCMock usage was removed in a previous PR, the tests are converted essentially directly (the rewrites were largely mechanical syntax replacement), without any changes needed to production code.
There are a few places where interacting with the Pigeon-generated Obj-C is somewhat awkward because the NSError signature isn't auto-converting to `throw` in cases where we use `NSNumber` wrapping, but all that will get cleaned up when we switch the plugin over to Swift Pigeon generation and have idiomatic Swift APIs that the tests will be calling instead.
Fixes a couple of false positives in the repo tooling surfaced by this PR:
- `darwin/Tests/` wasn't recognized as a test directory.
- Swift tests weren't recognized as exempt from requiring Swift entries in the podspec.
Part of https://github.com/flutter/flutter/issues/119104
Changes webview_flutter , webview_flutter_android tests to run on emulators running SDK 34 for Android. I also
1. Changed all `unawaited` calls in non-legacy tests to `await`. I believe several of the setup steps need to be completed before running checks based on testing, so this should leave the tests safer overall.
2. Changing the integration test directory structures look like what is described in [the integration_test packages instructions](https://github.com/flutter/flutter/blob/master/packages/integration_test/README.md#package-structure). Without changing the package to this structure, CI seemed to run the tests in parallel. I am still trying to figure out why this is but no longer want to block this PR.
Also removes shards for testing packages against Android 33 since no packages are running on emulators running Android 33 anymore.
Fixes https://github.com/flutter/flutter/issues/140001. Fixes https://github.com/flutter/flutter/issues/137083.
Usually when an iOS plugin uses Swift files, it requires a workaround in the podspec to add Swift to the search paths. Part of the `podspec-check` command is validating this workaround is found. However, when the only Swift file is the `Package.swift` (Swift Package Manager manifest), skip this validation since having this file does not indicate the plugin uses Swift files.
Fixes https://github.com/flutter/flutter/issues/147548.
- Adds `build_runner`, `mockito`, and `pigeon` to the list of dependencies that we expect to only be in dev_dependencies.
- Fixes the error message for violations; I had missed in initial review that the errorr message was the same as the one for non-repo-local depndencies, making it misleading about what the problem was and how to fix it. (Also fixed the indentation, which had always been wrong.)
- Fixes `camera_avfoundation`, which had a violation introduced in my recent PR to start the Pigeon conversion.
See https://github.com/flutter/flutter/issues/117905
*Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.*
Additional checks as a followup to https://github.com/flutter/packages/pull/6446
*List which issues are fixed by this PR. You must list at least one issue.*
Related to https://github.com/flutter/flutter/issues/145992
*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
Create a linter that ensures that `integration_test` is not used in dependencies.
Will be paired with a change to documentation
```
If you are considering adding an external dependency:
Consider other options, and discuss with #hackers-ecosystem in Discord.
* If you add a dev_dependency on an external package, pin it to a specific version if at all possible.
* If you add a dependency on an external package in an example/, pin it to a specific version if at all possible.
* Some dependencies should only be linked as dev dependencies like integration_test
```
Related to flutter/flutter/issues/145992
Reverts: flutter/packages#6416
Initiated by: ditman
Reason for reverting: Failures happen (later) in other plugins (more updates in the related issue)
https://github.com/flutter/flutter/issues/145866
Original PR Author: ditman
Reviewed By: {jmagman}
This change reverts the following previous change:
Adds `--allow-warnings` to podspec_check_command.dart so stuff can keep rolling.
**To be removed soon!**
Adds the flowing to the tool:
- A new `--exact-match-only` flag to be used with `--packages` to prevent group matching (i.e., a selection like `--packages=path_provider --exact-match-only` would only run on `packages/path_provider/path_provider`, not `packages/path_provider/*`).
- Two new `publish` command flags:
- `--tag-for-auto-publish`, to do all the steps that `publish` currently does except for the real `pub publish`, so it would dry-run the publish and then create and push the tag if successful.
- `--already-tagged`, to skip the step of adding and pushing a tag, and replace it with a check that `HEAD` already has the expected tag.
This set of additions supports a workflow where the current `release` step is changed to use `--tag-for-auto-publish`, and then the separate auto-publish system would publish each package with `... publish --already-tagged --packages=<some package> --exact-match-only`.
See https://github.com/flutter/packages/pull/5005#discussion_r1344542422 for previous discussion/context.
Part of https://github.com/flutter/flutter/issues/126827