Commit Graph

9783 Commits

Author SHA1 Message Date
Matan Lurey
1e32c00349
Remove synthetic package qualifier for flutter: generate: error. (#163145)
`generateLocalizations` should fail (`flutter gen-l10n`) if `flutter:
generate:` does not exist.

The previous logic was faulty, because it was totally possible to
opt-out of synthetic packages (i.e. in a `l10n.yaml` file), but still
not be specifying `flutter: generate:`, which I _believe_ is supposed to
still be an error.

This came up in https://github.com/flutter/flutter/pull/160289 as
`flutter config --explicit-package-dependencies` is enabled by default,
as the error is no longer thrown. Made a few other small test
forward-fixes that otherwise would break with the switch (but are
expected) as well.
2025-02-12 22:20:50 +00:00
Matan Lurey
063f80d40f
Finish removing null-safety mode, checks, and reporting. (#163153)
Closes https://github.com/flutter/flutter/issues/162846.

At HEAD, including before this PR, it was impossible to use, or pass-in,
an unsound null-safety mode, but we still had code checking for it, and
reported analytics (I think? Some of these are `package:usage` specific
which is defunct).

This PR eradicates the otherwise unused code.
2025-02-12 21:52:02 +00:00
Gray Mackall
c3fc69d18d
Convert dependency version checker to Kotlin source (#162771)
Converts the `dependency_version_checker.kts` script to a Kotlin source
class. Also adds unit tests that depend heavily on mocking, because from
what I can tell you can't create an instance of a Gradle
`org.gradle.api.Project` for testing (so I can't pass a real `Project`
to `DependencyVersionChecker.checkDependencyVersions()`).

Perhaps functionality for unit testing will come in the future:
https://docs.gradle.org/current/userguide/test_kit.html
> At this time, it is focused on functional testing. That is, testing
build logic by exercising it as part of a programmatically executed
build. Over time, the TestKit will likely expand to facilitate other
kinds of tests.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Gray Mackall <mackall@google.com>
Co-authored-by: Reid Baker <hamilton.reid.baker@gmail.com>
2025-02-12 19:42:38 +00:00
Jessy Yameogo
fecbcbd367
explicitly set packageConfigPath for strategy providers (#163080)
- Explicitly set packageConfigPath for strategy providers
- update DWDS version to `24.3.5`

fixes https://github.com/flutter/flutter/issues/161469
2025-02-12 19:41:14 +00:00
Mohellebi abdessalem
09fdf159b9
update mostRecentSemanticVersion to handle strings like "8.6-rc-2" (#158020)
updated mostRecentSemanticVersion func to handle strings like "8.6-rc-2"
.
see :

41006014ab/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy (L815-L824)


## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Gray Mackall <34871572+gmackall@users.noreply.github.com>
2025-02-12 17:44:07 +00:00
Matan Lurey
90a4323cab
Make developing flutter_tools nicer: Use fail instead of throw StateError. (#163094)
Closes https://github.com/flutter/flutter/issues/163091.
2025-02-12 17:24:26 +00:00
Matan Lurey
d0a2c02c6b
Generate a correct .flutter-plugin-dependencies file for iOS/macOS projects (#162834)
Closes https://github.com/flutter/flutter/issues/162704.

/cc @loic-sharma.

I expect I'll have to update some iOS/macOS unit and possibly
integration tests due to this change, but wanted something concrete to
talk about during our 1:1. Feel free to leave comments or questions even
if this PR is in "draft".
2025-02-12 03:09:05 +00:00
Matan Lurey
b728c4c06a
Remove unsound artifacts, remove *Sound qualifier. (#163015)
Towards https://github.com/flutter/flutter/issues/162846.

Removes all of the unsound host artifacts, and then uses their name for
the sound artifacts.

That is, for something like `webPlatformDDCKernelDill`, this PR:

- Changes the web GN builders to only emit the sound SDK, without the
`-sound` suffixes
- Deletes `webPlatformDDCKernelDill` and all usages of it (implicitly
unsound, and unused).
- Renames `webPlatformDDCKernelSoundDill` to `webPlatformDDCKernelDill`.

No user impact expected, as there was no way to use the unsound
artifacts from the Flutter tool.
2025-02-12 02:40:18 +00:00
flutter-pub-roller-bot
c4851857be
Roll pub packages (#163083)
This PR was generated by `flutter update-packages --force-upgrade`.
2025-02-11 23:47:59 +00:00
Ben Konyi
9ee42fd1ec
[ Widget Preview ] Cleanup PreviewDetector code (#163050)
Adds some convenience extensions for working with analyzer APIs and
removes a dependency on an implementation library from a private
analyzer package.
2025-02-11 17:58:01 +00:00
Ben Konyi
e7e5480a57
[ Widget Preview ] Update generated scaffold project to include early preview rendering (#162847)
With this change, `flutter widget-preview start` will launch a working
widget preview environment that can render previews from a target
project.

Also fixes an issue where `--offline` wasn't being respected by some pub
operations.
2025-02-11 16:41:28 +00:00
Jackson Gardner
30b8eb635b
Change the default optimization level to -O2 for wasm in release mode. (#162917)
As per the investigation in
https://github.com/flutter/flutter/issues/162620, we determined that the
soundness we gain from using `-O2` outweighs the perf benefits of `-O4`.
2025-02-10 21:29:35 +00:00
Nate Biggs
1d766ed8d9
Add experimental hot reload flag support to flutter tools (#162889)
Rather than ask users to pass the complicated and long string
`--extra-front-end-options=--dartdevc-canary,--dartdevc-module-format=ddc`
we want a simpler flag to enable the new DDC module system/hot reload.

Technically this flag enables the new module system, not necessarily hot
reload directly. But we only expect people to use the flag to enable hot
reload so I've chosen the name based on that.

---------

Co-authored-by: Nate Biggs <natebiggs@google.com>
2025-02-10 17:23:47 +00:00
Jonah Williams
33a4c95de0
[flutter_tools] remove SkSL bundling and dump skp on compilation. (#162849)
SkSL precompilation was only ever beneficial for iOS. For other
platforms, we recommended against it as Skia generated shaders per
target architecture which could be invalid on other devices. It is no
longer possible to use Skia on iOS.

Delete all Skia shader bundling logic.

Fixes https://github.com/flutter/flutter/issues/80091
2025-02-10 16:54:02 +00:00
Matan Lurey
6cca066620
Revert the preview-device feature, tests, and code that only existed for it. (#162835)
Closes https://github.com/flutter/flutter/issues/162693.

Fortunately due to the power of `git`, it will live forever 🫡
2025-02-08 01:03:25 +00:00
Matan Lurey
2d30cae396
Start removing unsound null safety from the web SDK tools. (#162850)
On an internal chat, I asked:

> Is there a reason I don't understand why `flutter` should still
support "unsound" null-safety modes?

@jonahwilliams:

> I don't believe its possible to have non-null safe flutter code.

---

There is quite a bit of code and branches, so to keep the PRs
understandable/approachable, this first PR removes the ability to have
the `DevFS` implementations for the web SDK choose between sound and
unsound null safety, and removes the mapping accordingly.

The enums still exist, but can be cleaned up in a follow-up PR (you'd
want to rename to remove "sound" as well, ideally).
2025-02-07 20:40:41 +00:00
Michael Goderbauer
c783ce2344
Remove outdated ignores (#162773)
Powered by the new and amazing `unnecessary_ignore` lint.

We're not enabling this lint by default because being able to
temporarily use ignores that don't ignore anything is a powerful tool to
enable migrations. We should turn this lint on locally periodically,
though, and clean up all outdated ignores.
2025-02-06 18:40:25 +00:00
Matan Lurey
0e59f0f64c
flutter build aar regenerates tooling between each build-mode step (#162705)
Closes https://github.com/flutter/flutter/issues/162703.

I still need to do a similar change for `ios|macos`-`framework` in
https://github.com/flutter/flutter/issues/162704.

I added two unit tests, as well as opted in an integration test to the
flag (it will become the default in
https://github.com/flutter/flutter/pull/160289).

/cc @reidbaker @gmackall.
2025-02-06 17:03:02 +00:00
Ben Konyi
0889cca518
[ Widget Preview ] Add support for building and launching the widget preview scaffold (#162326)
This also wires up the preview detector to trigger hot reloads when new
previews are detected or previews are removed.

Note: while this change results in lib/generated_preview.dart being
generated and updated, it's not currently referenced by lib/main.dart
and the preview environment will render a black screen.

---------

Co-authored-by: Andrew Kolos <andrewrkolos@gmail.com>
2025-02-05 20:44:56 +00:00
Srujan Gaddam
d3c96c65e5
Wait until all scripts are loaded in the page before running main for the DDC library bundle format (#162707)
https://github.com/flutter/flutter/issues/162567

- Uses the `bootstrapScript` field in `loadConfig` to run a script after
all scripts have loaded.
- This script just calls a callback that is set up beforehand and calls
main.
- Modifies the callback that calls `dartDevEmbedder.runMain` to wait
until both DWDS called main and all scripts have loaded.
- Unskips hot reload tests now that the race condition should no longer
exist.

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
2025-02-05 01:12:29 +00:00
Srujan Gaddam
5157d2314b
Use recompile-restart instruction when hot restarting on the web (#162616)
recompile has been split into recompile and recompile-restart in the
frontend server so that DDC can distinguish between hot reload
recompiles and hot restart recompiles, and therefore emit rejection
errors only on hot reload.

https://github.com/dart-lang/webdev/issues/2516

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
2025-02-04 21:24:44 +00:00
Srujan Gaddam
f5e8fc35f0
Skip web hot reload tests that test execution for all platforms for now (#162682)
https://github.com/flutter/flutter/issues/162567

There's a general timing error that may occur when loading scripts,
where main might be run before the scripts are done loading, leading to
a crash. These tests test that output is being printed to stdout, and
wait forever for that, leading to timeouts. This is flaky, so the race
condition may or may not occur.

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.

Example of a timeout:
https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20web_tool_tests/50762/overview
2025-02-04 20:10:20 +00:00
Andrew Kolos
db9591cfbf
delete Usage in doctor tests (#162646)
Tiny delete op. Toward https://github.com/flutter/flutter/issues/150575

<details>

<summary> Pre-launch checklist </summary> 


- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

</details>


<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-02-04 18:32:06 +00:00
Andrew Kolos
53a21710cf
delete references to Usage in config_test.dart (#162648)
Fixes https://github.com/flutter/flutter/issues/162413. Toward
https://github.com/flutter/flutter/issues/150575



<details>

<summary> Pre-launch checklist </summary> 


- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

</details>

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-02-04 18:32:06 +00:00
Bartek Pacia
015cfa88d4
Fix FGP's generateLockfiles task always executing its action at configuration time (#162220)
![drake](https://github.com/user-attachments/assets/50ffcda6-263d-48c8-8853-207e757da6e0)

This PR attempts to fix #110559

This PR supersedes #147837

Original attempt at fixing this by @GaryQian: #112723

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
2025-02-04 02:28:35 +00:00
Matan Lurey
4bc1994dde
Delete two unused test fixtures in flutter_tools. (#162643)
Hit these looking at how `integration.shard` and realized they are
unused.
2025-02-04 00:38:49 +00:00
Andrew Kolos
2f2bda3504
[reland] delete FlutterCommand.usageValues (#162550)
Relands https://github.com/flutter/flutter/pull/162468

The original PR broke g3 postsubmit, because there was an override of
`FlutterCommand.usageValues`. This was since deleted.

## Original PR description
toward https://github.com/flutter/flutter/issues/150575. More simple
deletes.

<details>

<summary> Pre-launch checklist </summary> 


- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

</details>

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-02-03 20:26:04 +00:00
Moritz
264bef3cf3
Upgrade package:intl to 0.20.2 (#162591)
Run `flutter update-packages --cherry-pick-package intl
--cherry-pick-version 0.20.2`

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-02-03 19:59:23 +00:00
Gray Mackall
df114fbe9b
Remove default for stripped option in engine/src/flutter/tools/gn, don't strip by default on android (#161546)
Remake of https://github.com/flutter/engine/pull/52852. 

Makes it so that `stripped` defaults to false for android in `gn`
arguments, i.e. we don't strip the Android engine builds. AGP does this
by default when the NDK is installed (and we download it automatically
now after https://github.com/flutter/flutter/pull/159756).

In testing, the step that AGP does to strip symbols adds ~1-2 seconds to
the build.

Adds a tool verification for release app bundle builds that checks to
make sure we have stripped the debug symbols and placed them in the
[`BUNDLE-METADATA`
directory](https://developer.android.com/guide/app-bundle/app-bundle-format).
The check is done by invoking `apkanalyzer`, which takes ~`0.5` seconds,
which is why the check is only enabled for release builds.

BEFORE LANDING: I need to follow up on
https://github.com/flutter/engine/pull/50443#issuecomment-1945644730, to
ensure we start stripping symbols internally as well.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Gray Mackall <mackall@google.com>
2025-02-03 17:07:25 +00:00
Srujan Gaddam
8e2a6fc3fd
Implement hot reload using the DDC library bundle format (#162498)
https://github.com/dart-lang/webdev/issues/2516

- Updates restart/reload code to accept a resetCompiler boolean to
disambiguate between whether this is a full restart and whether to reset
the resident compiler.
- Adds code to call reloadSources in DWDS and handle the response
(including any errors).
- Adds code to invoke reassemble.
- Adds code to emit a script that DWDS can later consume that contains
the changed sources and their associated libraries. This is used to hot
reload. The bootstrapper puts this in the global window. DWDS should be
updated to accept it in the provider itself. See
https://github.com/dart-lang/webdev/issues/2584.
- Adds code to parse module metadata from the frontend server. This is
identical to the implementation in DWDS % addressing type-related lints.
- Adds tests that run the existing hot reload tests but with web. Some
modifications are mode, including waiting for Flutter runs to finish
executing, and skipping a test that's not possible on the web.

Needs DWDS 24.3.4 to be published first and used before we can land.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
2025-02-03 06:10:24 +00:00
flutter-pub-roller-bot
f894e00631
Roll pub packages (#162542)
This PR was generated by `flutter update-packages --force-upgrade`.
2025-01-31 21:54:02 +00:00
Ben Konyi
de872dd864
[ Tool ] Remove use of globals from widget-preview commands (#162522) 2025-01-31 19:17:45 +00:00
auto-submit[bot]
1902fb27a6
Reverts "Delete FlutterCommand.usageValues (#162468)" (#162494)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#162468
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: jtmcdole
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: tree broken (see Mac_arm64 module_test_ios)
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: andrewkolos
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {bkonyi}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
toward https://github.com/flutter/flutter/issues/150575. More simple
deletes.


<details>

<summary> Pre-launch checklist </summary> 


- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

</details>

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-01-31 01:28:19 +00:00
Andrew Kolos
0d7f3712b4
Delete FlutterCommand.usageValues (#162468)
toward https://github.com/flutter/flutter/issues/150575. More simple
deletes.


<details>

<summary> Pre-launch checklist </summary> 


- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

</details>

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-30 21:05:04 +00:00
Gray Mackall
148db22e34
[FGP Kotlin conversion] Convert Deeplink and IntentFilterCheck (#161835)
Converts `Deeplink` and `IntentFilterCheck` from Groovy to Kotlin, and
pulls them out to their own files. Also writes a test for the equals
method for `Deeplink`, as it is a custom equals method.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Gray Mackall <mackall@google.com>
2025-01-30 19:20:26 +00:00
Andrew Kolos
5e76246237
Fix flutter doctor instructions displayed when cmdline-tools (Android SDK) cannot be found (#162281)
Fixes https://github.com/flutter/flutter/issues/161457.

`flutter doctor` tells the user to install missing Android command line
tools by invoking the command line tools (which are missing). Instead,
let's tell the users they can install them from the website (or—more
simply—download Android Studio).


<details>

<summary> Pre-launch checklist </summary> 


- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

</details>

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-30 18:09:27 +00:00
Andrew Kolos
bc7703f886
remove more (simple) usage of package:usage (#162354)
Towards https://github.com/flutter/flutter/issues/150575.

Tries to remove as much `Usage` as possible while avoiding more
complicated bits that require more scrutiny to make sure we aren't
losing test coverage or otherwise regressing. Said another way, almost
the entire diff is just deleting code to send GA3 events, and the
corresponding GA4 code can be found right next to it—making it easy to
verify we aren't losing events/tests.


<details>

<summary> Pre-launch checklist </summary> 


- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

</details>

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-30 18:09:19 +00:00
Camille Simon
fffbf663ff
Removes dev dependencies from generated plugin registrant for non-Android platforms (#161828)
Removes dev dependencies from the generated plugin registrants for all
platforms since they will be removed from release builds (this was
already done for Android, mostly in
https://github.com/flutter/flutter/pull/161343).

Fixes https://github.com/flutter/flutter/issues/161348.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-30 17:51:07 +00:00
Ben Konyi
3e3bb9fdd5
Roll package:vm_service to 15.0.0 and package:leak_tracker to 10.0.9 (#162325) 2025-01-30 15:26:56 +00:00
Camille Simon
522eda00ca
[Android] Fix integration test to check if dev dependencies are removed from release builds + address no non-dev dependency plugin edge case (#161826)
Makes the following change to fix the case where dev dependencies are
stripped in apps that only contain dev dependencies:
- Changes the Flutter Gradle plugin to add the Flutter embedding as a
direct dependency of a Flutter app if it contains no plugins that would
include it transitively (this excludes dev dependencies in release
builds)

Makes the following changes to correct + improve the integration test
that checks if dev dependencies are stripped from release builds:

- Fixes the plugin that was supposed to be as dev dependency to actually
be a dev dependency
- Changes the test structure to check the output of `./gradlew
app:dependencies` (see [more details on this
call](https://docs.gradle.org/current/userguide/viewing_debugging_dependencies.html))
instead of the classes included in the APK. Checking the APK was leading
us astray because it appears obfuscation occurs for release builds.
- Adds more sections, comments, etc.

Fixes https://github.com/flutter/flutter/issues/161780.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.


<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Matan Lurey <matan@lurey.org>
2025-01-29 21:31:59 +00:00
Ben Konyi
2e4b40bdfa
Reland "[ Widget Previews ] Add support for detecting previews and generating code (#161911)"" (#162337)
Reverts flutter/flutter#162327
2025-01-29 02:05:53 +00:00
Gray Mackall
2d11b6a362
Add instructions to download the Gradle wrapper to FGP readme, and add to gitignore (#162332)
Fixes https://github.com/flutter/flutter/issues/161480.

Ended up going with just providing instructions instead of checking in
the binary, as the instructions is just one line.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

Co-authored-by: Gray Mackall <mackall@google.com>
2025-01-29 02:04:50 +00:00
Matan Lurey
8b9b6a39af
Fix tests to prepare for --explicit-package-dependencies and a bug. (#162289)
@camsim99 discovered these would fail here:
https://github.com/flutter/flutter/pull/161826#issuecomment-2617059566.

This fixes in preparation for the flag flipping, and also fixes a bug in
resolving `synthetic-package` I missed (it _can't_ be true if
`--explicit-package-dependencies` is set).
2025-01-29 02:04:50 +00:00
auto-submit[bot]
1807704009
Reverts "[ Widget Previews ] Add support for detecting previews and generating code (#161911)" (#162327)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#161911
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: matanlurey
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Mid-air collision with another Flutter tool
update.
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: bkonyi
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {andrewkolos}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
`flutter widget-preview start` will now look for functions annotated
with `@Preview()` within the developer's project. These functions will
be used to generate
`.dart_tool/widget_preview_scaffold/lib/generated_preview.dart`, which
inserts the returned value from each preview function into a
`List<WidgetPreview>` returned from a `previews()` method that is
invoked by the widget preview scaffold root.

**Example generated_preview.dart:**

```dart
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:foo/foo.dart' as _i1;
import 'package:foo/src/bar.dart' as _i2;
import 'package:widget_preview/widget_preview.dart';

List<WidgetPreview> previews() => [_i1.preview(), _i2.barPreview1(), _i2.barPreview2()];
```
<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-01-28 19:14:26 +00:00
Srujan Gaddam
6d2792de5c
Support hot restart for DDC library bundle format (#162123)
https://github.com/dart-lang/webdev/issues/2516
https://github.com/dart-lang/webdev/issues/2561

- Adds logic to emit newly compiled sources to a file that can be read
by the bootstrapper.
- Adds bootstrapping logic to reload scripts as needed. This involves
implementing the necessary hot restart callback, fetching and processing
the emitted file of newly compiled sources, cache busting, and loading
the scripts onto the page. A lot of this logic is similar or identical
to what we have for internal hot restart support.
- Runs existing hot restart tests with the new bundle format.
- Adds meta tag to run with utf-8 like in
https://github.com/flutter/flutter/pull/161493.
- Uses DWDS 24.3.3.

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
2025-01-28 19:10:20 +00:00
Mohellebi abdessalem
29bb5e7a00
Refactor code inside flutter.groovy (#160250)
remove unnecessary spacing
remove the usage of System.env because it is dynamic .
the getProperty have the ability to take a second argument wich will be
the default value
android studio linter is prompting `Consider using 'configureEach' to
avoid unnecessary configuration`
android studio linter is prompting `Call to 'get' can be keyed access `
android studio linter is prompting `Cannot determine type of 'o'`
## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] All existing and new tests are passing.
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-28 18:23:44 +00:00
Ben Konyi
f25b4b77ff
[ Widget Previews ] Add support for detecting previews and generating code (#161911)
`flutter widget-preview start` will now look for functions annotated
with `@Preview()` within the developer's project. These functions will
be used to generate
`.dart_tool/widget_preview_scaffold/lib/generated_preview.dart`, which
inserts the returned value from each preview function into a
`List<WidgetPreview>` returned from a `previews()` method that is
invoked by the widget preview scaffold root.

**Example generated_preview.dart:**

```dart
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:foo/foo.dart' as _i1;
import 'package:foo/src/bar.dart' as _i2;
import 'package:widget_preview/widget_preview.dart';

List<WidgetPreview> previews() => [_i1.preview(), _i2.barPreview1(), _i2.barPreview2()];
```
2025-01-28 17:59:57 +00:00
Andrew Kolos
a9c50335c7
remove dependency on Usage from Pub class (#162279)
Towards https://github.com/flutter/flutter/issues/150575

Removes more usage of `Usage`. This PR is scoped to removing all
references to it in `pub`-related code.

<details>

<summary> Pre-launch checklist </summary> 


- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

</details>


If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-28 17:32:27 +00:00
Matan Lurey
a3f0704f25
Formalize update_engine_version.{sh|ps1}. (#162118)
Towards https://github.com/flutter/flutter/issues/162201.

**NOTE**: This renames the environment variable to
`FLUTTER_PREBUILT_ENGINE_VERSION`.

---

We occasionally break ourselves, our users, and the Dart up (or is it
down? side-ways) stream repos (i.e. HHH) when we change how the
undocumented
[`update_engine_version.sh`](https://github.com/flutter/flutter/blob/master/bin/internal/update_engine_version.sh)
script, and it's Windows counterpart
[`update_engine_version.ps1`](https://github.com/flutter/flutter/blob/master/bin/internal/update_engine_version.ps1)
work, but have no way of knowing until N days/weeks later when someone
tells us.

For example,
<https://flutter-review.googlesource.com/c/recipes/+/62400>.

This is my attempt to encode "this is what you can guarantee by calling
this script".

It _still_ will be an internal only API that we might rev at any time,
but at least we:

1. Can tell the Dart team "this is tested and how it works"
2. If we want to change it, the tests will keep us from changing it
without informing folks it changed

These tests should (in theory) cover both Linux/MacOS and Windows.

/cc @a-siva
2025-01-25 19:53:17 +00:00
Mouad Debbar
3755fd1f6e
[web] Remove HTML renderer from framework tests (#162038)
- Cleanup many HTML special cases and skips in framework tests.
- Update some dartdocs that referred to the HTML renderer.

For reviewers: it may help if you set `Hide whitespace` to true in
Github. It will help you skip through all the formatting/indentation
changes.
2025-01-24 21:33:27 +00:00
Jenn Magder
f8b9bdceef
When parsing flavors, handle Xcode build configurations that are not lowercase (#161455)
The flavors/Xcode build config/Xcode scheme matching logic tries to be
permissive with casing. Instead of passing the lower-cased config into
`xcodebuild`, instead pass the real configuration name to get the right
casing.

Fixes https://github.com/flutter/flutter/issues/85643

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-24 05:18:33 +00:00
flutter-pub-roller-bot
c518949703
Roll pub packages (#162095)
This PR was generated by `flutter update-packages --force-upgrade`.
2025-01-23 20:45:08 +00:00
Bartek Pacia
558b21abf1
Android templates: update default Kotlin from 1.8.22 to 2.1.0, update default Gradle from 8.9 to 8.12 (#160974) 2025-01-23 19:39:32 +00:00
Chris Bracken
1daa75598b
flutter_tools: flutter_tester is a host artifact (#162047)
This resolves the case where a `flutter test` run is invoked on a target
iOS/Android device, as in `flutter test -d iOS-device`.

Previously `CachedLocalEngineArtifacts` was returning `flutter_tester`
from the local target build directory. `flutter_tester` is a host build
artifact and thus should be returned from the local host engine
directory, not the local target build directory.

Some history: A long time ago, desktop artifacts were produced as part
of the host builds; and in fact, they still are, but ideally shouldn't
be. At some point we added target builds for macOS, Windows, and Linux
embedders, but failed to clean the target artifacts out of the host
builds. Similarly, the desktop target builds should ideally not produce
host artifacts, but that's less problematic. The conflation of the two
is likely why the existing code was working until now.

Related issue: https://github.com/flutter/flutter/issues/38935

Closes: https://github.com/flutter/flutter/issues/162045

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-23 19:23:54 +00:00
Jenn Magder
3850ba32e0
Remove "Mac Designed for iPad" as a discoverable flutter run device (#161459)
It's confusing that the "Mac Designed for iPad" device is discoverabe
for `flutter run`, but if you select it then it complains that's not a
runnable target. It currently only works for `flutter attach`.

Reverts 42317804ee

Fixes https://github.com/flutter/flutter/issues/161250

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-23 18:51:39 +00:00
Loïc Sharma
136d8e576a
Show error on macOS if missing Local Network permissions (#161846)
### Background

macOS Sequoia requires the user's permission to do multicast operations,
which the Flutter tool does to connect to the Dart VM. If the app does
not have permission to communicate with devices on the local network,
the following happens:

1. Flutter tool starts a [multicast
lookup](bb2d34126c/packages/flutter_tools/lib/src/mdns_discovery.dart (L238-L241))
2. The mDNS client [sends data on the
socket](973e8b59e2/packages/multicast_dns/lib/multicast_dns.dart (L219))
4. macOS blocks the operation. Dart's native socket implementation
throws an `OSError`
5. Dart's `Socket.send` [catches the
`OSError`](da6dc03a15/sdk/lib/_internal/vm/bin/socket_patch.dart (L1511-L1515)),
wraps it in a `SocketException`, and [schedules a
microtask](da6dc03a15/sdk/lib/_internal/vm/bin/socket_patch.dart (L1513))
that [reports the exception through the socket's
stream](95f0052267/sdk/lib/_internal/vm/bin/socket_patch.dart (L3011))
([`Socket` is a
`Stream`](https://api.dart.dev/dart-io/Socket-class.html))
6. The mDNS client [does not listen to the socket stream's
errors](973e8b59e2/packages/multicast_dns/lib/multicast_dns.dart (L155)),
so [the error is sent to the current `Zone`'s uncaught error
handler](95f0052267/sdk/lib/async/stream_impl.dart (L553)).

### Reproduction

To reproduce this error on macOS...

1. Open System Settings > Privacy & Security > Local Network and toggle
off Visual Studio Code
2. Run a Flutter app using a physical device

### Fix

Ideally, we'd make `MDnsClient.lookup` throw an exception for this
scenario. Unfortunately, the `MDnsClient` can have multiple lookup
operations in parallel, and the `SocketException` doesn't give us enough
information to match it back to a pending `MDnsClient` request. See
https://github.com/flutter/packages/pull/8450 as an attempt to solve
this in the `MDnsClient` layer.

Instead, this fix introduces a `Zone` in the tool to catch the socket's
uncaught exception.

Follow-up to https://github.com/flutter/flutter/pull/157638

See: https://github.com/flutter/flutter/issues/150131

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-23 18:50:22 +00:00
Daco Harkes
663d020788
[native assets] Roll dependencies (#162068)
Rolling in https://github.com/dart-lang/native/pull/1933.
2025-01-23 13:27:41 +00:00
Daco Harkes
9ded795e63
[native assets] Roll dependencies (#162017)
This PR rolls in a number of breaking changes for native assets:

* Pub workspaces are now supported, this requires a refactoring to how
the `NativeAssetsBuildRunner` is used. Most notably it requires being
explicit about the `runPackageName`. Flutter does not seem to have that
value, but it does have the `projectUri` which can be used to find the
package name via the package config.
* The API for build hooks has been redesigned. This PR updates the
project template, test project files, and test project strings.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-23 09:22:36 +00:00
Matan Lurey
9c960ff7da
Add a better error message when flutter drive --target is used incorrectly. (#162023)
Closes https://github.com/flutter/flutter/issues/62626.
2025-01-23 04:39:13 +00:00
Gray Mackall
64c808b7c8
Add a README with instructions for editing and running tests for the FGP (#161830)
Add a readme with some info.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Gray Mackall <mackall@google.com>
Co-authored-by: Reid Baker <hamilton.reid.baker@gmail.com>
2025-01-23 00:41:08 +00:00
flutter-pub-roller-bot
ad52a6630d
Roll pub packages (#162015)
This PR was generated by `flutter update-packages --force-upgrade`.
2025-01-22 19:29:14 +00:00
Krzysztof Czarnota
e33e4f0476
Enabled provisioning updates and device registration during building xcarchive. (#159622)
Provisioning updates and device registration were disabled when
development team was specified in the xcode project. This lead to build
error when provisioning profile was not present. Now provisioning
updates and device registration are enabled when tool builds codesigned
archive. This will allow to build the iOS version of app without
launching xcode in order to enforce provisioning profile updates.

Issues fixed by this PR.
* https://github.com/flutter/flutter/issues/139212
* https://github.com/flutter/flutter/issues/113977
* https://github.com/flutter/flutter/issues/121702 (partly because
author asks for possibility of passing xcode flags like
allowProvisioningUpdates)



## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] All existing and new tests are passing.
2025-01-22 18:54:08 +00:00
Mohellebi abdessalem
5ffb45bf78
fix failing lint : findByPath requires a specific ordering of project evaluation in aar_init_script.gradle (#159301)
android studio linter is prompting this lint: 

![388711888-61ab84da-4941-4aa4-a42e-fac4c140f4bd](https://github.com/user-attachments/assets/e031c231-8a7e-4b3b-a4a1-1aed3d461ac7)


## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Gray Mackall <34871572+gmackall@users.noreply.github.com>
2025-01-21 19:05:45 +00:00
saltedpotatos
cc44dba520
Don't crash flutter tool if Chrome is not available (#154941)
Instead of unawaiting the future, let's ignore it. 

Fixes issue #154940


I am not sure if tests would be required for this change or not.

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Christopher Fujino <christopherfujino@gmail.com>
Co-authored-by: Andrew Kolos <andrewrkolos@gmail.com>
Co-authored-by: Ben Konyi <bkonyi@google.com>
2025-01-21 10:47:16 +00:00
Daco Harkes
da080e6976
[native assets] Cleanup dead code 2 (#161916)
This PR deletes dead code.

The `FlutterNativeAssetsBuildRunnerImpl` has a `PackageConfig` argument,
so the package config file must exist. This means the `hasPackageConfig`
method is meaningless, it will always return `true`.

The only case where it might have returned false was in the unit test
mock. This unit test is now deleted.

(It must be the case that `flutter_tools` internally ensures `pub get`
has been run in the project before it reaches any code paths that try to
build native assets.)

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-21 09:03:28 +00:00
flutter-pub-roller-bot
3aa979fde7
Roll pub packages (#161924)
This PR was generated by `flutter update-packages --force-upgrade`.
2025-01-21 04:05:40 +00:00
Daco Harkes
883ef85413
[native assets] Cleanup dead code (#161913)
This PR deletes dead code.

Testing: No new use cases covered, all existing use cases covered by
existing tests.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-20 23:04:38 +00:00
Ben Konyi
3bfc25fb9e
[ flutter_tool ] Fix flakiness in doctor_test.dart (#161917)
This test was merging two ZeroExecutionTimeValidationResults into a new
ValidationResult with an actual execution duration set rather than
Duration.zero.

Fixes https://github.com/flutter/flutter/issues/161918
2025-01-20 21:34:29 +00:00
Jason Simmons
747f5fff1e
Initialize dartLoader.rootDirectories so the Web stack trace mapper can convert package source paths (#160383)
See
https://dart.googlesource.com/sdk/+/refs/heads/main/pkg/dev_compiler/web/stack_trace_mapper.dart

Fixes https://github.com/flutter/flutter/issues/158109
2025-01-17 00:40:52 +00:00
Srujan Gaddam
c173e2e29c
Set meta tag in default index (#161493)
The bootstrapping for the DDC module format and library bundle module
format contained a preamble to dynamically set the meta tag to ensure
the document is parsed as utf-8. This doesn't work as the page has
already been parsed at that point. Instead, it should go in the html
directly.

The meta tag should not affect the AMD module format, as require.js
already ensures any loaded scripts are parsed as utf-8.

This tag in general is needed to parse this string correctly:
https://github.com/dart-lang/sdk/blob/main/sdk/lib/core/uri.dart#L4100

This is a follow-up to PR
https://github.com/flutter/flutter/pull/161276.

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
2025-01-16 22:27:08 +00:00
Andrew Kolos
8ef7b93287
remove usage of Usage from build system (#160663)
Towards https://github.com/flutter/flutter/issues/150575

This effectively just removes `Usage` as a dependency of `Environment`
(in build_system.dart). All other changes are a direct result of that.


<details>

<summary> Pre-launch checklist </summary> 


- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

</details>

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-16 21:54:58 +00:00
Andrew Kolos
5a3541c40c
route CLI command usage information through the logger instead of using print (#161533)
Fixes https://github.com/flutter/flutter/issues/158532


<details>

<summary> Pre-launch checklist </summary> 


- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

</details>


<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-16 21:53:58 +00:00
Loïc Sharma
fa04f4a8d2
[SwiftPM] Make 'flutter build ios-framework' generate an empty Package.swift (#161464)
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

### Background

Flutter generates a `Package.swift` file that contains the plugins that
should be built using SwiftPM.

Since Flutter does not support Swift Package Manager in add-to-app
scenarios yet, Flutter uses CocoaPods to build plugins if you call
`flutter build ios-framework`. To ensure `pod install` is rerun, the
tool deleted the `Package.swift` file.

Unfortunately, deleting the `Package.swift` file causes the Xcode
project to no longer build if it has SwiftPM integration. This caused
the [`build_ios_framework_module_test` to fail when SwiftPM was turned
on by
default](https://ci.chromium.org/ui/p/flutter/builders/prod/Mac%20build_ios_framework_module_test/21807/overview).

### Fix

Instead of deleting the `Package.swift` file, we instead generate a
`Package.swift` file with no dependencies. This will invalidate the
fingerprint and cause `pod install` to rerun if the app had plugins that
were previously built using SwiftPM.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-14 21:13:15 +00:00
Camille Simon
818133b8b0
[Android] Actually remove dev dependencies from release builds (#161343)
Revises https://github.com/flutter/flutter/pull/158026 to fix
https://github.com/flutter/flutter/issues/160407.

Makes a number of fixes:

- Fixes Groovy logic that attempted to remove dev dependencies from
release builds to use `<buildType>Api` versus `api` and loop to
configure the project dependencies per build type
- Adds back dependency on embedding to plugin projects since this is
needed regardless (the plugin may not be included in a particularly
typed build but it still needs it for where it's included)
- Fixes integration test to throw and error upon failure, check right
APK for the release build it's testing, and configure the flag need for
`.flutter-plugin-dependencies` to mark plugins as dev dependencies as
expected
- Uses @matanlurey's
[patch](https://github.com/flutter/flutter/issues/160407#issuecomment-2547546038)
to remove dev dependency from the `GeneratedPluginRegistrant` in release
mode

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-14 19:36:52 +00:00
Ben Konyi
0369b35640
Update package revisions to latest (#161525) 2025-01-14 18:22:42 +00:00
Michael Goderbauer
9cab4ffee1
Use wildcards (#161548)
https://dart.dev/language/pattern-types#wildcard
2025-01-14 05:13:41 +00:00
Ben Konyi
b3e65358d7
Add validator execution times to flutter doctor --verbose (#158124)
Should help provide more information for `flutter doctor` timeouts like
we've seen in https://github.com/flutter/flutter/issues/157513
2025-01-13 21:01:44 +00:00
Matan Lurey
5f06c091b9
Explain more specifically how to use flutter drive/what it does (#161450)
_Run integration tests for the project_ is not an accurate statement, as
there is nothing inherently about `flutter_driver` that is for
integration tests (for example, it could be just plain automation,
benchmarking, etc).

In addition, clarifies what the most common two arguments might be and
their defaults.

Co-authored-by: Andrew Kolos <andrewrkolos@gmail.com>
2025-01-13 20:51:02 +00:00
Kishan Dhankecha
01fc23238e
Fixed repeated strings for incompatible Gradle or AGP version in create command (#161223)
Fixed the repeated string which shows the compatible Java version in the
create command.

<img width="1003" alt="image"
src="https://github.com/user-attachments/assets/143634ef-fb36-40ce-8934-a5237d574821"
/>


## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-13 20:35:16 +00:00
Matan Lurey
449079d4f1
Propagate environment variables when flutter drive is invoked. (#161452)
Closes https://github.com/flutter/flutter/issues/161449.

~3 LOC, with 203 lines of tests (including an e2e integration test that
it actually works).

Feedback welcome!

(The reason I'm working on this is the ability to pass environment
variables makes it much easier and less hacky to make
`android_engine_test` configurable, i.e. have different expected outputs
for OpenGLES/Vulkan, compare screenshots locally for deflaking, etc).
2025-01-13 18:48:58 +00:00
Gray Mackall
6e8d80743d
Convert base application name handling to kotlin source (start of FGP kt conversion) (#155963)
Wires up a new gradle subproject defining kotlin classes to be used by
the FGP, so that we can incrementally move the entire plugin to be
written in kotlin source.

Starts by moving a piece of kotlin script.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Gray Mackall <mackall@google.com>
2025-01-13 17:56:06 +00:00
Alex Li
771b8a4197
🔊 [tool] Add a wirelessly connected device name as displayName (#160497)
An improvement for #144634.

A wirelessly connected device will displayed as `Target device 1
(wireless)` in various of places.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-10 20:51:34 +00:00
Lucas SAUDON
900eab1601
removeuseMaterial3: true, in from the template (#160525)
`useMaterial3` was `true` by default for some versions, so I think it
can be removed from the template.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-09 21:18:15 +00:00
Srujan Gaddam
a38abc864c
Support DDC library bundle format and remove support for DDC module format (#161276)
This gets us closer to enabling [hot
reload](https://github.com/dart-lang/sdk/issues/54934) on the web as
this format is a prerequisite. Historically, we added support for the
DDC module format only to enable hot reload, but that format is not
feasible for the goal, so we added the DDC library bundle format. The
DDC library bundle format is currently represented as the combination of
the `ddc` module format and `canary`. We no longer need to support the
old DDC module format.

- Adds build artifacts to build the SDKs for this format (but only in
sound mode as unsound is unsupported), and removes said artifacts for
the DDC module format.
- Update artifact maps and constants to add the new format and remove
the old format.
- Adds handling of the `canaryFeatures` flag.
- Update dwds to 24.3.0 and use the new
`FrontendServerDdcLibraryBundleStrategyProvider`.
- Add bootstrap code for the new format. Kept DDC module format
bootstrap code as it's used internally.
- Updates tests.

I ran `spinning_square` with the new module format to verify that it can
run.

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.
2025-01-09 20:36:43 +00:00
Jonah Williams
a1b5917c28
[flutter_tools] ignore viewpost ime and samsung spam messages. (#161199)
Fixes https://github.com/flutter/flutter/issues/160598
2025-01-09 01:14:47 +00:00
Loïc Sharma
593b40d3e4
Revert "[SwiftPM] Add separate feature flag for the app migration (#158897)" (#161342)
This reverts https://github.com/flutter/flutter/pull/158897 (commit
e7a1b68086) as it is intended to be in the
same release as https://github.com/flutter/flutter/pull/161275.

However, https://github.com/flutter/flutter/pull/161275 had to be
reverted and won't be relanded until after the release cutoff. Hence,
I'm reverting this as well.
2025-01-09 00:30:06 +00:00
auto-submit[bot]
05899f84c6
Reverts "[SwiftPM] Turn on by default (#161275)" (#161339)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#161275
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: loic-sharma
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: failing post submit check
`[build_ios_framework_module_test](https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_arm64%20build_ios_framework_module_test)

```
[2025-01-08 14:19:48.853336] [STDOUT] stdout:            ** BUILD SUCCEEDED **
[2025-01-08 14:19:50.360684] [STDOUT] stdout: [+1522 ms]  ├─Building plugins... (completed in 4.8s)
[2025-01-08 14:19:50.360824] [STDOUT] stdout: [       
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: loic-sharma
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {cbracken, vashworth, jmagman}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
This turns on Swift Package Manager by default:

1. New apps will have Swift Package Manager integration
2. New plugins will support Swift Package Manager
3. Existing apps will continue to use CocoaPods. They can migrate to SwiftPM using `flutter config --enable-swift-package-manager-migration`.

See this mini design doc: https://github.com/flutter/flutter/issues/151567#issuecomment-2455941279

Here's the PR that updates the SwiftPM docs: https://github.com/flutter/website/pull/11495

Part of https://github.com/flutter/flutter/issues/151567

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is [test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on [Discord].

<!-- Links -->
[Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2025-01-08 22:54:47 +00:00
Loïc Sharma
d8c4fc0bc6
[SwiftPM] Turn on by default (#161275)
This turns on Swift Package Manager by default:

1. New apps will have Swift Package Manager integration
2. New plugins will support Swift Package Manager
3. Existing apps will continue to use CocoaPods. They can migrate to
SwiftPM using `flutter config --enable-swift-package-manager-migration`.

See this mini design doc:
https://github.com/flutter/flutter/issues/151567#issuecomment-2455941279

Here's the PR that updates the SwiftPM docs:
https://github.com/flutter/website/pull/11495

Part of https://github.com/flutter/flutter/issues/151567

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-08 21:15:57 +00:00
Matan Lurey
46341c6670
Make the encoding of a YamlNode to a String more explicit. (#161270)
It wasn't clear to me (or @bkonyi, in our
[discussion](https://discord.com/channels/608014603317936148/1326246134238285929))
why `yaml_edit` was being used, and now it is!
2025-01-08 21:14:29 +00:00
Jia Hao
2b51318302
Revert "use uuid from package:uuid instead of from package:usage" (#161292)
Reverts flutter/flutter#161102

This requires a non-trivial update to `package:uuid` internally - see
b/388416319 for more details.
2025-01-08 17:11:29 +00:00
Bartek Pacia
4b23b81828
Remove support for imperative apply of Flutter Gradle Plugin (#160947)
imperative apply has been deprecated since #139690

part of #121541

Doing this will make things easier for us during the conversion of
`flutter.groovy` into Kotlin.
2025-01-07 21:51:59 +00:00
Loïc Sharma
e7a1b68086
[SwiftPM] Add separate feature flag for the app migration (#158897)
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

### Overview

This splits the Swift Package Manager feature in two:

1. **SwiftPM feature**: This builds plugins using SwiftPM (if the app
supports it), and, uses the new app & plugin templates that support
SwiftPM
2. **SwiftPM app migration feature**: this updates an existing Flutter
iOS or macOS app to support Swift Package Manager. This feature requires
the SwiftPM feature - if SwiftPM is off, the app migration is also off.

For now, both features are off by default. We plan to turn on the first
feature in the next stable release. The app migration feature will be
stay off by default until we have higher confidence in the migration.

See this mini design doc:
https://github.com/flutter/flutter/issues/151567#issuecomment-2455941279

Here's the PR that updates the SwiftPM docs:
https://github.com/flutter/website/pull/11495

Part of https://github.com/flutter/flutter/issues/151567

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Andrew Kolos <andrewrkolos@gmail.com>
2025-01-07 19:46:03 +00:00
Matan Lurey
986fd14363
Fold _FlutterTestRunnerImpl into FlutterTestRunner. (#161188)
Closes https://github.com/flutter/flutter/issues/160461.

This pattern is covered by `interface class { ... }` in modern Dart.

See <https://dart.dev/language/class-modifiers#interface>.
2025-01-07 18:11:29 +00:00
Gray Mackall
f3d2204827
[Android] Add .cxx directories to app template .gitignore (#161069)
Fixes (but I still need to write the draft of the blog section so don't
autoclose github 🙏 ) https://github.com/flutter/flutter/issues/160372.

-Module templates [already exclude the entire `.android`
directory](d9b7e56646/packages/flutter_tools/templates/module/common/.gitignore.tmpl (L40)).
-Plugin templates [already exclude
`.cxx`](d9b7e56646/packages/flutter_tools/templates/plugin_shared/android.tmpl/.gitignore).

Modified the existing gitignores with
```
nl=$'\n'
sed -i'' -e '/GeneratedPluginRegistrant.java/a\'$'\n''.cxx/'"\\${nl}"'' $(find . -path \*android/.gitignore)
```
(which was probably not the best way)

Fun fact: apparently the `.gitignore` files (including the ones we copy
to the template apps) aren't indexed for search (the `.gitignore.tmpl`
are, but not the ones that we copy exactly [such as this
one](27ba2f2790/packages/flutter_tools/templates/app/android.tmpl/.gitignore)).

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Gray Mackall <mackall@google.com>
Co-authored-by: Reid Baker <hamilton.reid.baker@gmail.com>
Co-authored-by: Greg Price <gnprice@gmail.com>
2025-01-07 18:09:49 +00:00
jesswrd
481950d3a2
Improve Plugins That Reference V1 Embedding Error Message (#160890)
Improved the error message that appears when using plugins that
reference v1 embedding. The new error message explains why the error
appears and how to fix it.

Fixes #160204

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Gray Mackall <34871572+gmackall@users.noreply.github.com>
2025-01-07 18:06:08 +00:00
Devon Carew
e30bf85231
use uuid from package:uuid instead of from package:usage (#161102)
- use uuid from package:uuid instead of from package:usage

`package:usage` is discontinued and no longer maintained; this removes
one use of it from the flutter_tools codebase.

*List which issues are fixed by this PR. You must list at least one
issue. An issue is not required if the PR fixes something trivial like a
typo.*

See also:
- https://github.com/flutter/flutter/pull/152692
- https://github.com/dart-archive/usage

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-07 17:33:23 +00:00
Reid Baker
b552906977
Set java 11 as expected java version in all templates (#160349)
Bump templates from java 8 to java 11.

fixes https://github.com/flutter/flutter/issues/156111 

I want to talk to @gmackall before merging to talk through the
consequences.


## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

---------

Co-authored-by: Gray Mackall <34871572+gmackall@users.noreply.github.com>
2025-01-07 15:27:23 +00:00
Matan Lurey
bb805fad1e
Rename shellPath to flutterTesterBinPath. (#161189)
Closes https://github.com/flutter/flutter/issues/160462.

Maybe there are people who consider `flutter_tester` as the flutter
"shell", but this is more explicit.
2025-01-07 00:52:45 +00:00
Matan Lurey
16b9fe049d
TestCompiler emits why an error occurred, if applicable, and some refactors to do so (#160984)
Closes https://github.com/flutter/flutter/issues/160218.

Basically, replaces `String?` with `sealed class TestCompilerResult {}`,
and ensures `errorMessage` is propogated.

We'll be using this path now for _all_ integration tests (not just for
web-specific things), so I'd like to get error messages.
2025-01-07 00:20:50 +00:00
Matan Lurey
a9b3f6c042
Update flutter_template_images to 5.0.0. (#161105)
Closes https://github.com/flutter/flutter/issues/160692.

All references of `skeleton` and `app_shared` have been completely
removed, including in `flutter_template_images`.

See https://github.com/flutter/packages/pull/8360.
2025-01-06 20:15:07 +00:00
Devon Carew
f00de04113
update repo to be forward compatible with shelf_web_socket v3.0 (#161101)
- update the engine and flutter_tools to be forward compatible with the
upcoming shelf_web_socket v3.0

*List which issues are fixed by this PR. You must list at least one
issue. An issue is not required if the PR fixes something trivial like a
typo.*

- https://github.com/dart-lang/shelf/issues/457
- https://github.com/dart-lang/shelf/pull/463

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-06 19:51:49 +00:00
Matan Lurey
0c3359df8c
Omit hardcoded --packages=.dart_tool/package_config.json. (#160982)
Closes https://github.com/flutter/flutter/issues/160219.

This hard-coded package configuration is no longer strictly correct
as-of Dart 3.6.0; a pub _workspace_
(https://dart.dev/tools/pub/workspaces) can appear at a higher-level
than a package, and if the package is part of the workspace, tooling is
expected to (automatically) find `.dart_tool/package_config.json` at a
higher-level.

For example, the _engine_ sub-repo uses a
[workspace](9fd5bddc65/engine/src/flutter/pubspec.yaml (L82)),
which means that, for example,
`%ENGINE%/tools/engine_tool/.dart_tool/package_config.json` will _never_
exist (it will be at `%ENGINE%/.dart_tools/package_config.json`.

As currently defined, the test-golden comparator interface will fail
with a package that uses workspaces. By removing the flag (and letting
automatic `--packages` resolution occur), I _believe_ the problem is
automatically resolved (but I'll let CI prove that for us).
2025-01-06 16:25:30 +00:00
Daco Harkes
a6c057c406
[native_assets] Filter hook environment (#161084)
Follow up of https://github.com/flutter/flutter/pull/160672 to filter
the environment keys being passed in to build hooks.

~~Failures don't reproduce locally, so this is a draft PR to see which
environment keys are needed for the tests to succeed on CI.~~

Edit: Fixed issues by stopping to use the
Flutter-self-update-dart-executable and instead using the
Dart-sdk-dart-executable.

Relevant bug (already addressed in Dart standalone).

* https://github.com/dart-lang/native/issues/32

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-01-06 13:05:31 +00:00
Jackson Gardner
2d17299f20
Use the in-tree engine by default when using --local-engine or --local-web-sdk (#161110)
Now that we're in a monorepo, it makes sense to use the in-tree engine
by default when using `--local-engine` or `--local-web-sdk` rather than
looking for a sibling directory like we used to.
2025-01-04 00:42:37 +00:00
Michael Goderbauer
dbf9e32879
Bump characters, collection, meta (#161066)
Follow-up to https://github.com/flutter/flutter/pull/160985.

These were missed by `flutter update-packages --force-upgrade` in
https://github.com/flutter/flutter/pull/160985, likely due to some
circular dependency issue. They've been bumped by hand in this PR.
2025-01-03 02:23:10 +00:00
Daco Harkes
27ba2f2790
[native assets] Roll dependencies (#160672)
This PR rolls in a number of breaking changes from dart-lang/native:

* `BuildMode` is no longer part of the protocol, so Flutter no longer
passes it in.
* This means all code dealing with the name conflict between
`native_assets_cli.BuildMode` and `flutter_tools.BuildMode` has been
cleaned up.
  * Also, the logs no longer mention the build mode.
* The tests still exercise both modes, because linking only happens in
release mode.
* `OS` is no longer part of the main protocol, but of the "code"
"protocol extension".
* The code now aligns more with `OS?` being nullable in a bunch of
places, since it is nullable if there's no code assets.
* The OS-specific config is nested in an object per OS.
* `CCompilerConfig`s fields are non-nullable now.
* So instead of passing an object with nullable fields around, a null
instead of the object is returned in various places.
* `FileSystem` is now passed in to the native assets builder.

This PR contains no feature changes.

This PR will need to be followed up by restricting what environment
variables are passed in (similar to
https://github.com/dart-lang/native/pull/1764), I will do this in a
follow up PR.

Tests:

* All existing features should be covered by existing tests.
2025-01-02 19:26:02 +00:00
Michael Goderbauer
d9b7e56646
Manual pub bump (#160985)
Since the autoroller is currently disabled (due to
https://github.com/flutter/flutter/issues/160473) this does a manual
roll of our dependencies to ensure that we don't fall too far behind.
2024-12-31 04:07:34 +00:00
Alex Li
9fd5bddc65
🐛 [tool] Installs the APK regardless of version (#160432)
Resolves https://github.com/flutter/flutter/issues/160402

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-12-30 02:26:27 +00:00
Matan Lurey
4cd0e33013
Implement golden-file matching for integration_test on Android and iOS devices (#160484)
Work towards https://github.com/flutter/flutter/issues/143299.
Work towards https://github.com/flutter/flutter/issues/160043.

---

This PR implements, end-to-end, support for `matchesGoldenFile` when (a)
running with `package:integration_test` (b) on a device, such as an
Android emulator, Android device, iOS simulator, or iOS device, where
the _runner_ of a test file does not have process and local-file system
access.

There are multiple parts to this PR; I could make it smaller than 1K
lines, but the bulk of that is tests, and it would mean landing PRs that
are incomplete and unused, which does not seem useful - so instead here
is a quick overview of the PR's contents - questions/feedback welcome,
and I am willing to break code out or land incremental refactors if
requested.

1. Augmented `flutter_platform.dart` (used for iOS and Android), similar
to
[`flutter_web_platform.dart`](1398dc7eec/packages/flutter_tools/lib/src/test/flutter_web_platform.dart (L117-L128)),
now creates and uses
[`test_golden_comparator.dart`](https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/test/test_golden_comparator.dart)
to proxy calls (coming from the VM service protocol) for golden-file
updates and comparisons to a `flutter_tester` process. A full
explanation of how (or why) it works this way is too hard to include
here, but see https://github.com/flutter/flutter/pull/160215 for more
details.
1. Added `VmServiceProxyGoldenFileComparator`, which is a currently
unused (outside of a single e2e test) comparator that forwards calls to
`compare` and `update` to the VM service protocol (of which, the other
side of this is implemented above, in `flutter_platform.dart`. The idea
is that this comparator would be used automatically when running in an
integration test on a device that requires it (similar to how web works
today), but that is **not** wired up yet and requires additional work in
`flutter_tools`.
1. Added two unit tests (of both the client and server), and a full
e2e-test using it to run `matchesGoldenFile`.
2024-12-28 19:48:20 +00:00
Matan Lurey
36e0099c4a
Bump flutter_template_images to remove TODO. (#160917)
Towards https://github.com/flutter/flutter/issues/160692.

Prior to `flutter_template_images: 4.3.0`, the `app_shared` directory
was required.

In 4.3.0 it was forked back out to `app`
(https://pub.dev/packages/flutter_template_images/changelog), as the
`skeleton` template has been removed, and the `skeleton` template was
the (only) reason for `app_shared` (to share code between `app` and
`skeleton`).

This is a NOP change tested by existing tests.
2024-12-27 22:15:54 +00:00
Matan Lurey
cdce2872fd
Tweak language post-merge of #160695. (#160876)
Post-merge feedback from https://github.com/flutter/flutter/pull/160695.

Feel free to suggest other (minor) changes, as the bulk of the work is
already complete.
2024-12-27 21:30:57 +00:00
Mouad Debbar
8731c396a7
[web] Make FLUTTER_WEB_AUTO_DETECT false by default (#160191)
Now that "auto" is not supported anymore, it makes more sense to make
this dart define false by default. And there's no need to pass
`FLUTTER_WEB_AUTO_DETECT=false` anymore.
2024-12-27 20:56:25 +00:00
Michael Goderbauer
09a585ba1d
apply dart_style 3.0.1 (#160875)
dart_style 3.0.1 comes with some minor style fixes:
https://github.com/dart-lang/dart_style/blob/main/CHANGELOG.md#301

This PR applies this fixes in bulk across the repository. (Otherwise,
the next person touching these files would have been the one updating
them to the new format by running the formatter).
2024-12-27 00:06:41 +00:00
Matan Lurey
0ffc4ce00e
Remove --template=skeleton and add a placeholder error message instead. (#160695)
Closes https://github.com/flutter/flutter/issues/160673.

Does the following:

- Renames `FlutterProjectType` to `FlutterTemplateType`; did some
enhanced enum cleanups while at it
- Creates a hierarchy of `RemovedFlutterTemplateType` from
`ParsedFlutterTemplateType`
- Removes the `skeleton` directory
- Merges `app_shared` back into `app` (no longer required now that
`skeleton` is removed)

Final cleanups are tracked in
https://github.com/flutter/flutter/issues/160692.

(Added @zanderso just to spot check this is what he meant by
https://github.com/flutter/flutter/issues/160673#issuecomment-2557742347)
2024-12-24 00:02:29 +00:00
Danny Tuppeny
4c8b0a3873
[flutter_tool] Change the startup message for the "flutter daemon" command (#160444)
There have been some reports of the Flutter daemon not starting up
properly (for ex. https://github.com/flutter/flutter/issues/143625), but
it turns out that when starting successfully, it just prints "Starting
device daemon..." and then nothing more. This is confusing and can lead
users to think other issues are because the daemon hasn't started
properly.

There's not a great hook to print that this "finished" starting up
(because it does async polling in the background), so I just updated the
message of the text and moved it to after the creation of the daemon.

Fixes https://github.com/flutter/flutter/issues/143625

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [N/A] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Andrew Kolos <andrewrkolos@gmail.com>
2024-12-22 02:32:02 +00:00
John McDole
d443df008b
Fix bash entrypoint tests (#160705)
Fixes the bash integration test missing a file.
2024-12-22 00:39:11 +00:00
Derek Xu
5036e58c23
Annotate entrypoints in the "isolate spawner" files generated by flutter test --experimental-faster-testing (#160694)
This fixes the test timeouts
(https://ci.chromium.org/ui/p/flutter/builders/prod/Mac%20tool_integration_tests_2_5/1951/overview)
introduced by the most recent Dart SDK roll
(895f0e291a).
2024-12-21 03:15:13 +00:00
Christopher Fujino
3dc695d1ad
[flutter_tools] unconditionally skip bash test (#160690)
Work around: https://github.com/flutter/flutter/issues/160689.

I locally verified that we have not regressed what this was testing
(that just invoking `//flutter/bin/dart` will not build the flutter
tool).
2024-12-20 23:45:54 +00:00
Martin Kustermann
181f4244b4
[native_assets] Preparation existing tests for future of other (i.e. non-Code) assets (#160436)
In the future a hook may be invoked multiple times with different
`supportedAssetTypes` (soon to be renamed to `buildAssetTypes`).

The hook should only emit those asset types that are in
`supportedAssetTypes` - anything else is an error. Right now flutter
happens to invoke hooks only with `Code` asset types, but more asset
types are coming, for which this PR is a preparation for.
2024-12-20 17:46:55 +00:00
Martin Kustermann
a44f745180
Allow integration test helpers to work on substrings instead of whole strings (#160437)
The integration test framework that waits for transitions and
(optionally) takes actions on transitions allows to match patterns.

If one uses a RegExp pattern than the framework only checks whether a
line contains the given RegExp pattern.

If one uses a String pattern it matches it exactly.

=> We add a `Barrier.contains()` and `Multiple.contains()` that allow
matching a line with if it contains the String (just like in RegExp)

=> This makes tests simpler as they don't have to know about the exact
padding of progres bar etc. Those may be irrelevant for the purpose of
the integration test and only complicate it.
2024-12-20 17:27:33 +00:00
Michael Goderbauer
5491c8c146
Auto-format Framework (#160545)
This auto-formats all *.dart files in the repository outside of the
`engine` subdirectory and enforces that these files stay formatted with
a presubmit check.

**Reviewers:** Please carefully review all the commits except for the
one titled "formatted". The "formatted" commit was auto-generated by
running `dev/tools/format.sh -a -f`. The other commits were hand-crafted
to prepare the repo for the formatting change. I recommend reviewing the
commits one-by-one via the "Commits" tab and avoiding Github's "Files
changed" tab as it will likely slow down your browser because of the
size of this PR.

---------

Co-authored-by: Kate Lovett <katelovett@google.com>
Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
2024-12-19 20:06:21 +00:00
Matan Lurey
27ef1967b0
Rename and define FlutterManifest.generateLocalizations. (#160401)
Part of https://github.com/flutter/flutter/issues/102983.

`<FlutterManifest>.generateSyntheticPackage` _never_ meant generate a
synthetic package 😒, it only meant "we _might_ need to generate a
synthetic package because localizations are being generated and the
default, unless otherwise specified, is to generate a synthetic
package".

Renamed as `generateLocalizations` and added some strategic TODOs in
places where removing the `package:flutter_gen` feature
(https://github.com/flutter/flutter/issues/102983) will allow us to
cleanup this erroneous code and technical debt.

Simplified a bit code (just a refactor) in the process, and fixes a bug
that `flutter packages get` would generate internationalization files
even if `flutter: generate: true` was not present in `pubspec.yaml` that
was revealed as part of fixing this up.

/cc @sigurdm.
2024-12-17 04:29:14 +00:00
Matan Lurey
eb926ea840
Consistently set Cache.flutterRoot in create_test.dart. (#160403)
Without this change, the order that tests run matter and it's easy to
add tests without remembering this flag.

(There are existing tests that forgot it too, they just happen to work
if shuffled in a way that, well, works)
2024-12-17 03:15:07 +00:00
Matan Lurey
cb8c15c4f3
Replace --no-implicit-pubspec-resolution with flutter config --explicit-package-dependencies. (#160400)
This was a mistake, and should have already been removed and cleaned up.

Part of https://github.com/flutter/flutter/issues/160257.
2024-12-17 03:11:07 +00:00
Michael Goderbauer
79506323b9
Adjust tools tests that would be broken by formatting (#160393)
These tests depend on line numbers that `dart format` is changing.
Pre-format the files in question and adjust the tests so they continue
to pass when the entire repo is formatted.
2024-12-17 00:34:00 +00:00
Matan Lurey
81f628f340
Migrate mac_test.dart to explicit-package-dependencies. (#160375)
Fixes forward <https://github.com/flutter/flutter/issues/160257> that
will happen when this flag is enabled
([example](https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8728366579836767153/+/u/run_test.dart_for_tool_tests_shard_and_subshard_general/stdout)).
2024-12-16 22:59:17 +00:00
Matan Lurey
f177d8aab4
Migrate test/commands.shard (mostly) to explicit-package-dependencies. (#160288)
Towards https://github.com/flutter/flutter/issues/160257.

I intentionally skipped `create_test.dart`, as that requires updating
the generated template which uses l10n, a feature changing. I'll do that
in the "big bang" PR that finally enables the feature to avoid getting
us into a bad state.
2024-12-16 22:59:16 +00:00
Matan Lurey
18f56e3224
Refactor TestGoldenComparator to be useful for non-web (Android, iOS) integration tests (#160215)
Part of https://github.com/flutter/flutter/issues/160043, makes it
easier to add https://github.com/flutter/flutter/pull/160131.

This PR has no functional changes to any of the code, but does refactor
both the code and tests:

- Makes a number of always non-null but not migrated to non-null
properties, well, not-null
- Creates two concrete methods (`update` and `compare` versus a
positional nullable boolean)
- Uses type signatures instead of `String?` to explain the possible
results of the methods
- Renames the mysterious `shellPath` variable to `flutterTesterBinPath`
- Expands and rewrites internally-facing doc comments
- Moves `WebRenderer` environment variable setting to
`flutter_web_platform.dart`
- Makes the tests have less duplication, and check for update/compare
cases

After this PR, I can use it in the non-web branch of the Flutter tool
without any hacks or TODOS :)

/cc @eyebrowsoffire (trivial web refactoring), @camsim99 (changes being
made to tool).
2024-12-16 22:08:54 +00:00
Michael Goderbauer
8fee7cb832
Adjust ignores for 'dart format' (#160382)
When running `dart format` over these lines the `// ignore` ended up on
a line where it wasn't properly ignoring the lint. This adjusts the
placement of `// ignore`s so they will continue to ignore the right
thing even after the code is auto formatted.

I am hoping that if we do this now the large PR that formats the entire
repo will go in smoother without manual intervention.
2024-12-16 22:01:25 +00:00
Ben Konyi
6159f2eef6
Manual pub roll with flutter_tools patch (#160174)
Fixes: https://github.com/flutter/flutter/issues/160055
2024-12-16 21:41:54 +00:00
Andrew Kolos
c803c1346f
Remove more references to deprecated package:usage (executable, runner) (#160369)
Helps https://github.com/flutter/flutter/issues/150575

<details>

<summary> Pre-launch checklist </summary> 


- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

</details>


<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-12-16 20:39:43 +00:00
Gray Mackall
b19b68074f
Fix regression to hardcoded AGP/Kotlin values in Android module templates (#160108)
https://github.com/flutter/flutter/pull/159770 regressed the module
templates to use a hardcoded `8.7.0` and `1.8.22` as the AGP and Kotlin
versions respectively. This PR returns them to using the template
context values.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Gray Mackall <mackall@google.com>
2024-12-16 19:59:00 +00:00
Alex Li
a0f2424e2e
🐛 [tool] Do not handle directory arguments implicitly for pub commands (#160223)
- Resolves https://github.com/flutter/flutter/issues/144898
- Resolves https://github.com/flutter/flutter/issues/160145

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-12-16 19:55:04 +00:00
Matan Lurey
daaceacb30
Fix a bug to skip flutter_gen when synthetic packages are disabled (#160367)
Without this bug fix, when flipping the flag a lot of things blow up :)

(https://github.com/flutter/flutter/pull/160289 as an example of needing
this)
2024-12-16 19:33:34 +00:00
Matan Lurey
1c52436853
Skip integration tests that consistently OOM on a Windows platform. (#160368)
Towards https://github.com/flutter/flutter/issues/157640.

As far as I can tell, these test cases add no value to be running
specifically on Windows (they are testing general tool functionality),
and it's on [Windows specifically that the tests have the most problems
with OOM and
timeout](https://ci.chromium.org/ui/p/flutter/builders/luci.flutter.prod/Windows%20tool_integration_tests_2_9).
2024-12-16 19:14:58 +00:00
Matan Lurey
0875988f5f
Migrate flutter_command_test.dart to explicit-package-dependencies. (#160274)
Work towards https://github.com/flutter/flutter/issues/160257.
2024-12-14 00:08:28 +00:00
Matan Lurey
5e7c856d5b
Migrate test/general.shard/*plugin* tests to explicit-package-dependencies. (#160279)
Towards https://github.com/flutter/flutter/issues/160257.
2024-12-13 23:18:07 +00:00
Matan Lurey
14177eaa7c
Migrate the rest of general.shard to explicit-package-dependencies. (#160280)
Towards https://github.com/flutter/flutter/issues/160257.
2024-12-13 23:14:22 +00:00
Matan Lurey
b008e5b60c
Migrate resident_web_runner_test.dart to explicit-package-dependencies. (#160278)
Work towards https://github.com/flutter/flutter/issues/160257.
2024-12-13 22:56:05 +00:00
Matan Lurey
15517f0569
Migrate hot_test.dart to explicit-package-dependencies. (#160277)
Work towards https://github.com/flutter/flutter/issues/160257.
2024-12-13 22:43:21 +00:00
Matan Lurey
6bcb15db63
Migrate cocoapods_test.dart to explicit-package-dependencies. (#160264)
Work towards https://github.com/flutter/flutter/issues/160257.
2024-12-13 22:37:08 +00:00
Matan Lurey
96aeed4591
Migrate test/general.shard/build_system to explicit-package-dependencies. (#160275)
Work towards https://github.com/flutter/flutter/issues/160257.
2024-12-13 22:30:38 +00:00
Matan Lurey
61025ca2dd
Migrate test/general.shard/web to explicit-package-dependencies. (#160273)
Work towards https://github.com/flutter/flutter/issues/160257.
2024-12-13 22:22:21 +00:00
Matan Lurey
5332e696a4
Migrate generate_synthetic_packages_test.dart to explicit-package-dependencies. (#160267)
Work towards https://github.com/flutter/flutter/issues/160257.

Unlike some of the other PRs, this test explicitly _opts-out_ of the
flag, as the test itself is testing whether the now deprecated feature
works.
2024-12-13 22:22:12 +00:00
Matan Lurey
47403e351e
Migrate test_compiler_test.dart to explicit-package-dependencies. (#160265)
Work towards https://github.com/flutter/flutter/issues/160257.
2024-12-13 22:21:58 +00:00
Matan Lurey
1e2322c080
Enable explicit-package-dependencies (resident_web_runner_cold_test.dart) (#160258)
Example of option (2) for
https://github.com/flutter/flutter/issues/160257.
2024-12-13 21:14:20 +00:00
Gray Mackall
2948917a47
[Reland] Force automatic ndk download when building for Android (#160260)
Relands https://github.com/flutter/flutter/pull/159756.

The original caused some stderr because
1. the configurable `ndkVersion` value that AGP provides used to be null
by default.
2. Now it is not, instead it has a default value
3. `integration_test` doesn't actually use the NDK, but default for
`integration_test` was higher that `flutter.ndkVersion`
4. We have code that checks if a plugin uses a higher ndk version and
tells you to consider upgrading
https://github.com/flutter/flutter/blob/master/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy#L921

This reverts the revert, and then aligns `integration_test`'s NDK
version (which again, it doesn't actually use, so I'm not too concerned
about the downgrade) with `flutter.ndkVersion`.

It also starts using the `flutter.min/compile/ndkVersion` values in
`integration_test`, which was unrelated to the original pr. Can remove
if you think it should land separately.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Gray Mackall <mackall@google.com>
2024-12-13 20:27:23 +00:00
chunhtai
82ecbb5cbd
Refactor gradle task runner to share error handler code (#159452)
fixes https://github.com/flutter/flutter/issues/153893

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Gray Mackall <34871572+gmackall@users.noreply.github.com>
2024-12-13 18:51:20 +00:00
auto-submit[bot]
5cd440f6ec
Reverts "Force automatic ndk download when building for Android (#159756)" (#160205)
<!-- start_original_pr_link -->
Reverts: flutter/flutter#159756
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: gmackall
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Made the tree red due to some std out.
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: gmackall
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {reidbaker}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
In preparation for changing engine builds to be unstripped by default
https://github.com/flutter/engine/pull/52852, which will allow us to
make progress towards resolving
https://github.com/flutter/flutter/issues/60240.

Tricks AGP in to downloading the NDK when building a flutter app (that
uses the FGP, which to my knowledge is all ways of building flutter
apk/aab/aar).

I want to follow this up by modifying the tool to search for the log
line that the NDK is missing (making it throw an error in that case) as
a safeguard, because that would be the last line of defense before we
accidentally build a bloated app. The safeguard won't work for add to
app, from what I understand, because while they use the FGP (so they
should be forced to be download the NDK) they don't invoke the flutter
tool, and therefore won't invoke the custom error handling of
[`gradle_errors.dart`](https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/android/gradle_errors.dart)

Some details

1. Respects existing values for `externalNativeBuild.cmake.path` for
apps that actually use it.
2. Silences some warnings that would otherwise appear for add to app
builds or builds that manually invoke gradle:
```
C/C++: CMake Warning (dev) in CMakeLists.txt:
C/C++:   No project() command is present.  The top-level CMakeLists.txt file must
C/C++:   contain a literal, direct call to the project() command.  Add a line of
C/C++:   code such as
C/C++:     project(ProjectName)
C/C++:   near the top of the file, but after cmake_minimum_required().
C/C++:   CMake is pretending there is a "project(Project)" command on the first
C/C++:   line.
C/C++: This warning is for project developers.  Use -Wno-dev to suppress it.
C/C++: CMake Warning:
C/C++:   Manually-specified variables were not used by the project:
C/C++:     CMAKE_EXPORT_COMPILE_COMMANDS
C/C++:     CMAKE_LIBRARY_OUTPUT_DIRECTORY
C/C++:     CMAKE_RUNTIME_OUTPUT_DIRECTORY
```
3. Our ci installs the NDK at an abnormal place that AGP can't find
without help. I've modified all the `build.gradle`s that we have checked
in to point to the pre-installed path. **But some of our tests make a
new app from the templates, and those tests will now start downloading
the NDK** (as they won't be able to find it at it's current path from
templates). We could resolve this by actually fixing
https://github.com/flutter/flutter/issues/136666. This would be a very
significant lift from what I understand - we rely on this hardcoding in
a lot of places in our infra.


Fixes https://github.com/flutter/flutter/issues/155576

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
2024-12-12 23:44:26 +00:00
Gray Mackall
99786b413f
Force automatic ndk download when building for Android (#159756)
In preparation for changing engine builds to be unstripped by default
https://github.com/flutter/engine/pull/52852, which will allow us to
make progress towards resolving
https://github.com/flutter/flutter/issues/60240.

Tricks AGP in to downloading the NDK when building a flutter app (that
uses the FGP, which to my knowledge is all ways of building flutter
apk/aab/aar).

I want to follow this up by modifying the tool to search for the log
line that the NDK is missing (making it throw an error in that case) as
a safeguard, because that would be the last line of defense before we
accidentally build a bloated app. The safeguard won't work for add to
app, from what I understand, because while they use the FGP (so they
should be forced to be download the NDK) they don't invoke the flutter
tool, and therefore won't invoke the custom error handling of
[`gradle_errors.dart`](https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/android/gradle_errors.dart)

Some details

1. Respects existing values for `externalNativeBuild.cmake.path` for
apps that actually use it.
2. Silences some warnings that would otherwise appear for add to app
builds or builds that manually invoke gradle:
```
C/C++: CMake Warning (dev) in CMakeLists.txt:
C/C++:   No project() command is present.  The top-level CMakeLists.txt file must
C/C++:   contain a literal, direct call to the project() command.  Add a line of
C/C++:   code such as
C/C++:     project(ProjectName)
C/C++:   near the top of the file, but after cmake_minimum_required().
C/C++:   CMake is pretending there is a "project(Project)" command on the first
C/C++:   line.
C/C++: This warning is for project developers.  Use -Wno-dev to suppress it.
C/C++: CMake Warning:
C/C++:   Manually-specified variables were not used by the project:
C/C++:     CMAKE_EXPORT_COMPILE_COMMANDS
C/C++:     CMAKE_LIBRARY_OUTPUT_DIRECTORY
C/C++:     CMAKE_RUNTIME_OUTPUT_DIRECTORY
```
3. Our ci installs the NDK at an abnormal place that AGP can't find
without help. I've modified all the `build.gradle`s that we have checked
in to point to the pre-installed path. **But some of our tests make a
new app from the templates, and those tests will now start downloading
the NDK** (as they won't be able to find it at it's current path from
templates). We could resolve this by actually fixing
https://github.com/flutter/flutter/issues/136666. This would be a very
significant lift from what I understand - we rely on this hardcoding in
a lot of places in our infra.


Fixes https://github.com/flutter/flutter/issues/155576

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Gray Mackall <mackall@google.com>
2024-12-12 23:23:29 +00:00
Andrew Kolos
6b12651419
Fix analytics enabled/disabled event not being sent when the user enables/disables analytics (#160060)
Fixes https://github.com/flutter/flutter/issues/160058.

In addition, only send an event when the enabled-state of analytics
actually gets flipped.


<details>

<summary> Pre-launch checklist </summary> 


- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

</details>


<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-12-12 19:59:50 +00:00
Ben Konyi
292695e7c1
Don't throw StateError when listing core devices during tool shutdown (#160094)
The previous attempt at this fix was assuming that the tool's file
system was a `LocalFileSystem`, but in reality it's a `LocalFileSystem`
wrapped in an `ErrorHandlingFileSystem`. This change takes this into
account.

Fixes https://github.com/flutter/flutter/issues/160082 
Fixes https://github.com/flutter/flutter/issues/156962

---------

Co-authored-by: Andrew Kolos <andrewrkolos@gmail.com>
2024-12-11 20:12:48 +00:00
Michael Goderbauer
0147b1f0ec
Pin pkg:intl to 0.19.0 (#159992)
Version 0.20.0 introduces new transitive dependencies that are not
cleared (yet) in our allow list [1]. Work is underway in
https://github.com/flutter/flutter/pull/158555 to change that.

[1]
eabed2381b/dev/bots/allowlist.dart
2024-12-10 23:07:59 +00:00
Ben Konyi
4b14308413
Add support for injecting assets into the widget_preview_scaffold (#159859)
The generated widget_preview_scaffold project needs to explicitly
reference the assets from the parent project's pubspec.yaml. This change
updates flutter widget-preview start to read the parent project's
pubspec.yaml and add references to the assets listed to the
widget_preview_scaffold's pubspec.yaml. If generate: true is set in the
parent project, a reference to the autogenerated flutter_gen package is
manually added to the widget_preview_scaffold's package_config.json.
2024-12-10 15:34:33 +00:00
Mikhail Novoseltsev
2eee054d41
[tool] Fix android tests using outdated regexs to modify templates (#159396)
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

**Description**

While exploring some semi-related stuff, found these 2 tests using
outdated regex which does not work because AGP version in modern
templates is set in `settings.gradle.kts` and in form of
`com.android.application` instead of `com.android.tools.build:gradle`.

Apart from that, in `android_plugin_example_app_build_test.dart` deleted
all lines regarding version change (instead of comply with new way of
declaring plugin) because for a long time it's didn't work anyway:
`replaceAll` haven't find any matches and test ran on latest AGP from
template. More than that, attempt to adapt this test to modern AGP setup
failed because build is not working with AGP < 8 (I lost logs with
actual error for this case, but I believe I can reproduce if anyone
wants)

in `native_assets_agp_version_test`: 

- Fixed version to comply with AGP versioning format, which is
`major.minor.patch`.
- Updated regex and version changing logic to work with
`com.android.application` format and `settings.gradle.kts` file. I
believe that version updating is desired behavior here, unlike in
`android_plugin_example_app_build_test.dart`.
- Updated `kts` syntax for declaring flavors in `build.gradle.kts` and
updated regex-based updating of this file (didn't work previously
because there wasn't actual writing to file)

didn't list any issues because there're not any regarding these tests
(or maybe I just failed to find). In any case, I think that this doesn't
require issue because fix is kinda trivial and motivation is clear.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-12-10 14:19:24 +00:00
Mohellebi abdessalem
1a6eada859
fix failing lint : findByPath requires a specific ordering of project evaluation in flutter.groovy (#159296)
fix failing lint : `'findByPath' requires a specific ordering of project
evaluation`
![Capture d’écran 2024-11-21
230157](https://github.com/user-attachments/assets/61ab84da-4941-4aa4-a42e-fac4c140f4bd)
![Capture d’écran 2024-11-21
230245](https://github.com/user-attachments/assets/417563b7-0416-47bd-9f02-6778d37893ef)

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Reid Baker <reidbaker@google.com>
2024-12-06 21:29:17 +00:00
Mohellebi abdessalem
43a25a8e41
Align comments in flutter_build_preview_sdk_test.dart with build.gradle.kts usage (#159299)
update comments inside `flutter_build_preview_sdk_test.dart` to match
the usage of `build.gradle.kts` instead of `build.gradle`
those must've slipped from #157195
## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-12-06 21:18:08 +00:00
Michael Goderbauer
f601ed1862
Bump Dart SDK to 3.7 (#159812) 2024-12-05 21:39:53 +00:00
Gray Mackall
2afaa619cb
Migrate module templates to declarative application of the Flutter Gradle Plugin (#159770)
Fixes https://github.com/flutter/flutter/issues/159729

Cases to consider:
1. Building the module as a standalone app (`flutter run`)
2. Building the module as an aar (`flutter build aar`) 
3. Doing (2) and then building an android host app that depends on the
aar.
4. Building the host app with it depending on the module as source.

Manually tested all 4 and they all are working.

Modified `build_android_host_app_with_module_aar.dart` and
`build_android_host_app_with_module_source.dart` to add checks on
`stderr` to ensure we don't hit the log.


## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Gray Mackall <mackall@google.com>
2024-12-05 21:32:58 +00:00
Jonah Williams
e1c09f408c
[flutter_tools] configure shader compiler to output GLES3 shaders for Android. (#159857)
Required changes for https://github.com/flutter/engine/pull/56960

This configures an additional shader target for Android devices.
2024-12-05 20:43:12 +00:00
Andrew Kolos
1856940f66
Remove some usages of package:usage (#159705)
Split-off from https://github.com/flutter/flutter/pull/151518. Helps
https://github.com/flutter/flutter/issues/150575


<details>

<summary> Pre-launch checklist </summary> 


- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

</details>


<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-12-05 17:07:12 +00:00
Anis Alibegić
e2ada1c939
Fixed typos (#159331)
Here's another one of my PRs where I hunt for typos across `flutter`
repo.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2024-12-05 16:54:09 +00:00
Mohellebi abdessalem
44cc2c4303
fix failing lint in MainActivity.kt.tmpl (#159441)
`what android studio lint is failing`
![Capture d’écran 2024-11-25
193428](https://github.com/user-attachments/assets/40729c6f-2c5d-4e56-a413-7b7c6dddddb8)

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-12-05 16:44:05 +00:00
Ben Konyi
74669e4bf1
Add flutter widget-preview {start, clean} commands (#159510)
This is the initial tooling work for Flutter Widget Previews, adding two
commands: `flutter widget-preview start` and `flutter widget-preview
clean`.

The `start` command currently only checks to see if
`.dart_tool/widget_preview_scaffold/` exists and creates a new Flutter
project using the widget_preview_scaffold template if one isn't found.
The widget_preview_scaffold template currently only contains some
placeholder files and will be updated to include additional code
required by the scaffold.

The `clean` command simply deletes `.dart_tool/widget_preview_scaffold/`
if it's found.

This change also includes some refactoring of the `create` command in
order to share some project creation logic without requiring `flutter
widget-preview start` to spawn a new process simply to run `flutter
create -t widget_preview .dart_tool/widget_preview_scaffold`.

Related issue: https://github.com/flutter/flutter/issues/115704

---------

Co-authored-by: Andrew Kolos <andrewrkolos@gmail.com>
2024-12-04 21:51:08 +00:00
Camille Simon
f9f42bee99
[Android] Removes dev dependency plugins from release builds (#158026)
Removes plugins that are `dev_dependency`s from being dependencies of
release builds of Flutter Android app projects.

Fixes https://github.com/flutter/flutter/issues/157949.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.


<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-12-04 18:13:07 +00:00
Ben Konyi
eabed2381b
Add deprecation notice for Android x86 when building for the target (#159750)
Related to https://github.com/flutter/flutter/issues/157543
2024-12-04 16:45:43 +00:00
Mohellebi abdessalem
1b048b0219
fix fialing lint Consider using 'register' to avoid unnecessary configuration (#159137)
fix failing lint `Consider using 'register' to avoid unnecessary
configuration` in Android studio :
![Capture d’écran 2024-11-19
132110](https://github.com/user-attachments/assets/ffc98203-5563-4846-aa42-60a0b8defa27)

![Capture d’écran 2024-11-19
133050](https://github.com/user-attachments/assets/7671b6f4-5a18-460a-8456-608a40e6da22)
see #147122
## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-12-03 21:15:25 +00:00
TheJoeSchr
980df92204
Fix typo in flutter_command.dart (#159398)
sever -> server
2024-12-03 21:09:15 +00:00
Mohellebi abdessalem
c90080ca1a
remove unnecessary semicolon in module_plugin_loader.radle (#159303)
`what lint is failing ?`
![Capture d’écran 2024-11-25
215213](https://github.com/user-attachments/assets/c2be911c-981a-4d47-8c52-9802d4855666)

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-12-03 19:21:00 +00:00
Loïc Sharma
88a7ec6b4d
[SwiftPM] Rename SWIFT_PACKAGE_MANAGER environment variable to FLUTTER_SWIFT_PACKAGE_MANAGER (#159502)
Previously, the Swift Package Manager feature could be overridden using
the `SWIFT_PACKAGE_MANAGER` environment variable.

This environment variable name is a bit generic and might collide with
other tooling.

This renames the environment variable to
`FLUTTER_SWIFT_PACKAGE_MANAGER`.

**This is a breaking change**, however, [we haven't documented this
environment
variable](https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-app-developers#how-to-turn-on-swift-package-manager).

Addresses https://github.com/flutter/flutter/issues/159121

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-12-03 19:06:44 +00:00
Martin Kustermann
227f6a04f7
Make native asset tests more robust against flutter upgrading its pinned dependencies (#159715)
Native asset tests use `flutter create --no-pub --template=package_ffi`.
The template used for this is checked in. It then adds extra
dependencies to checked-in packages in flutter/flutter (which have
pinned deps) in those generated templates.

It then pins all dependencies in the modified template project. This can
lead to constraint violations when flutter updates pinned dependencies,
because the template uses old constraints (which are turned from `^x` to
`=x`) and the additional dependency on flutter/flutter checked in
package brings in different pinned dependencies.

In a previous PR we already made this more robust by using flutter's
pinned versions over the the versions from the template (that are
changed from `^x` to `=x`).

Though a new upgrade of flutters pinned packages reveals that this isn't
quite sufficient: The template uses `test` at `^X`. The additional
dependency to `link_hook` doesn't depend on `test`. It therefore turns
it into `=X`. BUT `link_hooks` has a non-dev dependency on `test_core`
which is incompatible with `=X`.

=> So we relax this even more by prefering to choose (pinned) versions
of the flutter/flutter `link_hook` dependencies and (new) dev
dependencies over the template dependencies.
=> This will make use use the pinned `test` version from `link_hooks`
instead of from the template.
2024-12-03 12:21:59 +00:00
LinXunFeng
6b5cd01e39
Fix output path for --appSizeBase (#158302)
Fixes https://github.com/flutter/flutter/issues/158211

before

```shell
A summary of your APK analysis can be found at: /Users/lxf/.flutter-devtools/apk-code-size-analysis_01.json

To analyze your app size in Dart DevTools, run the following command:
dart devtools --appSizeBase=apk-code-size-analysis_01.json
```

now

```shell
A summary of your APK analysis can be found at: /Users/lxf/.flutter-devtools/apk-code-size-analysis_01.json

To analyze your app size in Dart DevTools, run the following command:
dart devtools --appSizeBase=/Users/lxf/.flutter-devtools/apk-code-size-analysis_01.json
```


## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

Co-authored-by: Kenzie Davisson <43759233+kenzieschmoll@users.noreply.github.com>
2024-12-02 19:35:27 +00:00
David Iglesias
1e1b5271f4
[tool] Removes deprecated --web-renderer parameter. (#159314)
Removes the `--web-renderer` option.

Flutter tool users won't be able to select their web renderer.

In order to not drop test coverage, tests are still run with the HTML
Renderer, until its code is fully removed from the engine.

Part of https://github.com/flutter/flutter/issues/145954

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-12-02 18:33:02 +00:00
Daco Harkes
4aa2caef20
[native assets] Create NativeAssetsManifest.json instead of kernel embedding (#159322)
This PR introduces a `NativeAssetsManifest.json` next to the
`AssetManifest.bin` and `FontManifest.json`. This removes the need for
embedding the native assets mapping inside the kernel file and enables
decoupling native assets building and bundling from the kernel
compilation in flutter tools. This means `flutter run` no longer does a
dry run of `hook/build.dart` hooks.

(It also means all isolate groups will have the same native assets.
However, since Flutter does not support `Isolate.spawnUri` from kernel
files, this is not a regression.)

Implementation details:

* g3 is still using kernel embedding.
https://github.com/flutter/flutter/pull/142016 introduced an argument to
embed a `native_assets.yaml` inside `flutter attach` and `flutter run`
(the outer flutter process), but it is not used in `flutter assemble`
(the inner process when doing `flutter run`). So, those arguments need
to still be respected. However, all other logic related to embedding a
yaml encoding in the kernel file has been removed.
* All dry-run logic has been removed. 🎉 
* The `KernelSnapshot` target no longer depends on the
`InstallCodeAssets` target. Instead, the various OS-specific
"BundleAsset" targets now depend on the `InstallCodeAssets` target. The
`InstallCodeAssets` invokes the build hooks and produces the
`NativeAssetsManifest.json`. The various "BundleAsset" commands
synchronize the `NativeAssetsManifest.json` to the app bundle.
* `InstallCodeAssets` produces a `native_assets.json`, which is renamed
to `NativeAssetsManifest.json` in the various "Bundle" targets. This
means that all unit tests of the "Bundle" targets now need to create
this file. (Similar to how `app.dill` is expected to exist because
`KernelSnapshot` is a dependency of the "Bundle" targets.)
* Because dynamic libraries need to be code signed (at least on iOS and
MacOS), the bundling of the dylibs is _not_ migrated to reuse
`_updateDevFS` (which is used for ordinary assets). Only the 2nd and 3rd
invocation of `flutter assemble` from `xcodebuild` has access to the
code signing identity.

Relevant tests:

* test/integration.shard/isolated/native_assets_test.dart - runs
`flutter run` with native assets including hot restart and hot reload.

TODO:

* Undo engine-roll in this PR after engine has rolled in.

Issue:

* https://github.com/flutter/flutter/issues/154425

Related PRs:

* https://dart-review.googlesource.com/c/sdk/+/388161
* https://github.com/flutter/engine/pull/56727

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-11-27 11:03:19 +00:00
Matan Lurey
4ff6698838
Report usage of deferred-components to analytics. (#159307)
Towards https://github.com/flutter/flutter/issues/159212.

/cc @jtmcdole

---------

Co-authored-by: Andrew Kolos <andrewrkolos@gmail.com>
2024-11-26 21:01:20 +00:00
Gray Mackall
70e31b48bf
Bump AGP/Gradle/Kotlin warn versions (#158839)
Bumps the versions up a bit, so we can keep people moving forward.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Gray Mackall <mackall@google.com>
2024-11-25 21:13:24 +00:00
userFortyTwo
d527f6ee10
Fix typo in gen_l10n_types.dart (#159035)
This pull request fixes a typo.
2024-11-25 15:05:03 +00:00
Ben Konyi
b5331b3e1b
[ tool ] Fix expression evaluation not handling errors correctly (#159151)
Also starts DDS for integration test devices.

Fixes https://github.com/flutter/flutter/issues/157922
2024-11-25 15:04:09 +00:00
Mohellebi abdessalem
59a8d9dc76
fix failing lints in aar_init_script.gradle (#158025)
android studio is marking those three imports as unused imports.
```gradle 
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
import org.gradle.api.publish.maven.MavenPublication
```
the lint : 
![Capture d’écran 2024-11-01
220654](https://github.com/user-attachments/assets/a152bf80-f3b4-4a6c-bdda-abfc6503d8ea)

and this method could be converted to static :
```gradle
String getFlutterRoot(Project project) {
    if (!project.hasProperty("flutter-root")) {
        throw new GradleException("The `-Pflutter-root` flag must be specified.")
    }
    return project.property("flutter-root")
}
```

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-11-24 16:54:18 +00:00
Albert Wolszon
da188452a6
Allow add_format() in flutter gen-l10n DateTime format (#156297)
This Pull Request extends the functionality of the `flutter gen-l10n`
command (and its behavior during hot restart/reload) related to
`DateFormat` type placeholders and their `format`. Until now, it was
impossible to take advantage of `intl`'s
`DateFormat.something().add_somethingElse()`. The `.add_x()` part was
impossible to achieve. This PR adds the ability to take advantage of
these methods over `DateFormat`, by adding the `add_` formats after the
`+` character in the `format` in placeholder configuration. You can even
have multiple added format parts if needed. All within a single
placeholder.

<table>
<tr>
<th>Before the PR</th>
<th>After the PR</th>
</tr>
<tr>
<td>

```json
{
    "bookingsPage_camo_dataLoaded": "CAMO data from {date} {time}.",
    "@bookingsPage_camo_dataLoaded": {
        "placeholders": {
            "date": {
                "type": "DateTime",
                "format": "yMMMd"
            },
            "time": {
                "type": "DateTime",
                "format": "jm"
            }
        }
    },
}
```

</td>
<td>

```json
{
    "bookingsPage_camo_dataLoaded": "CAMO data from {date}.",
    "@bookingsPage_camo_dataLoaded": {
        "placeholders": {
            "date": {
                "type": "DateTime",
                "format": "yMMMd+jm"
            }
        }
    },
}
```

</td>
</tr>
</table>

Resolves #155817.

## Next steps

After this PR is merged, an update to [i18n | Flutter > Messages with
dates](https://docs.flutter.dev/ui/accessibility-and-internationalization/internationalization#messages-with-dates)
([source](https://github.com/flutter/website/blob/main/src/content/ui/accessibility-and-internationalization/internationalization.md))
shall be made to include a mention of this new addition.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Andrew Kolos <andrewrkolos@gmail.com>
2024-11-23 18:55:24 +00:00
Mikhail Novoseltsev
4b46b80661
doctor: make JDK validation message more descriptive (#157280)
This PR attempts to improve clarity of androids section of `flutter
doctor -v` output by providing explicit information about which JDK is
being used and how to configure a different one if needed.

### Before

```console
• Java binary at: /Users/user/Applications/Android Studio Ladybug Feature Drop 2024.2.2 Canary 2.app/Contents/jbr/Contents/Home/bin/java
```

### After

1. When JDK is from Android Studio:

```console
    • Java binary at: /Users/users/Applications/Android Studio Ladybug Feature Drop 2024.2.2 Canary 2.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with latest Android Studio installation
      To manually set a custom JDK path, use: `flutter config --jdk-dir="path/to/jdk"`
```

2. When JDK is from JAVA_HOME env variable:

```console
    • Java binary at: /Users/user/Applications/Android Studio Ladybug Feature Drop 2024.2.2 Canary 2.app/Contents/jbr/Contents/Home/bin/java
      This JDK is specified by JAVA_HOME environment variable
      To manually set a custom JDK path, use: `flutter config --jdk-dir="path/to/jdk"`
```

3. When path to JDK is set in flutter config:

```console
    • Java binary at: /Users/user/Applications/Android Studio Ladybug Feature Drop 2024.2.2 Canary 2.app/Contents/jbr/Contents/Home/bin/java
      This JDK was found in system PATH
      To change current JDK, run: `flutter config --jdk-dir="path/to/jdk"`
```
4. When java binary is found in PATH (as fallback)

```console
    • Java binary at: /Users/user/Applications/Android Studio Ladybug Feature Drop 2024.2.2 Canary 2.app/Contents/jbr/Contents/Home/bin/java
      This JDK is specified in Flutter configuration
      To manually set a custom JDK path, use: `flutter config --jdk-dir="path/to/jdk"`
```

### Motivation

I think it's described in
https://github.com/flutter/flutter/issues/153156#issuecomment-2336814991.

TLDR; many developers struggle with Java-related issues and more verbose
doctor's output will (presumably) improve DX in that part.


fixes #153156


## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md

---------

Co-authored-by: Andrew Kolos <andrewrkolos@gmail.com>
2024-11-23 00:27:18 +00:00
Matan Lurey
5efd759085
Remove now unused apk-health-tests. Can always re-add in the future. (#159349)
https://github.com/flutter/flutter/issues/159000 resolved (for now).
2024-11-23 00:25:46 +00:00
Dominik Toton
728cedc62a
Fix --web-header flag for flutter drive (#159039)
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

This PR makes sure that `--web-header` flag works together with the
`flutter drive` command. Currently the flag is correctly parsed but it
is not properly propagated and ends up being unused when running the web
server for tests.

I have validated the fix by following the steps to reproduce from:
https://github.com/flutter/flutter/issues/159037.

#### Before the fix

No custom HTTP header in test run:
![Screenshot 2024-11-16 at 22 21
36](https://github.com/user-attachments/assets/b3d4e34b-fe2b-4d32-8b0a-2d55e5d23f69)

#### After the fix

Correct HTTP headers in test run:
![Screenshot 2024-11-16 at 22 13
43](https://github.com/user-attachments/assets/b74a41de-69c5-4968-82c0-a08d29a3252d)


Fixes #159037

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-11-21 20:40:11 +00:00
Jason Simmons
d7f5547ecd
Do a clean shutdown of the flutter_tools processes started by observatory_port_test (#159169)
Killing the flutter_tools parent process may leak child processes
spawned by the tools.

Also wait for the message indicating that DevTools has started before
stopping flutter_tools. If DevTools has not fully launched, then there
may be a race between DevTools startup and flutter_tools shutdown.

Fixes https://github.com/flutter/flutter/issues/159154
2024-11-21 19:04:06 +00:00
Ben Konyi
93d772c5cd
Added additional logging to _listCoreDevices (#159275)
Attempting to collect additional context into the failure outlined in
https://github.com/flutter/flutter/issues/141892
2024-11-21 18:33:15 +00:00
Jason Simmons
efe8737ea0
Shut down DevTools and DDS processes if flutter_tools is killed by a signal (#159238)
See https://github.com/flutter/flutter/issues/159154
2024-11-21 17:53:57 +00:00
Matan Lurey
d1e2c5fba7
Try a speculative fix for Gradle OOMs. (#159234)
Speculative fix for https://github.com/flutter/flutter/issues/157640.

A few observations:

- I was a bit paranoid about indented files meaning something was parsed
incorrectly
- I removed `android.enableR8=true` (not used elsewhere)
- I removed `android.experimental.enableNewResourceShrinker=true` (not
used elsewhere)
- I matched the rest of the `jvmargs` used in the standard template file

... let's hope this does good things?
2024-11-21 17:39:13 +00:00
Jonah Williams
f7869a4799
[flutter_tools] opt iOS/macOS apps out of Metal API validation via migrator, update templates in repo. (#159228)
Setting "enableGPUValidationMode = "1"" disables Metal API validation. I
know, I know.

Fixes https://github.com/flutter/flutter/issues/159227
2024-11-21 01:36:55 +00:00
Matan Lurey
5ead4e15a7
Terminate non-detached test devices on flutter run completion (#159170)
See https://github.com/flutter/flutter/issues/159154.
See https://github.com/flutter/flutter/pull/159169.

Before this PR, it appeared we were accidentally leaking (keeping
active) `flutter_tester` instances (or any test device) after `flutter
run` completion, even if the runner was not explicitly detached. I
_think_ this is a bug, but I'll check with the tools team and possibly
@jonahwilliams before finalizing this.

/cc @jason-simmons

---------

Co-authored-by: Andrew Kolos <andrewrkolos@gmail.com>
2024-11-21 01:21:25 +00:00
Matan Lurey
1d24fa8f60
Un-skip tests that use flutter build apk. (#159231)
Closes https://github.com/flutter/flutter/issues/158560.

I believe but am not sure as of
https://github.com/flutter/flutter/pull/159170 merging, many process
flakes that were consuming memory and in turn, making Gradle
particularly sensitive to timing out or being killing by the OS for
low-memory, have been rectified.

It is possible there are additional problems, but they aren't visible at
the moment.

I'd like to re-enable these and keep tracking their stability.
2024-11-21 01:13:50 +00:00
Martin Kustermann
e2d8121708
Remove dependency on [Target] and instead operate on [Architecture] (#159196)
The dart-lang/native repository contains a `Target` class that is almost
not needed anymore. The remaining uses are mainly due to kernel asset
mapping (which we may be able to remove in the future).

This PR removes usages of that `Target` (in favor of `Architecture`)
class in most places in flutter tools.
This makes the code also cleaner because we no longer have an implicit
assumption that
a `List<Target>` all belong to the same operating system.
2024-11-20 12:44:43 +00:00
Matan Lurey
1fdcb757fd
Make runner non-nullable as it always is. (#159156) 2024-11-20 00:11:39 +00:00
Mohellebi abdessalem
f0dc0b798f
fix lint usage of task inside resolve_dependecies.gradle file (#158022)
according to
[Gradle](https://docs.gradle.org/current/userguide/task_configuration_avoidance.htmll)
:`As of Gradle 5.1, we recommend that the configuration avoidance APIs
be used whenever tasks are created.`

![writing-tasks-4](https://github.com/user-attachments/assets/407c79bb-7bfa-4bea-9b13-dec01c60dc1c)
what android studio lint is failing ?
![Capture d’écran 2024-11-01
214856](https://github.com/user-attachments/assets/af745305-6310-406c-b427-fb8a5dd5755c)


## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-11-19 20:32:05 +00:00
Mohellebi abdessalem
1d01955721
Removing redundant backticks in flutter\packages\flutter_tools\gradle\gradle.kts (#159051)
`what android studio lint is failing ?`

![Capture d’écran 2024-11-19
110315](https://github.com/user-attachments/assets/d86605f6-0060-4721-9233-09d8ec5774d4)

![Capture d’écran 2024-11-19
110338](https://github.com/user-attachments/assets/7ee7465e-7a06-43db-bebb-ca87dda3cdc8)
see #147122
## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-11-19 19:32:22 +00:00
Matan Lurey
8536b96ebb
Terminate flutter test when no longer needed in integration test. (#159117)
Towards https://github.com/flutter/flutter/issues/51421.

```sh
flutter_tools % dart test test/integration.shard/break_on_framework_exceptions_test.dart

02:38 +29: All tests passed!

54692 ttys003    0:00.02 /opt/homebrew/bin/zsh -il
```

Requires https://github.com/flutter/flutter/pull/159115 for the process
cleanup to work properly, but this is safe to land as-is, otherwise we
still accumulate `flutter` processes over and over as each test case
runs which is not WAI.
2024-11-19 16:16:08 +00:00
Matan Lurey
c5379557b3
Terminate the test device if the flutter tool is signal-killed. (#159115)
Closes https://github.com/flutter/flutter/issues/20949.

Signals (such as SIGTERM or SIGKILL) end up flowing through
`exitWithHooks`, which in turn, after running hooks, call `exit().` That
means, as a result, any `try { } finally { }` guarded execution may
_not_ run, which happens to also be how `flutter_tester` instances are
cleaned up if they have not terminated.

This PR adds in-progress `flutter_tester` runs (or any platform
`flutter_platform` supports) to the shutdown hooks, guaranteeing that
the finalizers (which in turn, kill the process) are _always_ executed
as long as either the test completes, _or_ `exitWithHooks` is called.

The existing integration tests (`integration.shard/test_test.dart`)
still pass as well.
2024-11-19 16:10:32 +00:00
Loïc Sharma
6b6f481f19
[SwiftPM] Move where the migration checks feature flags (#159110)
Previously, the Swift Package Manager app migration would only be
registered if the feature was on.

Now, the Swift Package Manager app migration is always registered but
only runs if the SwiftPM feature is on. This change will make it easier
to introduce a separate feature flag for just the SwiftPM app migration.

This is a refactoring with no semantic change.

Part of https://github.com/flutter/flutter/issues/151567

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-11-19 01:23:08 +00:00
Matan Lurey
3a17b67353
Add a tag and assert some state in FlutterTestDriver tests. (#159099)
Towards https://github.com/flutter/flutter/issues/51421.

Asserts some state we would not like to be hit by in integration tests
using `Flutter*TestDriver`.

In addition, adds a tag that can be used to run all tests that currently
use this pattern:

```sh
flutter test --tags flutter-test-driver
```

This showcases processes leaking quite a bit:
<https://gist.github.com/matanlurey/190d9084d3a45bc5737b8406bc05b4cd>.
2024-11-18 23:37:05 +00:00
Ben Konyi
c7d158d9f9
Fix flaky failure related to core_device_list.json not being found (#158946)
It's possible that the tool can be in the process of shutting down,
which could result in the temp directory being deleted after the
shutdown hooks run before we check if `output` exists. If this happens,
we shouldn't crash but just carry on as if no devices were found as the
tool will exit on its own.

Fixes https://github.com/flutter/flutter/issues/141892

---------

Co-authored-by: Andrew Kolos <andrewrkolos@gmail.com>
2024-11-18 19:52:52 +00:00
Matan Lurey
03c13af0b4
Define and use flutterBin consistently across integration.shard. (#159007)
Towards https://github.com/flutter/flutter/issues/158875.

This should be a NOP, and just reduce the amount of copy-pasted code
across tests.
2024-11-18 19:00:04 +00:00
Matan Lurey
74384004ce
No longer download android-x86-jit-release. (#159011)
Unblocks https://github.com/flutter/flutter/issues/151610.
2024-11-18 18:22:24 +00:00
Matan Lurey
ec2ab541dd
Switch flutter_build_apk_health_tests to use a subset of current tests. (#159004)
Towards https://github.com/flutter/flutter/issues/159000 as part of
debugging issues such as
https://github.com/flutter/flutter/issues/158560.

On a `bringup: true` shard, run a number of `flutter build apk` tests in
succession to try and routinely trigger timeouts and crashes, so we can
test other hypotheses on how to fix this problem (i.e. potentially
around increasing memory, changing daemon configuration, aggressively
killing processes, etc).
2024-11-15 22:54:06 +00:00
Martin Kustermann
01590aa27a
Refactor native asset integration into flutter tools (#158932)
Currently the `NativeAsset` target in flutter tools is responsible for
two things:

* performing the dart build (in the app as well as all transitive pub
dependencies)
* taking output (shared libraries) from this build and copying them
around

This intermingling of responsibilities leads to more complex code and
potentially unnecessary work: If the source code changed (e.g. `.c`
files change) we have to run the dart build again. But doing so may
result in the same shared libraries (e.g. adding comments to the `.c`
code). Currently we're going to copy the shared libraries despite them
having not changed, which then may cause upstream things to be dirtied
(if it's based on timestamp of files) and re-built.

Instead this PR splits this `NativeAsset` into the two orthogonal pieces

* `DartBuild` target that is responsible for the dart build
* `InstallCodeAssets` that is responsible for copying shared libraries
to the right place and producing a `native_assets.yaml`.

This decoupling is also preparation for a future where a dart build can
produce other kinds of assets (e.g. data assets) and is used in the web
build as well. (The web build would use `DartBuild` but not
`InstalCodeAssets`).
2024-11-15 21:04:42 +01:00
Martin Kustermann
1636fbd4cb
Fix code asset copying logic in native asset code (#158984)
After the dart build is done, the flutter tool has to bundle the
produced shared libraries, which it does that by copying them around.

Though the code assumed that all code assets are shared libraries to be
bundled, whereas in fact one can have code assets without any actual
code (ones that are installed on the target system already or artificial
code assets whose symbols get resolved from executable / process).

=> Using non-bundled code assets currently results in null pointer
exceptions and/or cast errors.
=> We update the copy code to only operate on code assets that have a
shared library to bundle.

We also update the copy routines by removing copy&past'ed - but slightly
different - printing code into the shared caller function.
2024-11-15 16:23:23 +01:00
Martin Kustermann
256359194e
Fix duplicate work in native assets release builds (#158980)
In release builds linking of native assets is enabled. The build step is
only a temprary step, it's output is given to the link step which then
returns all final assets (effectively a map-reduce system). Assets that
aren't sent to a specific linker could be conceptually viewed as sent to
a linker that will emit it's input as-is.

=> The code currently took output of build & link step and therefore
accumulated assets that aren't explicitly sent to a linker twice.

=> This led to performing work twice for those (e.g. copying them twice)

This PR changes this such that if linking mode is enabled, we only rely
on the output of the link phase.
That in return means many tests that mock the native asset builds need
to be updated to mock the output of the link phase.
2024-11-15 15:05:42 +01:00
Matan Lurey
eaa99f28b1
Stop generate both .kts and non-.kts gradle files for a test project. (#158965)
Closes https://github.com/flutter/flutter/issues/158962.
2024-11-15 01:38:26 +00:00
Matan Lurey
6a145094ab
Further skip native_assets_test(s) that runs flutter build apk. (#158966)
Towards https://github.com/flutter/flutter/issues/158560.

Still occurred twice in the last 24h:

https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20tool_integration_tests_6_6/42/overview
https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20tool_integration_tests_6_6/44/overview

Let's continue to debug why these are so troublesome, but not block the tree doing so.
2024-11-15 01:34:49 +00:00
Ben Konyi
d0bd283734
[ tool ] Don't throw StateError when DDS fails to start (#158744)
This started happening after moving DDS to launch from `dart
development-service` rather than `DartDevelopmentService` (see
33b402d24c) . This state error was
originally meant to be thrown when some string parsing failed, but is
currently wrapping the `DartDevelopmentServiceException`.

Fixes https://github.com/flutter/flutter/issues/158537
2024-11-14 19:43:15 -05:00
kzrnm
dca37ad17f
[gen_l10n] When localizing a message, prefer placeholder definitions defined by the current locale rather than the template locale (#153459)
- Fixes #153457
- Fixes #116716
2024-11-14 21:48:14 +00:00
August
f35cd558f8
feat: Include web 1.x.x in plugin template (#156947)
This adds support for web 1.x.x to be included in the plugin template, when creating a web plugin.

I don't have an issue referenced. Related to https://github.com/dart-lang/web/issues/316
2024-11-14 21:48:12 +00:00
Andrew Kolos
a1a7409092
hide members where possible (#158492)
I was poking around in logger.dart when I noticed a few classes have unnecessary exposed member variables. This PR reduces visibility of these in the pursuit of making these classes slightly easier to grok.

<details>

<summary> Pre-launch checklist </summary> 

</details>
2024-11-14 21:46:10 +00:00
Andrew Kolos
21144362f8
Move platform-specific log-reading implementation details from ResidentRunner/FlutterDevice to DeviceLogReader implementations (#156181)
Cleans up https://github.com/flutter/flutter/pull/155800. In summary, `ResidentRunner`/`FlutterDevice` have branching behavior around logging that depends on the type of `DeviceLogReader` on the `FlutterDevice` instance.  Let's instead move this behavior to the `DeviceLogReader` implementations.

My apologies for the large diff. Much of this is a refactor that was a bit too difficult to separate into its own commits. 

Here are the main two changes

* Replaces the mutable `connectedVmService` field on the `DeviceLogReader` class with a new method `provideVmService`. This serves largely the same purpose as the mutable field, but it allows for asynchronous code. This is where we put the logic that used to exist in `FlutterDevice.tryInitLogReader`.
* Removes the `tryInitLogReader` method from `FlutterDevice`. This method served to set the `appPid` field on the `FlutterDevice`'s `DeviceLogReader` instance. This was only used in the case of Android to filter out logs unrelated to the flutter app coming from the device, so we can move this logic to `AdbLogReader`'s implementation of `provideVmService`.
2024-11-14 21:29:30 +00:00
Ben Konyi
e40306f92f
Enable --verbose for android_plugin_skip_unsupported_test tests (#158933)
Hoping this will give some more insights into https://github.com/flutter/flutter/issues/157640
2024-11-14 18:35:16 +00:00
Camille Simon
46a41585eb
Add dev_dependency attribute to plugins in .flutter-plugins-dependencies (#158009)
Adds whether or not the plugins in `.flutter-plugins-dependencies` are dev dependencies or not (as the `dev_dependency` attribute).

Fixes https://github.com/flutter/flutter/issues/157948.
2024-11-14 18:08:09 +00:00
Matan Lurey
752ac20f87
No longer pass --verbose to implicit pub calls when flutter --verbose is set. (#158898)
Closes https://github.com/flutter/flutter/issues/158896.
2024-11-14 08:59:49 -08:00
Matan Lurey
125b4e945e
Move explicit package dependencies to a feature flag (#158016)
Closes https://github.com/flutter/flutter/issues/158012.

This is (effectively) a user-facing NOP, which is exchanging an
on-by-default command-line argument (`--implicit-pubspec-resolution`)
for an off-by-default global feature flag
(`explicit-package-dependencies`). It matches the mental model better,
is less painstaking to maintain and feed throughout, and will be easier
to globally flip on/off in a future PR.

---------

Co-authored-by: Andrew Kolos <andrewrkolos@gmail.com>
2024-11-13 18:33:34 -08:00
Matan Lurey
9ac9049d09
Try with bringup: true debugging why flutter build apk often times out. (#158895)
It would be nice to have somewhere to iterate and experiment with what we can do to either fix frequent timeout problems we have with `flutter build apk` (across platforms, to be clear, though I've just started with Linux) or get more information on why the crashes/timeouts happen.

Open to other ways to doing this (though preferably _not_ LED).
2024-11-14 02:12:14 +00:00
Mitchell Goodwin
5f93a7f7ea
Adds a skip message for analyzer (#158890)
#158880 causes the linux analyzer to complain for not having a skip
message.
2024-11-13 14:38:56 -08:00
Loïc Sharma
8a55c941cf
[SwiftPM] Move the logic for SwiftPM enablement to the platform project (#158213)
In the future, it will be possible for Swift Package Manager to be enabled on one but not all platforms (see https://github.com/flutter/flutter/issues/151567#issuecomment-2455941279).

This moves the `usesSwiftPackageManager` property from the platform-agnostic `Project` to the platform-specific `IosProject` and `MacOSProject`.

This will allow the `IosProject` and `MacOSProject` to return different values for `usesSwiftPackageManager` in the future. For now, both of these projects will always return the same value.

Part of https://github.com/flutter/flutter/issues/151567
2024-11-13 21:45:07 +00:00
Matan Lurey
5a9c2b4dd1
Temporarily skip flutter build apk for native_assets tests. (#158880)
Work around for https://github.com/flutter/flutter/issues/158560.
2024-11-13 20:57:13 +00:00
Matan Lurey
7374452eca
Stream the output of flutter build for debugging. (#158757)
Towards https://github.com/flutter/flutter/issues/158560.
2024-11-13 18:55:47 +00:00
Matan Lurey
ed553d10cf
Avoid using platform ProcessInfo.maxRss in test. (#158526)
Closes https://github.com/flutter/flutter/issues/157629.

Avoids failures in the style:
```txt
00:37 +4597 ~3 -1: /Users/matanl/Developer/flutter/packages/flutter_tools/test/commands.shard/permeable/build_appbundle_test.dart: analytics logs success [E]                                                                                                        
  Expected: contains Event:<{"eventName":"flutter_command_result","eventData":{"commandPath":"create","result":"success","commandHasTerminal":false,"maxRss":147013632}}>
    Actual: [
              Event:{"eventName":"command_usage_values","eventData":{"workflow":"create","commandHasTerminal":false,"createProjectType":"app","createAndroidLanguage":"kotlin","createIosLanguage":"swift"}},
              Event:{"eventName":"flutter_command_result","eventData":{"commandPath":"create","result":"success","commandHasTerminal":false,"maxRss":143261696}},
              Event:{"eventName":"timing","eventData":{"workflow":"flutter","variableName":"create","elapsedMilliseconds":527,"label":"success"}},
              Event:{"eventName":"command_usage_values","eventData":{"workflow":"appbundle","commandHasTerminal":false,"buildAppBundleTargetPlatform":"android-arm,android-arm64,android-x64","buildAppBundleBuildMode":"release"}},
              Event:{"eventName":"flutter_command_result","eventData":{"commandPath":"appbundle","result":"success","commandHasTerminal":false,"maxRss":147013632}},
              Event:{"eventName":"timing","eventData":{"workflow":"flutter","variableName":"appbundle","elapsedMilliseconds":10,"label":"success"}}
            ]
     Which: does not contain Event:<{"eventName":"flutter_command_result","eventData":{"commandPath":"create","result":"success","commandHasTerminal":false,"maxRss":147013632}}>
```

I am guessing <https://api.flutter.dev/flutter/dart-io/ProcessInfo/maxRss.html> is not guaranteed to be stable while running, and as a result is not. This stabilizes the value for a test that I believe does not care about getting the "real" value anyway.
2024-11-13 18:03:58 +00:00
Matan Lurey
2d1a3efc38
Move dart pub deps call to <Pub>.deps and use it accordingly (#158524)
Closes https://github.com/flutter/flutter/issues/158396, closes https://github.com/flutter/flutter/pull/158370.
2024-11-13 18:03:53 +00:00
Matan Lurey
a0f2154419
Allow devDependencies to be omitted and not cause a tool crash. (#158518)
Closes https://github.com/flutter/flutter/issues/158441.
2024-11-13 01:04:01 +00:00
Matan Lurey
72fc9b4b37
Explain how to use flutter channel. (#158533)
Closes https://github.com/flutter/flutter/issues/152274.

I ran into https://github.com/flutter/flutter/issues/152274 myself, so seemed like an easy fix.
2024-11-13 00:42:00 +00:00
Loïc Sharma
003135e2d0
[SwiftPM] Update .flutter-plugin-dependencies format (#158138)
In the future, it will be possible for Swift Package Manager to be enabled on one but not all platforms (see https://github.com/flutter/flutter/issues/151567#issuecomment-2455941279).

This updates the `.flutter-plugin-dependencies` file format to separate iOS's and macOS's SwiftPM enablement. For now, these platforms will always have the same value.

This `.flutter-plugin-dependencies` file is read by our CocoaPods scripts to determine whether we should use CocoaPods or not to inject plugins.

Part of https://github.com/flutter/flutter/issues/151567
2024-11-12 20:01:26 +00:00
Andrew Kolos
37d80ce25f
add filesystem error handling to systemTempDirectory (#158481)
Fixes https://github.com/flutter/flutter/issues/153777.

To summarize that issue, `ErrorHandlingFileSystem.systemTempDirectory` calls [`LocalFileSystem.systemTempDirectory`](45c8881eb2/packages/flutter_tools/lib/src/base/file_system.dart (L229)), which makes a `Directory.createSync` call, which can throw exceptions that _should_ be handled and result in a graceful tool exit (e.g. insufficient storage). However, we aren't catching those, hence this issue. 

All we need to do is wrap that call with the `FileSystemException`-handling logic we already have in the tool. See the diff.

I don't think I'll be cherry-picking this since 1) it's not an extremely common crash and 2) users can probably pick apart the crash message and figure out that they need to clear some storage space to proceed.

<details>

<summary> Pre-launch checklist </summary> 

</details>
2024-11-12 18:14:45 +00:00
Loïc Sharma
563fb0c743
[SwiftPM] Simplify logic that determines if CocoaPods is used (#158409)
This is a refactoring with no semantic changes. I will get a text exemption.

Part of https://github.com/flutter/flutter/issues/151567
2024-11-11 21:03:30 +00:00
Ben Konyi
d89e65d516
Replace custom RPCErrorCodes with RPCErrorKind from package:vm_service (#158379)
Removes duplicated constants and ensures consistency by using package:vm_service as a source of truth for RPC error codes for requests made with package:vm_service.
2024-11-11 15:18:09 +00:00
Younghan Kim
18071ec0a8
Remove block and line comments when detecting '.flutter-plugins' in settings.gradle(.kts) (#155488)
**PR Title:**

Remove block and line comments when detecting `'.flutter-plugins'` in `settings.gradle`

---

**Description:**

This PR modifies the `configureLegacyPluginEachProjects` function to remove block (`/* ... */`) and line (`// ...`) comments from the `settings.gradle` or `settings.gradle.kts` file content before checking for the presence of the `'.flutter-plugins'` string. This ensures that only uncommented, meaningful code is considered during the detection, preventing false positives when the string appears within comments.

**Why is this change necessary?**

In some cases, the `'.flutter-plugins'` string may be present inside comments in the `settings.gradle` file. The existing implementation does not account for this and may incorrectly detect the string even when it's commented out. This can lead to unintended behavior, such as configuring plugin projects when it is not necessary.

By removing comments before performing the check, we prevent false positives and ensure that the detection logic is accurate, only acting when the `'.flutter-plugins'` string is present in active code.

**Changes Made:**

- **Added comment removal logic:**
  - Removed block comments (`/* ... */`) using the regular expression `/(?s)\/\*.*?\*\//`.
    - The `(?s)` flag enables dot-all mode, allowing `.` to match newline characters.
  - Removed line comments (`// ...`) using the regular expression `/(?m)\/\/.*$`.
    - The `(?m)` flag enables multi-line mode, so `^` and `$` match the start and end of each line.
  - Combined both comment removal steps into a single chain for efficiency.

- **Updated the string detection:**
  - The check for `'.flutter-plugins'` is now performed on the uncommented content of the `settings.gradle` file.
  - This ensures that only meaningful, uncommented code is considered during detection.

**Issue Fixed:**

- Fixes [#155484](https://github.com/flutter/flutter/issues/155484)

---

---

If you need any further assistance or have questions, feel free to reach out!

---

**Links:**

- [Contributor Guide]
- [Tree Hygiene]
- [Flutter Style Guide]
- [Features we expect every widget to implement]
- [CLA]
- [flutter/tests]
- [breaking change policy]
- [Discord]
- [Data Driven Fixes]
2024-11-11 02:47:32 +00:00
Phil Quitslund
e222381e29
remove redundant arguments (#158349)
An upcoming fix to the analyzer will (correctly) catch these args as
redundant
(https://dart-review.googlesource.com/c/sdk/+/394004/2/pkg/analyzer/lib/src/dart/ast/ast.dart).

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-11-08 09:30:26 -08:00
Jason Simmons
8461ceea43
Manual roll Flutter Engine from 371c86fb6b49 to bcb281cde579 (#158346)
Includes changes required by the new Dart formatter.
2024-11-07 22:39:19 +00:00
Ben Konyi
998f42a3f0
Increase Java heap limit to 8GB for plugin integration tests using deferred components (#158330)
Should help resolve https://github.com/flutter/flutter/issues/156953
2024-11-07 15:24:25 -05:00
Matan Lurey
3c689ce6b7
Fix a breakage caused by the test being unskipped. (#158335)
https://github.com/flutter/flutter/pull/158204 collided with
https://github.com/flutter/flutter/pull/157462.

Fortunately the change is 1-line in 1-test.
2024-11-07 10:16:18 -08:00
Matan Lurey
78cfc1ae9b
Plugin.isDevDependency if exclusively in dev_dependencies (#157462)
Work towards https://github.com/flutter/flutter/issues/56591.

I explicitly want an LGTM from @andrewkolos @jmagman @jonahwilliams before merging.

---

After this PR, `<Plugin>.isDevDependency` is resolved based on the following logic, IFF:

- The plugin comes from a package _A_ listed in the app's package's `dev_dependencies: ...`
- The package _A_ is not a normal dependency of any transitive non-dev dependency of the app

See [`compute_dev_dependencies_test.dart`](51676093a3/packages/flutter_tools/test/general.shard/compute_dev_dependencies_test.dart) for probably the best specification of this behavior.

We (still) do not write the property to disk (i.e. it never makes it to `.flutter-plugins-dependencies`), so there is no impact to build artifacts at this time; that would come in a follow-up PR (and then follow-up follow-up PRs for the various build systems in both Gradle and Xcode to actually use that value to omit dependencies).

Some tests had to be updated; for the most part it was updating the default `ProcessManager` because a call to `dart pub deps --json` is now made in code that computes what plugins are available, but there should be no change in behavior.

_/cc @jonasfj @sigurdm for FYI only (we talked on an internal thread about this; see https://github.com/dart-lang/sdk/issues/56968)._

_/cc @camsim99 @cbracken @johnmccutchan for visibility on the change._
2024-11-07 18:09:22 +00:00
Ben Konyi
933323488b
Fix flakiness in hot_reload_test.dart (#158271)
The test was immediately checking the contents of stdout after the daemon indicated that the hot reload had completed. This could cause a race since the reloaded code may not have had time to execute.

Fixes https://github.com/flutter/flutter/issues/158245
2024-11-06 22:14:19 +00:00
Gray Mackall
b8e56e3063
Fix use of deprecated buildDir in Android templates/tests/examples (#157560)
Replace deprecated `Project.buildDir` [getter](https://docs.gradle.org/current/javadoc/org/gradle/api/Project.html#getBuildDir()) and [setter](https://docs.gradle.org/current/javadoc/org/gradle/api/Project.html#setBuildDir(java.io.File)) uses.
2024-11-06 21:34:23 +00:00
flutter-pub-roller-bot
231583bf67
Roll pub packages (#158281)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-11-06 19:37:09 +00:00
Martin Kustermann
3a83e43ede
Make flutter_tools use newest package:{native_assets_builder,native_assets_cli,native_toolchain_c} (#158214)
Almost all of the code is just adopting to changes to the APIs of
`package:native_assets_builder`, `package:native_assets_cli` and
`package:native_toolchain_c`

There's only two semantic changes

* Removes a test that checks for a verification error if a build hook
produces a static library if the preferred linking mode is dynamic:
=> The test is written in a very hacky way. By monkey patching the build
config.json that flutter build actually made. This monkey patching
relies on package:cli_config which is now no longer used.
=> The actual code that checks for this mismatch lives in
dart-lang/native repository and is tested there. So there's really no
need to duplicate that.

* The `package:native_assets_builder` no longer knows about code assets.
This is something a user of that package (e.g. flutter tools) adds. Now
the dry-run functionality will invoke build hooks who produce code
assets without an architecture.
=> The `package:native_assets_builder` used to expand such a code asset
to N different code assets (one for each supported architecture)
=> This logic was now moved to flutter tools. => In the near future
we're going to this dry-run complexity, which will then also get rid of
this uglyness (of expanding to all archs of an OS).
2024-11-06 14:12:34 +01:00
LouiseHsu
dff191625f
Update error message for Cocoapods support for synchronized groups/folders (#158206)
Update to https://github.com/flutter/flutter/issues/156733
2024-11-06 01:08:54 +00:00
Matan Lurey
2f7a1aa20b
Restore skipped iOS test by looping over FakeAsync elapse. (#158204)
Closes https://github.com/flutter/flutter/issues/60675.

From what I can tell `FakeAsync` wasn't necessary to making this be testable (or at least it isn't anymore?)
2024-11-06 01:05:01 +00:00
Matan Lurey
c6dea5e4b4
Remove unused enableObservatory flag. (#158202)
I checked google3 as well and couldn't find any reference.
2024-11-05 23:49:01 +00:00
Matan Lurey
0b6f99769d
Remove observatory related TODO that is already fixed. (#158205)
Description intentionally left blank :)
2024-11-05 23:43:50 +00:00
Andrew Kolos
8d3cca43b2
use root directory as the default for rootOverride in Cache.test constructor (#158201)
While doing some hacking on `Cache` in https://github.com/flutter/flutter/pull/158081, I noticed that [`Cache.test`](de93182753/packages/flutter_tools/lib/src/cache.dart (L139)) allows the caller to tell Cache to use some given directory as the flutter root (instead of depending on the static global [`Cache.flutterRoot`](4f3976a4f2/packages/flutter_tools/lib/src/cache.dart (L206))). This has a default value, `/cache`. However, `/cache` is an unintuitive name for the root directory of a Flutter installation.

This led to confusion when updating some tests. I wanted to create `/bin/cache/engine-dart-sdk.stamp` for tests, but in reality I needed to create `/cache/bin/cache/engine-dart-sdk.stamp`.

This PR changes this default to the current directory of the file system (which I'm guessing is `/` for all intents and purposes). 

<details>

<summary> Pre-launch checklist </summary> 

</details>
2024-11-05 23:00:05 +00:00
Jenn Magder
b6fef5cfda
Kill interactive script job xcdevice observe processes on tool/daemon shutdown (#157646)
To convince `xcdevice observe` to redirect to stdout it's being launched in an interactive shell `/usr/bin/script -t 0 /dev/null /usr/bin/arch -arm64e xcrun xcdevice observe --usb`
1cc8a07ace/packages/flutter_tools/lib/src/macos/xcdevice.dart (L261-L263)

When the `flutter` command exits, the interactive script process is terminated, but not its jobs `xcdevice observe --usb`.

Instead of `-9` sigterm killing the interactive script, send it a [`SIGHUP`](https://linux.die.net/Bash-Beginners-Guide/sect_12_01.html#sect_12_01_01_02) (signal hangup) during `XCDevice.dispose()`, which will exit its processes.  Add a shutdown hook to ensure `dispose` is run when the process exits.

Fixes https://github.com/flutter/flutter/issues/73859
2024-11-05 19:01:01 +00:00
Polina Cherkasova
b8519bc21e
Reland2: Revert "Revert "Add a warning/additional handlers for parsingsynthetic-package."" (#158184)
Reverts flutter/flutter#158078
2024-11-05 09:42:57 -08:00
Polina Cherkasova
04d3d1a4c3
Reland1: "Revert "Add and plumb useImplicitPubspecResolution across flutter_tools."" (#158126)
Reverts flutter/flutter#158076
2024-11-05 08:49:42 -08:00
Martin Kustermann
31c1292be3
Make native asset integration test more robust, thereby allowing smooth auto-update of packages via flutter update-packages (#158170)
Currently the bot that runs `flutter update-packages` makes PRs that
fail due to native asset integration tests failing.

The root cause is due to incompatible versions on `package:logging`. The
bot tries to upgrade `package:logging` from `1.2.0` to `1.3.0`.

Here's what seems to happen:

* `flutter update-packages` will update
`dev/integration_tests/link_hook/pubspec.yaml` with `package:logging` to
`1.3.0` (as it does with all other `pubspec.yaml` files in the flutter
repository)

* `flutter create --template=package_ffi` will generate a template with
`package:logging` `^1.2.0`

  * The test in question
    * creates ffi template (which will use `^1.2.0`)
* make it depend on `dev/integration_tests/link_hook` (which uses
`=1.3.0`)
* changes logging dependency from the template from `^1.2.0` to `=1.2.0`

IMHO

  * `flutter update-packages` is doing what it's supposed to

* `flutter create --template=package_ffi` can generate templates with
versions it determines (maybe there are use cases where we want to
generate templates with older versions)

  * The problematic part is the test:

     * it makes the generated template depend on `link_hook` and
     * changes template generated pubspec to use pinned dependencies

This PR makes the test package (created via template) use the pinned
package versions from `dev/integration_tests/link_hook` (for
dependencies that are common among the two).
All other dependencies that the template has on top of
`dev/integration_tests/link_hook` it can pin as it does currently.

This will give us deterministic CI behavior (as we use flutter pined
packages and remaining deps being pinned via template) It avoids
changing the `flutter update-packages` and `flutter create
--template=package_ffi` (as their behavior seems reasonable)

Should fix https://github.com/flutter/flutter/issues/158135
2024-11-05 16:08:34 +01:00
Mohellebi abdessalem
ecc2437186
Readability change to flutter.groovy, align on null assignment, reduce unused scope for some methods, apply static where possible (#157471)
removed public modifier from this methods :`getVersionCode` , `getVersionName`.
add static to :`pluginSupportsAndroidPlatform` ,`buildGradleFile`,`settingsGradleFile`
`getCompileSdkFromProject` ,`getAssembleTask` 
refactor `==null` usage  to `:?` to unify the usage 

see https://github.com/flutter/flutter/issues/147122 for context
2024-11-05 14:49:26 +00:00
Polina Cherkasova
33f7137aeb
Add optional parameter to FlutterTesterDevices. (#158133)
This is to handle Google testing failures for  https://github.com/flutter/flutter/pull/158126.

We want to update G3 to provide this parameter before merging the full change.

Testing is not needed because the change is no-op.
2024-11-05 02:09:35 +00:00