Commit Graph

9144 Commits

Author SHA1 Message Date
Loïc Sharma
29f332c822
Add migration to git ignore SwiftPM build directories (#152766)
Opening a Swift package in Xcode generates `.build` and `.swiftpm` directories. These should be ignored as they contain intermediary build artifacts that aren't meant to be checked-in.

Part of https://github.com/flutter/flutter/issues/148018
2024-08-05 20:26:16 +00:00
Mohellebi abdessalem
0e720e84a4
reduce warnings inside flutter.groovy file (#152073)
In the context of [issue #146036](https://github.com/flutter/flutter/issues/146036), the flutter.groovy file, considering [issue #147122](https://github.com/flutter/flutter/issues/147122), currently has only two of the buildDir instances replaced. The other two instances have issues that require more investigation.
2024-08-05 13:56:14 +00:00
Sam Rawlins
7777d67a66
Remove one set of parens that wrap a single String literal (#152031)
In order to address https://github.com/dart-lang/linter/issues/4354, we are reporting a few more cases in unnecessary_parenthesis. `('text') * 2` is one such case. This change is being made in https://dart-review.googlesource.com/c/sdk/+/376540. (These are the only newly-reported unnecessary parentheses for this change.)
2024-08-01 19:13:13 +00:00
Ben Konyi
d55a0b38e3
Fix bad pattern matching in DDS exception parsing (#152685)
Nullable types for values in map patterns require the key to be present.
Since the 'uri' key is not always present in DDS exception responses,
this was causing us to fall back to throwing a StateError.

Fixes https://github.com/flutter/flutter/issues/152684
2024-08-01 14:38:22 -04:00
Andrew Kolos
535e88b092
Reintroduce verbose logging for hot reload flake (#152639)
Adds some logging to assist with troubleshooting https://github.com/flutter/flutter/issues/152220 (which is a reapperance of flake https://github.com/flutter/flutter/issues/146879) on CI.

TL;DR [the tool sometimes never receives the `IsolateRunnable` event from the vm service after calling `_flutter.runInView`](https://github.com/flutter/flutter/issues/146879#issuecomment-2118629953).
2024-07-31 23:15:17 +00:00
Gray Mackall
a1f03609f7
Set up tests that verify we can build a fresh counter app across our Gradle/AGP/Kotlin support range (#151568)
Sets up tests that verify we can build a fresh counter app across our Gradle/AGP/Kotlin support range.

Post submit only, because the suite takes ~30 minutes to run, and I expect it to be _somewhat_ rare that we break only one of these versions (and therefore it doesn't get caught by existing presubmits).
2024-07-31 19:14:46 +00:00
David Iglesias
111b4fe6d1
[web] Set COEP:credentialless on flutter run/drive. (#152413)
This PR changes the value of the `COEP` response header from `require-corp` to `credentialless` in the Flutter tool, when running `flutter run`/`drive` for Web projects.

This enables running tests compiled to wasm, that access 3P resources (like Google Maps) without blocking those resources.

Docs:

* https://developer.chrome.com/blog/coep-credentialless-origin-trial#credentialless_to_the_rescue

## Issue

* https://github.com/flutter/flutter/issues/152411
2024-07-30 23:14:06 +00:00
engine-flutter-autoroll
61848a448b
Roll Flutter Engine from c58d87d62c20 to 31bb9f98472a (8 revisions) (#152555)
c58d87d62c...31bb9f9847

2024-07-30 skia-flutter-autoroll@skia.org Roll Skia from 1339015537a3 to 2cb7f5443a48 (4 revisions) (flutter/engine#54212)
2024-07-30 skia-flutter-autoroll@skia.org Roll Dart SDK from 6ab9452297e0 to ad4d2e8b2c65 (1 revision) (flutter/engine#54211)
2024-07-30 49699333+dependabot[bot]@users.noreply.github.com Bump ossf/scorecard-action from 2.3.3 to 2.4.0 (flutter/engine#54208)
2024-07-30 skia-flutter-autoroll@skia.org Roll Skia from 20e4dfabb6b2 to 1339015537a3 (1 revision) (flutter/engine#54207)
2024-07-30 skia-flutter-autoroll@skia.org Roll Dart SDK from e8eca6f05494 to 6ab9452297e0 (1 revision) (flutter/engine#54206)
2024-07-30 skia-flutter-autoroll@skia.org Roll Skia from 56de22c39d0e to 20e4dfabb6b2 (1 revision) (flutter/engine#54205)
2024-07-30 skia-flutter-autoroll@skia.org Roll Skia from 946ca24d03ab to 56de22c39d0e (1 revision) (flutter/engine#54204)
2024-07-30 skia-flutter-autoroll@skia.org Roll Skia from 8167ff71af2c to 946ca24d03ab (2 revisions) (flutter/engine#54202)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC jacksongardner@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-07-30 16:42:10 +00:00
Jonah Williams
102cd01693
[flutter_tools] remove raster stats CLI option. (#152501)
The raster stats feature is being removed from devtools and the engine. Remove the CLI option as well.

Fixes https://github.com/flutter/flutter/issues/144191
Fixes https://github.com/flutter/flutter/issues/132169
2024-07-29 20:30:54 +00:00
Matan Lurey
40d9fcf767
Document that flutter drive --test-arguments can opt-in to dart test (#152410)
Closes https://github.com/flutter/flutter/issues/51135.
Closes https://github.com/flutter/flutter/issues/145499.

Making this the _default_, or better discoverable, is tracked in
https://github.com/flutter/flutter/issues/152409.

You'll notice I also removed `-rexpanded`; @jonahwilliams believes that
was accidentally copied over from else-where, and never did anything
(someone I guess could have parsed it in `void main(...)`, but given
https://github.com/flutter/flutter/issues/51135 &
https://github.com/flutter/flutter/issues/145499 that seems unlikely.
2024-07-26 18:25:58 -07:00
Jenn Magder
e36d9234e8
Change flutter_build_with_compilation_error_test to check stdout or stderr (#152404)
On Xcode 16 beta 3 stderr is:
```
** BUILD FAILED **
```
stdout is:
```
Writing result bundle at path:
	/var/folders/fm/wjzsj_z95ydgn4khxqgbtqx000mfq2/T/flutter_tools.PeJZlH/flutter_ios_build_temp_dirqmiKld/temporary_xcresult_bundle

error: lib/main.dart:13:11: Error: A value of type 'String' can't be assigned to a variable of type 'int'.
  int x = 'String';
          ^
Target kernel_snapshot_program failed: Exception
Failed to package /Users/m/Projects/test_create.
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'Runner' from project 'Runner')
note: Run script build phase 'Thin Binary' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'Runner' from project 'Runner')
note: Run script build phase 'Run Script' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'Runner' from project 'Runner')
```

The tool output of `flutter build ios` shows both:
```
Building com.example.testCreate for device (ios-release)...
Automatically signing iOS for device deployment using specified development team
in Xcode project: S8QB4VV633
Running Xcode build...
Xcode build done.                                           10.1s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **

Xcode's output:
↳
    Writing result bundle at path:
    	/var/folders/fm/wjzsj_z95ydgn4khxqgbtqx000mfq2/T/flutter_tools.Dgnlxc/flutt
    	er_ios_build_temp_dirpKTDdk/temporary_xcresult_bundle

    error: lib/main.dart:13:11: Error: A value of type 'String' can't be
    assigned to a variable of type 'int'.
      int x = 'String';
              ^
    Target kernel_snapshot_program failed: Exception
    Failed to package /Users/magder/Projects/test_create.
    note: Disabling previews because SWIFT_VERSION is set and
    SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'Runner' from
    project 'Runner')
    note: Run script build phase 'Run Script' will be run during every build
    because the option to run the script phase "Based on dependency analysis" is
    unchecked. (in target 'Runner' from project 'Runner')
    note: Run script build phase 'Thin Binary' will be run during every build
    because the option to run the script phase "Based on dependency analysis" is
    unchecked. (in target 'Runner' from project 'Runner')

Encountered error while building for device.
```

The point of this test is that you can see the error `int x = 'String';` error in the tool output. https://github.com/flutter/flutter/issues/72608#issuecomment-797473109

I think just updating the test to check stderr or stdout is sufficient without touching the tool behavior.

Fixes https://github.com/flutter/flutter/issues/151553
2024-07-26 23:12:14 +00:00
Loïc Sharma
40843e3e61
Update minimum macOS version as needed in Swift package (#152347)
If Swift Package Manager is enabled, the tool generates a Swift package at `<ios/macos>/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/`. This Swift package is how the tool adds plugins to the Flutter project.

SwiftPM is strictly enforces platform versions: you cannot depend on a Swift package if its supported version is higher than your own.

On iOS, we use the project's minimum deployment version for the generated Swift package. If a plugin has a higher requirement, you'll need to update your project's minimum deployment version. The generated Swift package is automatically updated the next time you run the tool.

This updates macOS to do the same thing.

Fixes https://github.com/flutter/flutter/issues/146204
2024-07-26 22:02:08 +00:00
Loïc Sharma
f2b182f54e
Fix some tests that fail with Swift Package Manager enabled (#152267)
https://github.com/flutter/flutter/pull/152049 was reverted as it broke several post-submit tests. This relands the test fixes in https://github.com/flutter/flutter/pull/152049 without enabling Swift Package Manager on the master channel. 

This change is split into two commits:

1. dd1762abb9 - The changes in https://github.com/flutter/flutter/pull/152049
1. 00fdcfb7bb - Undoes the changes that enabled Swift Package Manager on the master channel

Part of https://github.com/flutter/flutter/issues/151567
2024-07-26 21:08:32 +00: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
John Ryan
af431b38d2
Use more CORS headers for flutter run server (#152249)
Also update tests

Attempt #2 of #152048

cc: @cbracken
2024-07-26 18:01:41 +00:00
Jackson Gardner
8f0e77696f
Set dart defines properly while in debug mode. (#152262)
Turns out just supporting the right value for `kDebugMode` was a lot simpler than I thought. Debug builds used to never go through the build system code path when using `flutter run`, but now that we have wasm this can occur with the run command.

This should address https://github.com/flutter/flutter/issues/148850
2024-07-25 22:00:50 +00:00
Nate Biggs
8cf2161845
Modify stepping integration test to accommodate new DDC async semantics. (#152204)
Updates the expected steps in the async function defined within `stepping_project.dart`. 

The Dart web team is updating the async semantics of DDC to bring them in line with the other backends. Currently, the DDC async semantics don't adhere to the Dart spec and this can lead to inconsistent and surprising results.

However, the step-over operation doesn't work well yet with the new DDC async semantics. In the long run we intend to improve this but until then the debug stepper will have sporadic results that we can't model well with this test. When we are able to fix the stepper functionality, we will return this test to cover more of the async function being stepped over.
2024-07-25 03:22:29 +00:00
auto-submit[bot]
f64190aacb
Reverts "Use more CORS headers for flutter run server (#152048)" (#152248)
Reverts: flutter/flutter#152048
Initiated by: cbracken
Reason for reverting: breaks tool tests.

Example:
```
00:06 +762 ~2 -1: test/general.shard/web/web_asset_server_test.dart: release asset server serves correct mime type and content length for png [E]
  Expected: {'Content-Type': 'image/png', 'content-length': '64'}
    Actual: {
              'Content-Type': 'image/png',
              'Cross-Origin-Resource-Policy': 'cross-origin',
              'Access-Contr
Original PR Author: johnpryan

Reviewed By: {eyebrowsoffire}

This change reverts the following previous change:
@eyebrowsoffire
2024-07-24 17:44:26 +00:00
John Ryan
11d81f2709
Use more CORS headers for flutter run server (#152048)
@eyebrowsoffire
2024-07-24 09:54:22 -07:00
auto-submit[bot]
f55ab0e77e
Reverts "Enable Swift Package Manager by default on master channel (#152049)" (#152243)
Reverts: flutter/flutter#152049
Initiated by: cbracken
Reason for reverting: iOS builds failing in post-submit
Original PR Author: loic-sharma

Reviewed By: {jmagman}

This change reverts the following previous change:
Changes:

1. Enables Swift Package Manager by default on the main/master channel
2. Fixes tests that fail if Swift Package Manager is enabled

Corresponding docs change: https://github.com/flutter/website/pull/10938

Addresses https://github.com/flutter/flutter/issues/151567
2024-07-24 16:49:25 +00:00
Loïc Sharma
08d8a7fa81
Enable Swift Package Manager by default on master channel (#152049)
Changes:

1. Enables Swift Package Manager by default on the main/master channel
2. Fixes tests that fail if Swift Package Manager is enabled

Corresponding docs change: https://github.com/flutter/website/pull/10938

Addresses https://github.com/flutter/flutter/issues/151567
2024-07-24 16:24:31 +00:00
Andrew Kolos
91813060c0
[tool] Guard more write/writeln calls on Process.stdin (#151146)
Contributes to fixing https://github.com/flutter/flutter/issues/137184.

This PR guards write calls in non-test files. This PR excludes
* packages/flutter_tools/lib/src/dart/analysis.dart due to a test timeout I would like to figure out in a separate PR and
* packages/flutter_tools/lib/src/compile.dart due to https://github.com/flutter/flutter/issues/151255
2024-07-23 19:27:52 +00:00
Brandon DeRosier
ed470fd101
[native_assets] Fix macOS host build failure when there are no frameworks to sign. (#150742)
When the `"${native_assets_path}"*.framework` glob doesn't resolve anything, the bash will run the loop once with the original unglobbed value: `/path/to/native/assets/*.framework`. Skip this case to prevent the build from failing when there are no frameworks to sign.

To reproduce this build failure:
1. Enable native assets in the Flutter tool: `flutter config --enable-native-assets`
2. Create a Flutter project with the default template: `flutter create test_native_assets`
3. Add a build hook that does nothing (`hook/build.dart`).
4. Try to build/run the app: `flutter run --debug -d macos`
2024-07-23 07:37:30 +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
Andrew Kolos
ebe53d570a
Fix asset transformation in the presence of resolution-aware asset variants (#151932)
For the necessary background knowledge, see the flutter.dev content on [Resolution-aware image assets](https://docs.flutter.dev/ui/assets/assets-and-images#resolution-aware) and [Conditional bundling of assets based on app flavor](https://docs.flutter.dev/ui/assets/assets-and-images#conditional-bundling-of-assets-based-on-app-flavor) if you don't have a basic understanding of these features.

Fixes https://github.com/flutter/flutter/issues/151813 by using unique temporary directories, per asset file, for transformations. Currently, only a single directory is used and the name of the temporary files was based only on the basename of files. This means that `assets/image.png` and `assets/2x/image.png` would share an output path (`<temp dir path>/image.png`), causing a race. If this quick and rough explanation is a bit confusing, the original issue—#151813—provides a full repro and correct identification of the exact cause of the failure that can occur in the asset transformation process.
2024-07-22 23:46:19 +00:00
Jason Simmons
49a315284d
Handle a WebSocketException that may be thrown when closing the WebKit inspection protocol connection to Chrome (#151997)
Noticed this happening on macOS when the tool tries to shut down Chrome after all tabs have already been closed.
2024-07-19 17:58:26 +00:00
flutter-pub-roller-bot
a08d1bbdb8
Roll pub packages (#151975)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-07-18 20:15:21 +00:00
flutter-pub-roller-bot
8c17a747c9
Roll pub packages (#151946)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-07-18 10:57:41 +00:00
flutter-pub-roller-bot
38cad013e0
Roll pub packages (#151864)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-07-17 09:50:09 +00:00
Kevin Moore
83bfab5376
flutter_tool: DRY up arg helpers, use new typed arg functions (#151784) 2024-07-17 04:01:28 +00:00
Gray Mackall
8c5fbb4021
Remove conditionality in templates that was for AGP <= 4.2 support (#151845)
Not needed after https://github.com/flutter/flutter/pull/149204 (as long as nothing has changed since the comment was made 🙂).

Fixes https://github.com/flutter/flutter/issues/145105.
2024-07-16 22:33:24 +00:00
flutter-pub-roller-bot
bed034add2
Roll pub packages (#151816)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-07-16 12:34: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
Kevin Moore
ec16c86972
tool/build/web: move source-maps CLI flag to "general" web section (#151722)
...now that wasm supports source maps (see https://github.com/flutter/flutter/pull/151643)
2024-07-15 14:17:39 +00:00
Martin Kustermann
ee7e5ec275
Emit source maps for wasm in flutter build web --wasm (#151643)
This will make

* `flutter run` have source maps enabled by default
* `flutter build` have source maps disabled by default

which mirrors what happens already today with the js compilers.

For local development this works quite well - even better than with
dart2js (see dart2js issues in [0]).
We do have some follow-up items for source maps in dart2wasm compiler,
see [1]

[0]
[flutter/flutter/issues/151641](https://github.com/flutter/flutter/issues/151641)
[1]
[dart-lang/sdk/issues/56232](https://github.com/dart-lang/sdk/issues/56232)
2024-07-13 10:24:16 +02:00
Daco Harkes
da48b34f50
[native_assets] Roll deps (#151662)
Roll deps to address:

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

Cross-linking Dart standalone CL: https://dart-review.googlesource.com/c/sdk/+/375461 (no breaking API changes)
2024-07-13 05:37:24 +00:00
Daco Harkes
607190448b
[native_assets] Don't auto-roll deps (#151636)
Stop trying to roll the dependencies for native assets automatically.

They are under active development (pre 1.0.0), and have frequent breaking changes. I'll be rolling these manually.
(We have the same setup in the Dart SDK, not auto-rolling dart-lang/native via DEPS.)

Related comment:

* https://github.com/flutter/flutter/pull/151539#issuecomment-2221134824
2024-07-12 18:55:57 +00:00
Chris Bracken
68f375fe38
[macOS] support secure restorable state by default (#151605)
By default, Flutter apps only do default AppKit app serialisation of
Window location etc. and by default, state serialisation in AppKit apps
is compatible with `NSSecureCoding`. AppKit apps generated since Xcode
13.2 include this method in the app delegate generated by the default
app template.

Background
==========

This method was added to opt into having [de]serialization require a
coder implementing the `NSSecureCoding` protocol. Apple wasn't able to
force this across the board, because `NSSecureCoding` limits certain
behaviours during deserialisation, which some third-party apps have have
previously relied on.

Specific background on the sorts of vulnerabilities that
`NSSecureCoding` was designed to prevent are described in the
`NSSecureCoding` documentation:

https://developer.apple.com/documentation/foundation/nssecurecoding?language=objc

A demonstration of a root privilege escalation and SIP bypass
vulnerability is described in the following blog post:
https://sector7.computest.nl/post/2022-08-process-injection-breaking-all-macos-security-layers-with-a-single-vulnerability/

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

## 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
2024-07-12 11:08:26 -07:00
Daco Harkes
cec2400658
[native_assets] Stop running link hooks in JIT mode (#151534)
Stop running link hooks in debug mode.

Rationale: link hooks only get access to tree-shaking info in release builds, so they can't do anything meaningful in debug builds. Debug builds should be fast as development cycle, so running less is better.

More details:

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

Also: rolls packages to latest versions.

## Implementation details

The decision whether linking is enabled is made as follows:

* For normal builds `build_info.dart::BuildMode` is used to determine whether Dart is compiled in JIT or AOT mode.
* Testers always run in JIT, so no linking.
* Native asset dry runs only run for JIT builds (e.g only when hot reload and hot restart are enabled).

## Testing

The integration test is updated to output an asset for linking if `BuildConfig.linkingEnabled` is true, and to output an asset for bundling directly if linking is not enabled.
2024-07-12 06:44:23 +00:00
August
d55a5f96c1
feat: Support overriding native endorsed plugins (#137040)
These changes allow to override existing native endorsed (federated & inline) plugins with e.g. non-endorsed plugin implementations via direct dependencies as described in the section *Platform implementation selection* in the [design doc](https://docs.google.com/document/d/1LD7QjmzJZLCopUrFAAE98wOUQpjmguyGTN2wd_89Srs).

```yaml
# pubspec.yaml
name: example
dependencies:
  my_plugin: ^0.0.1
  my_plugin_android_alternative: ^0.0.1
```

Closes #80374, closes #59657

Related: Override Dart plugins (#87991, #79669)
2024-07-11 18:54:01 +00:00
Gray Mackall
bb637f3128
Reland "Upgrade template Gradle, App AGP, Module AGP, and Kotlin versions, and tests"... but no longer upgrade module AGP version (#151433)
Relands https://github.com/flutter/flutter/pull/150969, but removes the upgrade to the module AGP version.

The reason is that a more complicated change is required because in AGP 8.0 software components are no longer generated by default, but rather only generated for variants that are configured to be published using the publishing DSL (see the `android.disableAutomaticComponentCreation` section of https://developer.android.com/build/releases/past-releases/agp-8-0-0-release-notes).

That broke our aar initialization script, because the components didn't exist so the `aar` tasks never got [created here](9ff9c67272/packages/flutter_tools/gradle/aar_init_script.gradle (L29)).

Verified that the one postsubmit that failed now passes (`android_obfuscate_test`)
2024-07-10 21:37:26 +00:00
flutter-pub-roller-bot
5f7564d989
Roll pub packages (#151492)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-07-09 22:47:35 +00:00
Andrew Kolos
5103d75743
[tool] Remove some usages of deprecated usage package (#151359)
Partially addresses https://github.com/flutter/flutter/issues/150575 and https://github.com/flutter/flutter/issues/150665

Will require a g3fix.
2024-07-09 18:17:21 +00:00
Kenzie Davisson
5ebc993dff
Write the package config location to the test bootstrap. (#150440)
Work towards. This is the Flutter companion to
https://github.com/dart-lang/test/pull/2245. Work towards
https://github.com/dart-lang/test/issues/2246.
2024-07-09 09:36:19 -07:00
Daco Harkes
9ab8b6e150
[deps] Roll dart-lang/native packages (#151403)
Pass in the minimum iOS and MacOS version.

Roll dart-lang/native deps.

Related issues:

* https://github.com/flutter/flutter/issues/145104
* Relevant discussion: https://github.com/flutter/flutter/pull/148504
2024-07-09 07:41:35 +00:00
Andrew Kolos
c206a47505
[tool] make testUsingContext provide a Stdio (with hasTerminal unset) override by default (#151357)
While exploring https://github.com/flutter/flutter/issues/107607, I noticed that flutter_tools test results change based on whether `dart test` is run from a terminal or from a process (such as a Dart program). I also ran into this while writing tests for https://github.com/flutter/flutter/pull/150667.

This is due to tests that rely on the global `Stdio` instance, on which the `hasTerminal` property depends on whether the tool is being invoked from a terminal.

Ideally, `testUsingContext` would require any tests that depend on `globals.stdio` to define an override for `Stdio`, but this is not the case. Until a solution to this more general problem is figured out, I think we should have `testUsingContext` always provide a `Stdio` override by default.
2024-07-08 23:47:31 +00:00
Aaron Housh
25b72bab18
Fix invalid URL suggestion for gradle incompatability (#150999)
The current URL has 2 /to, but it should only be 1. However, this url redirects to https://docs.flutter.dev/release/breaking-changes/android-java-gradle-migration-guide, so I can change it to that if it's preferred just to go to the final destination - just don't know if it's a redirect for a reason

i didn't create an issue as it's a doc change, but if that's a requirement I can do that
2024-07-03 20:38:11 +00:00
Gray Mackall
f60f85abcd
Remove warning when KGP version not detected (#151254)
The Kotlin Gradle plugin isn't actually required. Assume the good case if we can't find the version (that the project doesn't need it).
2024-07-03 19:49:07 +00:00
Snoppy
65cd7cf7b2
chore: fix typos and link broken (#150402)
**fix some typos and link broken**
2024-07-03 17:10:19 +00:00