Commit Graph

4899 Commits

Author SHA1 Message Date
Michael Goderbauer
571039f6ee
Bump flutter_lints to 3.0 (#136841)
Follow-up to https://github.com/flutter/packages/pull/5177
2023-10-18 23:53:08 +00:00
auto-submit[bot]
c32ffa65c9
Reverts "[Reland] Skip injecting Bonjour settings when port publication is disabled" (#136839)
Reverts flutter/flutter#136751
Initiated by: vashworth
This change reverts the following previous change:
Original Description:
Reland of https://github.com/flutter/flutter/pull/136562 with fixes.
2023-10-18 20:33:17 +00:00
Victoria Ashworth
1599cbebc3
[Reland] Skip injecting Bonjour settings when port publication is disabled (#136751)
Reland of https://github.com/flutter/flutter/pull/136562 with fixes.
2023-10-18 20:08:19 +00:00
Daco Harkes
402a5455d9
Don't build native assets in flutter build bundle (#136641)
Closes: https://github.com/flutter/flutter/issues/136547
2023-10-18 11:57:44 +00:00
Christopher Fujino
8a31a3a284
Flutter preview device (#135639)
Fixes https://github.com/flutter/flutter/issues/130277

This PR does two things:

1. introduce a hidden `flutter build _preview` command, that will build a debug windows desktop app and copy it into the SDK's binary cache. This command is only intended to be run during packaging.
2. introduce a new device type, called `PreviewDevice`, which relies on the prebuilt desktop debug app from step 1, copies it into the target app's assets build folder, and then hot reloads their dart code into it.
2023-10-18 00:27:54 +00:00
Andrew Kolos
cdc40b5226
clean up --dart-define-from-file option tests (#135980)
Fixes https://github.com/flutter/flutter/issues/134279.

Changes:
* Moves all tests of `--dart-define-from-file` behavior from `build_bundle_test.dart` and `assemble_test.dart` to `flutter_command_test.dart`.
* Deletes a duplicate test of malformed JSON detection behavior.
* Renames the `useDartDefineFromFileOption` method of `FlutterCommand` to `_usesDartDefineFromFileOption`. This 1) makes the name more consistent with the other `uses*Option` methods and 2) hides the method since it is not used outside of the file.
* Renames several tests to better articulate what is under test and what the expected result is.
* Adds a test for the case where a `.env` file with a malformed line is provided to `--dart-define-from-file`.
2023-10-17 22:31:38 +00:00
Aran Donohue
48eee14f0e
Support --web-header option for flutter run (#136297)
Adds support for a new --web-header option to flutter run.

Creates a workaround for https://github.com/flutter/flutter/issues/127902

This PR allows adding additional headers for the flutter run web server. This is useful to add headers like Cross-Origin-Embedder-Policy and Cross-Origin-Opener-Policy without the use of a proxy server. These headers are required enable advanced web features. This approach provides flexibility to the developer to make use of the feature as they see fit and is backward-compatible. One tradeoff is that it increases the surface area to support for future changes to the flutter web server.

https://github.com/flutter/flutter/issues/127902 is not fully addressed by this change. The solution for that task will be more opinionated. This PR creates a general-purpose workaround for anyone who needs a solution sooner while the bigger solution is developed.
2023-10-17 19:42:01 +00:00
auto-submit[bot]
54c0a350dd
Reverts "Skip injecting Bonjour settings when port publication is disabled" (#136750)
Reverts flutter/flutter#136562
Initiated by: vashworth
This change reverts the following previous change:
Original Description:
Some of our tests in CI are triggering the `NSLocalNetworkUsageDescription` dialog when they're not supposed to (https://github.com/flutter/flutter/issues/129836) since it's disabled via flags (`--no-publish-port` for flutter/flutter and `--disable-vm-service-publication` for flutter/engine).

Normally, we inject `NSLocalNetworkUsageDescription` (and other bonjour settings) to the Info.plist during the project build for debug and profile mode since by default they will publish the VM Service port over mDNS.

To help diagnose the issue, though, this PR changes it so that we don't inject `NSLocalNetworkUsageDescription` (and other bonjour settings) when port publication is disabled since it shouldn't be needed. Hopefully, this will give us better error messages or cause the app to crash and end the test early (rather than timeout after 30 minutes).
2023-10-17 19:27:19 +00:00
Victoria Ashworth
0383d8ba9e
Skip injecting Bonjour settings when port publication is disabled (#136562)
Some of our tests in CI are triggering the `NSLocalNetworkUsageDescription` dialog when they're not supposed to (https://github.com/flutter/flutter/issues/129836) since it's disabled via flags (`--no-publish-port` for flutter/flutter and `--disable-vm-service-publication` for flutter/engine).

Normally, we inject `NSLocalNetworkUsageDescription` (and other bonjour settings) to the Info.plist during the project build for debug and profile mode since by default they will publish the VM Service port over mDNS.

To help diagnose the issue, though, this PR changes it so that we don't inject `NSLocalNetworkUsageDescription` (and other bonjour settings) when port publication is disabled since it shouldn't be needed. Hopefully, this will give us better error messages or cause the app to crash and end the test early (rather than timeout after 30 minutes).
2023-10-17 19:09:08 +00:00
Yegor
0f082889a8
[web] remove loading indicator in -d web-server builds (#136482)
Fixes https://github.com/flutter/flutter/issues/135226
2023-10-12 23:45:06 +00:00
Derek Xu
406c4dbf77
Add --trace-to-file option to flutter run (#135713) 2023-10-12 13:23:52 -04:00
Christopher Fujino
9751fe6449
[flutter_tools] handle ERROR_INVALID_FUNCTION when trying to symlink across drives (#136424)
~~Fixes https://github.com/flutter/flutter/issues/136321~~

edit by @andrewkolos: Fixes https://github.com/flutter/flutter/issues/66224
2023-10-12 17:15:45 +00:00
Christopher Fujino
8ca7d7d136
Stop recommending android sdk root (#136296)
Fixes https://github.com/flutter/flutter/issues/117245
2023-10-11 21:04:59 +00:00
Derek Xu
1a44710d19
Reland "Switch flutter_tools to run frontend server from AOT snapshot" (#136282)
This reverts commit a1639be.
2023-10-11 16:15:26 -04:00
Zachary Anderson
d773c5a9ea
[flutter_tool] Delete skipped tests (#136364)
These tests have been skipped due to flakiness for a long time.

Closes https://github.com/dart-lang/webdev/issues/1562
Closes https://github.com/flutter/flutter/issues/124214
2023-10-11 10:24:14 -07:00
Christopher Fujino
b416473bbb
[flutter_tools] catch StdinException when setting terminal to SingleCharMode (#136283)
Fixes https://github.com/flutter/flutter/issues/129198
2023-10-10 23:10:29 +00:00
Christopher Fujino
0fa01b2156
[flutter_tools] allow tool integration tests to quit on SIGINT (#136271)
fixes https://github.com/flutter/flutter/issues/136270
2023-10-10 20:47:59 +00:00
Jackson Gardner
9f4f6c4756
Use platform dill from the engine when compiling with dart2wasm. (#134970)
This is the final change needed to address https://github.com/flutter/flutter/issues/133467

This allows us to use the platform dill that is built by the engine when compiling apps. This also fixes the `--local-web-sdk` flag when compiling to wasm (which previously didn't work without some serious tweaking of the engine build output).
2023-09-29 20:21:24 +00:00
Elias Yishak
ba1416954a
Update logic for getting Analytics instance from package:unified_analytics (#134756)
Part of:
- https://github.com/flutter/flutter/issues/128251

Currently, when we want to use the analytics instance from `package:unified_analytics`, we are just grabbing it from globals. However, with the legacy analytics instance, there are some things we check to return a no-op version of the instance.. for example, if we are running on bots or a non standard branch, we use a no-op instance

This PR uses the same previous checks for the new analytics instance
2023-09-29 16:20:16 +00:00
Jonah Williams
d13cd8846e
[flutter_tools] remove VmService screenshot for native devices. (#135462)
* This is completely broken on the Impeller renderer, see: https://github.com/flutter/flutter/issues/135052
* Even on the Skia renderer, this gives a software rasterized screenshot which will absolutely look different from a native rendering screenshot.

I plan to remove this functionality from the engine.
2023-09-29 00:21:14 +00:00
Polina Cherkasova
e5d3b704da
Pin leak_tracker before publishing breaking change. (#135720) 2023-09-28 17:03:23 -07:00
Yegor
371aadd822
[tool] fallback to sigkill when closing Chromium (#135521)
This implements https://github.com/flutter/flutter/issues/132654#issuecomment-1738221257, namely:

Make `Chromium.close` more robust:

* Send `SIGTERM` and wait up to 5 seconds, if the process exited, great! Return from the function.
* If the process has not exited, then send a `SIGKILL`, which is a much firmer way to exit a process. Same as before, wait up to 5 seconds, if the process exited, great! Return from the function.
* If it still hasn't exited then give up trying to exit Chromium, just print a warning to the console and return from the function.

Bonus: a few nullability fixes and extra `-v` logging.

Fixes https://github.com/flutter/flutter/issues/132654
2023-09-28 22:28:31 +00:00
Andrew Kolos
aa498cd51a
Add API to read flavor from framework at run time (#134179)
Resolves #128046.

Adds a services API that allows flutter app developers to write app code that determines `--flavor` the app was built with.

This is implemented by having the tool adding the value of `--flavor` to its list of dart environment declarations, which will be available to the app at run time. Specifically,`FLUTTER_APP_FLAVOR` is set. I chose this implementation for its simplicity. There is some precedent for this, but only for web ([example](cd2f3f5e78/packages/flutter_tools/lib/src/runner/flutter_command.dart (L1231))).
2023-09-28 17:38:54 +00:00
Daco Harkes
ff4a0f676f
Native assets support for Windows (#134203)
Support for FFI calls with `@Native external` functions through Native assets on Windows. This enables bundling native code without any build-system boilerplate code.

For more info see:

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

### Implementation details for Windows.

Mainly follows the design of https://github.com/flutter/flutter/pull/134031.

Specifically for Windows in this PR is the logic for finding the compiler `cl.exe` and environment variables that contain the paths to the Windows headers `vcvars.bat` based on `vswhere.exe`.
2023-09-27 12:22:58 +00:00
Alex Li
3e7c388e91
flutter config --list (#135401)
Resolves #81831.

The PR improves the `config` command in below ways:
- Does not print the settings in usages or other options.
- Adds the `--list` flag to print the full settings list.
- Separates usages for settings and analytics.
- Prints the restart tip when clearing features.
2023-09-27 07:02:13 +00:00
Casey Hillers
a1639be4a0
Revert "Switch flutter_tools to run frontend server from AOT snapshot" (#135537)
Reverts flutter/flutter#135255

This broke Google Testing, and requires an internal patch before relanding.
2023-09-27 00:19:42 +00:00
Christopher Fujino
851497ffc9
[flutter_tools] fix tests with no native assets running native asset build (#135474)
Fixes https://github.com/flutter/flutter/issues/135461
2023-09-26 23:05:11 +00:00
Derek Xu
c21bf45b20
Switch flutter_tools to run frontend server from AOT snapshot (#135255)
Co-authored-by: Christopher Fujino <fujino@google.com>
2023-09-26 17:20:37 -04:00
Victoria Ashworth
3cfe3720d6
Wait for CONFIGURATION_BUILD_DIR to update when debugging with Xcode (#135444)
So there appears to be a race situation between the flutter CLI and Xcode. In the CLI, we update the `CONFIGURATION_BUILD_DIR` in the Xcode build settings and then tell Xcode to install, launch, and debug the app. When Xcode installs the app, it should use the `CONFIGURATION_BUILD_DIR` to find the bundle. However, it appears that sometimes Xcode hasn't processed the change to the build settings before the install happens, which causes it to not be able to find the bundle.

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

--- 

Since it's a timing issue, there's not really a consistent way to test it.

I was able to confirm that it works, though, by using the following steps:
1. Create a flutter project
2. Open the project in Xcode
3. `flutter clean`
4. `flutter run --profile -v`

If I saw a print line `stderr: CONFIGURATION_BUILD_DIR: build/Debug-iphoneos`, that means it first found the old and incorrect `CONFIGURATION_BUILD_DIR` before updating to the the new, so I was able to confirm that it would wait until it updated.
2023-09-26 17:48:19 +00:00
Chris Bracken
cb4b4d4ac9
[macOS,iOS] Improve CocoaPods upgrade instructions (#135453)
In our CocoaPods doctor check, if the version of CocoaPods is found to
be too low, rather than emitting a link to the install instructions,
emit a link to the upgrade instructions.

Since this check operates on CocoaPodsStatus, an enum, swtich to using a
case statement and cover all cases.


## 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] 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/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
2023-09-25 12:27:31 -07:00
Daco Harkes
2def951924
Reland "Native assets support for Linux" (#135097)
Reland of #134031. (Reverted in #135069.) Contains the fix for b/301051367 together with cl/567233346.

Support for FFI calls with `@Native external` functions through Native assets on Linux. This enables bundling native code without any build-system boilerplate code.

For more info see:

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

### Implementation details for Linux.

Mainly follows the design of https://github.com/flutter/flutter/pull/130494.

Some differences are:

* Linux does not support cross compiling or compiling for multiple architectures, so this has not been implemented.
* Linux has no add2app.

The assets copying is done in the install-phase of the CMake build of a flutter app.
CMake requires the native assets folder to exist, so we create it also when the feature is disabled or there are no assets.

### Tests

This PR adds new tests to cover the various use cases.

* packages/flutter_tools/test/general.shard/linux/native_assets_test.dart
  * Unit tests the Linux-specific part of building native assets.

It also extends various existing tests:

* packages/flutter_tools/test/integration.shard/native_assets_test.dart
  * Runs (incl hot reload/hot restart), builds, builds frameworks for Linux and flutter-tester.
2023-09-22 06:07:06 +00:00
Jacob MacDonald
daea6e00bf
remove field override, assign to super field instead (#135165)
Removes an ignore about overriding fields. Instead we just assign the value to the original field in the super class.

Related to https://github.com/dart-lang/language/issues/3332 (discovered during investigations into the violation of that lint).
2023-09-21 22:02:12 +00:00
Zachary Anderson
30a9f99bc8
Send analytics on 'build ios' and 'build ipa' for plist impeller value (#135193)
This analytics event only records the value of the plist entry on
`build` commands. This will give an idea of the proportion of users who
are disabling Impeller when shipping apps.
2023-09-21 11:49:29 -07:00
Derek Xu
c627dbfbc6
Add --frontend-server-starter-path option to flutter run and flutter test (#135038) 2023-09-21 14:32:35 -04:00
Yegor
d6d2e89fc8
finer grained logging of Chromium launch sequence (#135078)
Log the details of how Chromium is about to be launched prior to running
the Chromium command, as well as the path to the Chromium executable.

This should improve our understanding of what's happening here:
https://github.com/flutter/flutter/issues/132654#issuecomment-1726630123
2023-09-20 15:20:16 -07:00
Michael Goderbauer
b0a90aee17
Enable strict-inference (#135043)
Avoids that dynamic accidentally sneaks in, see https://dart.dev/tools/analysis#enabling-additional-type-checks
2023-09-20 19:59:08 +00:00
Camille Simon
594ff98a65
[Android] Add Java/AGP/Gradle incompatibility warning to flutter create (#131444)
Adds warning to `flutter create` command that checks if detected Java version is compatible with the template AGP and template Gradle versions. If a developer is building for Android and their Java version is incompatible with either the AGP or Gradle versions that Flutter currently supports by default for new Flutter projects, then

- a warning will show noting the incompatibility and
- steps will be shown to fix the issue, the recommended option being to configure a new compatible Java version given that Flutter knows we can support the template Gradle/AGP versions and updating them manually may be risky (feedback on this approach would be greatly appreciated!)

Given that the template AGP and Gradle versions are compatible, this PR assumes that the detected Java version may only conflict with one of the template AGP or Gradle versions because:
 - the minimum Java version for a given AGP version is less than the maximum Java version compatible for the minimum Gradle version required for that AGP version (too low a Java version will fail AGP compatibility test, but not Gradle compatibility).
- the maximum Java version compatible with minimum Gradle version for a given AGP version is higher than minimum Java version required for that AGP version (too high a Java version will fail Gradle compatibility test, but not AGP compatibility test).

Fixes https://github.com/flutter/flutter/issues/130515 in the sense that `flutter create foo`; `cd foo`; `flutter run` should always be successful.
2023-09-20 16:01:04 +00:00
Gray Mackall
f4b5fc1803
Unpin url launcher (remake) (#134958)
More up to date version of https://github.com/flutter/flutter/pull/133786.

Fixes https://github.com/flutter/flutter/issues/111304
2023-09-20 02:43:57 +00:00
Xilai Zhang
52ef9d8827
[flutter roll] Revert "Native assets support for Linux" (#135069)
Reverts flutter/flutter#134031

context: b/301051367
Looked at the error message from the broken TAP target, but seems like the failure might be non trivial to resolve. Would it be okay if we revert this for now while it is being triaged?
2023-09-20 00:06:45 +00:00
David Iglesias
c7c9d8eea6
[web] Encode AssetManifest.bin as JSON and use that on the web. (#131382)
This PR modifies the web build slightly to create an `AssetManifest.json`, that is a JSON(base64)-encoded version of the `AssetManifest.bin` file.

_(This should enable all browsers to download the file without any interference, and all servers to serve it with the correct headers.)_

It also modifies Flutter's `AssetManifest` class so it loads and uses said file `if (kIsWeb)`.

### Issues

* Fixes https://github.com/flutter/flutter/issues/124883

### Tests

* Unit tests added.
* Some tests that run on the Web needed to be informed of the new filename, but their behavior didn't have to change (binary contents are the same across all platforms).
* I've deployed a test app, so users affected by the BIN issue may take a look at the PR in action:
  * https://dit-tests.web.app
2023-09-19 22:38:51 +00:00
Victoria Ashworth
abf8361ad4
Don't uninstall before retrying to connect during app launch (#134542)
When retrying to connect to the device during app launch, don't uninstall the app first.

Latest test flake for https://github.com/flutter/flutter/issues/120808:
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8770202475999850785/+/u/run_hot_mode_dev_cycle_ios__benchmark/test_stdout

Shows that it uninstalled and then tried debugging and failed, which would make sense since the app wasn't installed anymore.
```
[2023-09-11 18:02:24.555646] [STDOUT] stdout: [   +6 ms] Lost connection to device. Trying to connect again...
[2023-09-11 18:02:24.556949] [STDOUT] stdout: [   +1 ms] executing: /opt/s/w/ir/x/w/recipe_cleanup/tmp53fs1szo/flutter sdk/bin/cache/artifacts/libimobiledevice/idevicesyslog -u 00008030-00144DA10185402E
[2023-09-11 18:02:24.557323] [STDOUT] stdout: [        ] executing: script -t 0 /dev/null /opt/s/w/ir/x/w/recipe_cleanup/tmp53fs1szo/flutter sdk/bin/cache/artifacts/ios-deploy/ios-deploy --id 00008030-00144DA10185402E --bundle build/ios/iphoneos/Flutter Gallery.app --app_deltas build/ios/app-delta --uninstall --noinstall --debug --no-wifi --args --enable-dart-profiling --disable-vm-service-publication --enable-checked-mode --verify-entry-points
[2023-09-11 18:02:24.578010] [STDOUT] stdout: [  +20 ms] [....] Waiting for iOS device to be connected
[2023-09-11 18:02:24.712631] [STDOUT] stdout: [ +134 ms] [....] Using 00008030-00144DA10185402E (N104AP, iPhone 11, iphoneos, arm64e, 16.2, 20C65) a.k.a. 'iPhone 11'.
[2023-09-11 18:02:24.712725] [STDOUT] stdout: [        ] ------ Uninstall phase ------
[2023-09-11 18:02:24.818293] [STDOUT] stdout: [ +105 ms] [ OK ] Uninstalled package with bundle id io.flutter.examples.gallery
[2023-09-11 18:02:24.906833] [STDOUT] stdout: [  +88 ms] ------ Debug phase ------
[2023-09-11 18:02:24.906924] [STDOUT] stdout: [        ] Starting debug of 00008030-00144DA10185402E (N104AP, iPhone 11, iphoneos, arm64e, 16.2, 20C65) a.k.a. 'iPhone 11' connected through USB...
[2023-09-11 18:02:25.285252] [STDOUT] stdout: [ +378 ms] [  0%] Looking up developer disk image
[2023-09-11 18:02:25.529937] [STDOUT] stdout: [ +244 ms] [ 90%] Mounting developer disk image
[2023-09-11 18:02:25.545261] [STDOUT] stdout: [  +15 ms] [ 95%] Developer disk image already mounted
[2023-09-11 18:02:25.587923] [STDOUT] stdout: [  +42 ms] Detected path to iOS debug symbols: "Symbol Path: /Users/swarming/Library/Developer/Xcode/iOS DeviceSupport/16.2 (20C65) arm64e/Symbols"
[2023-09-11 18:02:25.857177] [STDOUT] stdout: [ +269 ms] Script started, output file is /dev/null
[2023-09-11 18:02:25.857259] [STDOUT] stdout: [        ] Script done, output file is /dev/null
[2023-09-11 18:02:25.857511] [STDOUT] stdout: [        ] ios-deploy exited with code 0
[2023-09-11 18:02:25.858066] [STDOUT] stderr: [        ] Could not run build/ios/iphoneos/Flutter Gallery.app on 00008030-00144DA10185402E.
[2023-09-11 18:02:25.858130] [STDOUT] stderr: [        ] Try launching Xcode and selecting "Product > Run" to fix the problem:
[2023-09-11 18:02:25.858214] [STDOUT] stderr: [        ]   open ios/Runner.xcworkspace
[2023-09-11 18:02:25.858537] [STDOUT] stdout: [        ] Installing and launching... (completed in 52.4s)
[2023-09-11 18:02:25.858956] [STDOUT] stderr: [        ] Error launching application on iPhone 11.
```
2023-09-18 19:55:06 +00:00
Daco Harkes
2337c64d0c
Native assets support for Linux (#134031)
Support for FFI calls with `@Native external` functions through Native assets on Linux. This enables bundling native code without any build-system boilerplate code.

For more info see:

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

### Implementation details for Linux.

Mainly follows the design of https://github.com/flutter/flutter/pull/130494.

Some differences are:

* Linux does not support cross compiling or compiling for multiple architectures, so this has not been implemented.
* Linux has no add2app.

The assets copying is done in the install-phase of the CMake build of a flutter app.
CMake requires the native assets folder to exist, so we create it also when the feature is disabled or there are no assets.

### Tests

This PR adds new tests to cover the various use cases.

* packages/flutter_tools/test/general.shard/linux/native_assets_test.dart
  * Unit tests the Linux-specific part of building native assets.

It also extends various existing tests:

* packages/flutter_tools/test/integration.shard/native_assets_test.dart
  * Runs (incl hot reload/hot restart), builds, builds frameworks for Linux and flutter-tester.
2023-09-18 11:13:37 +00:00
chunhtai
367203b301
Makes scheme and target optional parameter when getting universal lin… (#134571)
…k settings

the show build settings xcode command can only accept one of the target or scheme flag. Therefore I make them optional.
2023-09-15 21:01:05 +00:00
Daco Harkes
8ebb8d4f11
Speed up native assets target (#134523)
Speeds up the native assets target in the backend by

1. changing other targets `gen_dart_plugin_registrant` and
`release_unpack_ios` to do async I/O,
2. not reparsing the package config, and
3. not calling `dart pub deps --json` for 0 or 1 packages (fixed
package:native_assets_builder).

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

```
           [   +2 ms] native_assets: Starting due to {}
           [   +2 ms] Skipping target: gen_localizations
           [   +1 ms] gen_dart_plugin_registrant: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated contents: /Users/dacoharkes/flt/engine/flutter/examples/hello_world/.dart_tool/package_config_subset}
           [  +33 ms] gen_dart_plugin_registrant: Complete
           [ +107 ms] release_unpack_ios: Complete
           [  +60 ms] Writing native_assets.yaml.
           [   +7 ms] Writing /Users/dacoharkes/flt/engine/flutter/examples/hello_world/.dart_tool/flutter_build/be2692bbfbc0b9a27fcd2422d52354c6/native_assets.yaml done.
           [        ] native_assets: Complete
```

->

```
           [   +4 ms] native_assets: Starting due to {}
           [        ] Skipping target: gen_localizations
           [   +1 ms] gen_dart_plugin_registrant: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated contents: /Users/dacoharkes/flt/engine/flutter/examples/hello_world/.dart_tool/package_config_subset}
           [  +31 ms] Writing native_assets.yaml.
           [   +8 ms] Writing /Users/dacoharkes/flt/engine/flutter/examples/hello_world/.dart_tool/flutter_build/f9451a65a465bfab70d004e21d6cc1d6/native_assets.yaml done.
           [   +1 ms] native_assets: Complete
```

## 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] 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
2023-09-15 12:23:08 -07:00
Christopher Fujino
3d7cd3594a
[flutter_tools] Run ShutdownHooks when handling signals (#134590)
Fixes https://github.com/flutter/flutter/issues/134566.

Prior to this fix, `ShutdownHooks` were run in the private helper
function `_exit()` defined in the `package:flutter_tools/runner.dart`
library. Independent of this, the tool had signal handling logic that
traps SIGINT and SIGTERM. However, these handlers called `exit()` from
`dart:io`, and didn't run these hooks.

This PR moves the `_exit()` private helper to
`package:flutter_tools/src/base/process.dart` and renames it to
`exitWithHooks()`, so that it can be called by the signal handlers in
`package:flutter_tools/src/base/signals.dart`.
2023-09-13 13:05:29 -07:00
Victoria Ashworth
af5ac930d8
Set the CONFIGURATION_BUILD_DIR in generated xcconfig when debugging core device (#134493)
Xcode uses the CONFIGURATION_BUILD_DIR build setting to determine the location of the bundle to build and install. When launching an app via Xcode with the Xcode debug workflow (for iOS 17 physical devices), temporarily set the CONFIGURATION_BUILD_DIR to the location of the bundle so Xcode can find it.

Also, added a Xcode Debug version of the `microbenchmarks_ios` integration test since it uses `flutter run --profile` without using `--use-application-binary`.

Fixes https://github.com/flutter/flutter/issues/134186.
2023-09-13 18:08:35 +00:00
Zachary Anderson
4d5a1d91e1
Bump gradle heap size limit in *everywhere* (#134665)
I'm seeing these in the bot reports every week. Hopefully this is all of
them, and hopefully 4GB is enough.
2023-09-13 10:36:24 -07:00
Elias Yishak
e9beaea061
Clean up analytics opt in/out flags (#132588)
Fixes:
- #132258
2023-09-12 22:49:05 +00:00
Michael Goderbauer
240825a555
Enable private field promotion for flutter_tools (#134474)
New feature in upcoming Dart 3.2. See https://github.com/dart-lang/language/issues/2020. Feature is enabled by bumping the min SDK version to 3.2.

Part of https://github.com/flutter/flutter/issues/134476.
2023-09-12 20:20:04 +00:00
Christopher Fujino
b76b82aa71
[flutter_tools] disallow -O0 for flutter build web (#134185)
Fixes https://github.com/flutter/flutter/issues/133404.

Per the dart2js team on the linked issue, `-O0` is not intended for end users, but more for actual debugging/development of the compiler.
2023-09-11 23:33:09 +00:00