Commit Graph

114 Commits

Author SHA1 Message Date
Matan Lurey
d8856b9e50
Remove the last vestiges of null-unsafety in flutter_tools. (#164026)
The internal code using this was deleted in `cl/730558889`.
2025-02-27 16:31:22 +00:00
Jenn Magder
898ab2479e
Check if simctl is installed before trying to list devices or runtimes (#163895)
After https://github.com/flutter/flutter/pull/163785 there was still an
unexpected `xcrun simctl` output on a machine with Xcode only half
installed https://github.com/flutter/flutter/issues/161655.

Check `simctl` is installed before trying to list booted simulator
devices or runtimes.

Should address https://github.com/flutter/flutter/issues/161655.

## 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-25 22:24:49 +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
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
Sigurd Meldgaard
2812d4685c
Stop reading .packages from flutter_tools. (#154912) 2024-09-13 13:53:05 +02:00
Ben Konyi
33b402d24c
Reland "Launch DDS from Dart SDK and prepare to serve DevTools from DDS (#146593)" (#152386)
This reverts commit 7cdc23b3e1.

The failure in the `native_assets_test` integration test on Windows was caused by the DevTools process not being shutdown by the `ColdRunner` when running the profile mode portion of the test. This resulted in the test being unable to clean up the project created by the test as DevTools was still holding onto a handle within the directory. This PR adds back the mistakenly removed DevTools shutdown logic in the `ColdRunner`.
2024-07-26 20:51:19 +00:00
Jenn Magder
f33ffc00ea
Use Xcode build setting PRODUCT_NAME to find app and archive paths (#140242)
1. Instead of getting the `FULL_PRODUCT_NAME` Xcode build setting (`Runner.app`) instead use `PRODUCT_NAME` since most places really want the product name, and the extension stripping wasn't correct when the name contained periods.
2. Don't instruct the user to open the `xcarchive` in Xcode if it doesn't exist.

Fixes https://github.com/flutter/flutter/issues/140212
2024-07-22 23:54:24 +00:00
auto-submit[bot]
7cdc23b3e1
Reverts "Launch DDS from Dart SDK and prepare to serve DevTools from DDS (#146593)" (#151781)
Reverts: flutter/flutter#146593
Initiated by: zanderso
Reason for reverting: Consistently failing `Windows_android native_assets_android` as in https://ci.chromium.org/ui/p/flutter/builders/prod/Windows_android%20native_assets_android/2533/overview 
Original PR Author: bkonyi

Reviewed By: {christopherfujino, kenzieschmoll}

This change reverts the following previous change:
This change is a major step towards moving away from shipping DDS via Pub.

The first component of this PR is the move away from importing package:dds to launch DDS. Instead, DDS is launched out of process using the `dart development-service` command shipped with the Dart SDK. This makes Flutter's handling of DDS consistent with the standalone Dart VM.

The second component of this PR is the initial work to prepare for the removal of instances of DevTools being served manually by the flutter_tool, instead relying on DDS to serve DevTools. This will be consistent with how the standalone Dart VM serves DevTools, tying the DevTools lifecycle to a live DDS instance. This will allow for the removal of much of the logic needed to properly manage the lifecycle of the DevTools server in a future PR. Also, by serving DevTools from DDS, users will no longer need to forward a secondary port in remote workflows as DevTools will be available on the DDS port.

There's two remaining circumstances that will prevent us from removing DevtoolsRunner completely:

 - The daemon's `devtools.serve` endpoint
 - `flutter drive`'s `--profile-memory` flag used for recording memory profiles

This PR also includes some refactoring around `DebuggingOptions` to reduce the number of debugging related arguments being passed as parameters adjacent to a `DebuggingOptions` instance.
2024-07-15 19:55:18 +00:00
Ben Konyi
f023430859
Launch DDS from Dart SDK and prepare to serve DevTools from DDS (#146593)
This change is a major step towards moving away from shipping DDS via
Pub.

The first component of this PR is the move away from importing
package:dds to launch DDS. Instead, DDS is launched out of process using
the `dart development-service` command shipped with the Dart SDK. This
makes Flutter's handling of DDS consistent with the standalone Dart VM.

The second component of this PR is the initial work to prepare for the
removal of instances of DevTools being served manually by the
flutter_tool, instead relying on DDS to serve DevTools. This will be
consistent with how the standalone Dart VM serves DevTools, tying the
DevTools lifecycle to a live DDS instance. This will allow for the
removal of much of the logic needed to properly manage the lifecycle of
the DevTools server in a future PR. Also, by serving DevTools from DDS,
users will no longer need to forward a secondary port in remote
workflows as DevTools will be available on the DDS port. This code is currently 
commented out and will be enabled in a future PR.

There's two remaining circumstances that will prevent us from removing
DevtoolsRunner completely:

 - The daemon's `devtools.serve` endpoint
- `flutter drive`'s `--profile-memory` flag used for recording memory
profiles

This PR also includes some refactoring around `DebuggingOptions` to
reduce the number of debugging related arguments being passed as
parameters adjacent to a `DebuggingOptions` instance.
2024-07-15 14:08:31 -04:00
Sigurd Meldgaard
21d996929b
Refactor BuildInfo to always require packageConfigPath (#150559)
Refactor warming up to #150196
2024-07-02 11:19:31 +02:00
Jenn Magder
d754a371d9
Remove dead compareIosVersions function (#146298)
Dead all the back in #10780
2024-04-04 21:19:46 +00:00
Derek Xu
406c4dbf77
Add --trace-to-file option to flutter run (#135713) 2023-10-12 13:23:52 -04:00
Victoria Ashworth
b39604e02d
Check for simulator runtime in flutter doctor (#131795)
Redo of https://github.com/flutter/flutter/pull/130728 - code is the same as before. That PR was stuck in Google testing and then I messed up the rebase so started over.

----

Starting in Xcode 15, the simulator is no longer included in Xcode and must be downloaded and installed separately. This adds a validation to `flutter doctor` to warn when the needed simulator runtime is missing.

Validation message looks like:
```
[!] Xcode - develop for iOS and macOS (Xcode 15.0)
    ! iOS 17.0 Simulator not installed; this may be necessary for iOS and macOS development.
      To download and install the platform, open Xcode, select Xcode > Settings > Platforms,
      and click the GET button for the required platform.

      For more information, please visit:
        https://developer.apple.com/documentation/xcode/installing-additional-simulator-runtimes
```

It may also show an error like this when something goes wrong when checking for the simulator:
```
[!] Xcode - develop for iOS and macOS (Xcode 15.0)
    ✗ Unable to find the iPhone Simulator SDK.
```

Note: I'm unsure of in the future if the SDK and the simulator runtime will need to match the exact version or just the major. For now, it only checks against the major version.

Part 3 of https://github.com/flutter/flutter/issues/129558.
2023-08-04 17:14:06 +00:00
Michael Goderbauer
55b6f049a6
Enable unreachable_from_main lint - it is stable now!!1 (#129854)
PLUS: clean-up of all the unreachable stuff.
2023-07-06 00:09:01 +00:00
Christopher Fujino
3736274a6d
Revert "[flutter_tools] Remove sound null safety flag (#123031)" (#123280)
Revert "[flutter_tools] Remove sound null safety flag (#123031)"
2023-03-22 22:53:49 +00:00
Zachary Anderson
7e88acfb0e
[flutter_tool] Adds a flag to disable Impeller (#122960) 2023-03-20 22:23:23 -07:00
Christopher Fujino
f4c3facfdd
Revert "Revert "[flutter_tools] Remove sound null safety flag (#120936)" (#122909)" (#123031)
[flutter_tools] Remove sound null safety flag #2
2023-03-20 22:32:07 +00:00
Christopher Fujino
f6bc147c91
Revert "[flutter_tools] Remove sound null safety flag (#120936)" (#122909)
This reverts commit 7c3088cf22.
2023-03-17 11:31:48 -07:00
Christopher Fujino
7c3088cf22
[flutter_tools] Remove sound null safety flag (#120936)
[flutter_tools] Remove sound null safety flag
2023-03-17 17:48:35 +00:00
Ben Konyi
ecd7518df5
Reland "Remove references to Observatory (#118577)" (#121606)
This reverts commit 275ab9c69b.
2023-02-28 11:57:04 -05:00
Michael Goderbauer
275ab9c69b
Revert "Reland "Remove references to Observatory (#118577)" (#121215)" (#121555)
Revert "Reland "Remove references to Observatory (#118577)""
2023-02-27 23:46:53 +00:00
Ben Konyi
fbae472fc3
Reland "Remove references to Observatory (#118577)" (#121215)
This reverts commit 298d8c76ba.
2023-02-27 09:26:43 -05:00
Casey Hillers
298d8c76ba
Revert "Remove references to Observatory (#118577)" (#120929)
This reverts commit 2df140f40d.
2023-02-16 21:28:30 -08:00
Ben Konyi
2df140f40d
Remove references to Observatory (#118577)
Observatory is being deprecated for Dart 3.0 so it should no longer be
referenced in tooling messaging / flags.

See https://github.com/dart-lang/sdk/issues/50233
2023-02-13 14:29:30 -05:00
Victoria Ashworth
3a656b16cb
Add more supported simulator debugging options and improve tests (#114628)
* add debugging options to simulator, test more debugging flags, add tests for other launch arguements

* refactor iOS launch arguments to use one function for both simulator and physical devices

* treat dart flags differently between physical and simulator

* Simplify some flags between devices.

Change --disable-service-auth-codes to not always be included for physical devices, only if disableServiceAuthCodes is true.
Change --disable-observatory-publication to be used for simulator devices too.
Change --enable-checked-mode & --verify-entry-points to be used if debuggingEnabled is true regardless of device type.
Chnage --trace-startup to be used for simulator devices too.

* fix ios release mode with buildable app startApp test

* determine observatory-port from deviceVmServicePort and hostVmServicePort

* add comments and remove hasObservatoryPort
2022-11-09 18:17:09 +00:00
Jenn Magder
15e694414c
Terminate simulator app on "q" (#114114) 2022-10-27 22:06:35 +00:00
Jenn Magder
609b8f3219
Revert part of "Terminate simulator app on "q" (#113581)" (#114083) 2022-10-26 10:26:14 -07:00
Jenn Magder
4d28e6d064
Terminate simulator app on "q" (#113581) 2022-10-18 22:26:16 +00:00
Jenn Magder
61ac000d65
Enable impeller flags for iOS simulator (#113350) 2022-10-12 20:37:06 +00:00
Jenn Magder
7c7ae991e5
Use hasNoRemainingExpectations matcher for fake process manager in tool tests (#108649) 2022-07-30 02:02:05 +00:00
Jenn Magder
167655e8a7
Only show iOS simulators, reduce output spew in verbose (#108345) 2022-07-26 19:08:06 +00:00
Jonah Williams
db829c1e20
[flutter_tools] migrate more unit tests to null safety (#106153) 2022-06-17 21:34:27 -07:00
Alexandre Ardhuin
07f1c20474
add missing trailing commas in list/set/map literals (#102585) 2022-04-27 09:15:35 +02:00
Jesús S Guerrero
fbbf3ec471
Support route on ios (#99078) 2022-03-07 11:31:21 -08:00
Ben Konyi
2a2f973120
Update flutter_tools to look for new VM service message (#97683)
* Update flutter_tools to look for new VM service message

The Dart SDK will soon move away from the current Observatory message:

"Observatory listening on ..."

To a new message that no longer references Observatory:

"Dart VM Service listening on ..."

This change updates all tests with mocks to check for the new message
and also adds support for the new message in ProtocolDiscovery.

See https://github.com/dart-lang/sdk/issues/46756

* Fix some parsing locations

* Fix analysis failures

* Update message

* Remove extra comment

* Update message

* Add globals prefix
2022-02-15 07:33:57 -08:00
Lau Ching Jun
7f0050f5b3
Add a new PrebuiltFlutterApplicationPackage interface. (#95290)
* Add a new PrebuiltFlutterApplicationPackage interface.

* Review feedback

* Rename bundleDir to uncompressedBundle
2022-01-05 07:54:57 -08:00
Jenn Magder
9e88fe328e
Remove globals_null_migrated.dart, move into globals.dart (#92861) 2021-11-01 17:18:03 -07:00
Jenn Magder
53e04de681
Migrate mdns_discovery and ios simulator to null safety (#92124) 2021-10-29 17:18:03 -07:00
Jenn Magder
faaca13f22
Catch FormatException from bad simulator log output (#90966) 2021-09-30 09:33:04 -07:00
Jonah Williams
5ac54a6b89
[flutter_tools] remove mocks from simcontrol and context (#81433) 2021-04-28 19:14:02 -07:00
Jenn Magder
56c0002c47
Adopt FakeProcessManager.empty (#80480) 2021-04-15 14:19:02 -07:00
Jenn Magder
152af5aba7
Fix device_port_forwarder file name typo (#79481) 2021-03-31 18:14:03 -07:00
Jenn Magder
8ddc27e607
Split globals.dart into null sound and unsound libraries (#79016) 2021-03-31 16:55:20 -07:00
Jonah Williams
29207e4f78
[flutter_tools] split application package factory dependencies (#79461) 2021-03-31 15:11:58 -07:00
Jenn Magder
5d87b3efbf
Migrate code_signing to null safety (#79342) 2021-03-30 08:19:28 -07:00
Jenn Magder
8893e89d11
Migrate device_port_forwarder to null safety (#78949) 2021-03-24 16:56:14 -07:00
Michael Goderbauer
cb867bbedc
Enable unnecessary_await_in_return lint (#77434) 2021-03-05 18:38:15 -08:00
Jonah Williams
666c950989
[flutter_tools] replace most MockBuildSystem instances with TestBuildSystem (#76821) 2021-02-26 08:46:00 -08:00
Sam Rawlins
ba58ad0385
Remove "unnecessary" imports in test/general.shard (#75954) 2021-02-18 13:38:24 -08:00
Jonah Williams
04182572f7
[flutter_tools] allow bypassing context for FlutterProject creation, remove fromPath (#76258) 2021-02-18 12:36:04 -08:00