Commit graph

8974 commits

Author SHA1 Message Date
Anis Alibegić 140edb9883
Fixed few typos (#147087)
Here's another PR with a couple of typos fixed. As you can see there was a typo in _fileReferenceI**n**dentifiers_, in class _ParsedProjectInfo._ Maybe we should do some check on that since I'm not sure if that property is used somewhere outside Flutter?
2024-04-22 16:49:19 +00:00
Andrew Kolos 4c46030927
print traces when transforming an asset (#146374)
From https://github.com/flutter/flutter/issues/143348#issuecomment-2016047148:

> before we ship, we should add a printTrace to the tool about each asset transformer we're invoking and the path/arguments we called it with

I think this is a good idea since asset transformers can be arbitrary Dart programs—meaning that a lot can go wrong when running them. For example, they can hang indefinitely or perform some sort of I/O that later results in a tool crash. Knowing that asset transformation was involved when debugging a crash (or a slow/stuck `flutter build`) could be useful, so I think adding a `printTrace` or two is a good idea (or at least not a bad one).
2024-04-22 16:37:24 +00:00
Andrew Kolos 0fc08abe5b
Reland "Expose build mode in environment of asset transformer processes" (#144958)
Relands https://github.com/flutter/flutter/pull/144752, which had to be reverted because the branch was stale. The original branch branched off `master` before https://github.com/flutter/flutter/pull/144734 landed. That PR introduced a new `AssetTransformer` call site.

This PR branch is identical to the original but with a new commit that addresses the new call site, [update new call sites](6bb5296a61).
2024-04-22 15:46:13 +00:00
Elias Yishak be0eb721d5
Update docs around ga3 ga4 mismatch (#147075)
Fixing nit in code doc
2024-04-19 19:15:09 +00:00
Victoria Ashworth 98685a099f
Replace CocoaPods deprecated exists? with exist? (#147056)
Fixes https://github.com/flutter/flutter/issues/147041.
2024-04-19 15:21:04 +00:00
Elias Yishak 1c3372fa38
Opt out users from GA3 if opted out of GA4 (#146453)
This PR will opt out users from legacy analytics if they have already been opted out from package:unified_analytics.

After successfully merging into main, this will be CP'd into beta and stable channels
2024-04-19 01:03:15 +00:00
Ian Hickson 3e22598a14
Add a breadcrumb for the pub autoroller (#146786)
Adds some breadcrumbs to update-packages so that people can easily figure out how to tell what's going on with the pub autoroller.
2024-04-18 23:34:31 +00:00
Zayd Krunz e8fc89e690
Redundant message fix (#143978)
Saying that the commands only work on macOS is redundant because the command is only shown on macOS hosts.
2024-04-18 22:33:10 +00:00
Victoria Ashworth 6d19fa3bfa
Add Swift Package Manager as new opt-in feature for iOS and macOS (#146256)
This PR adds initial support for Swift Package Manager (SPM). Users must opt in. Only compatible with Xcode 15+.

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

## Included Features

This PR includes the following features:
* Enabling SPM via config 
`flutter config --enable-swift-package-manager`
* Disabling SPM via config (will disable for all projects) 
`flutter config --no-enable-swift-package-manager`
* Disabling SPM via pubspec.yaml (will disable for the specific project)
```
flutter:
  disable-swift-package-manager: true
```
* Migrating existing apps to add SPM integration if using a Flutter plugin with a Package.swift
  * Generates a Swift Package (named `FlutterGeneratedPluginSwiftPackage`) that handles Flutter SPM-compatible plugin dependencies. Generated package is added to the Xcode project.
* Error parsing of common errors that may occur due to using CocoaPods and Swift Package Manager together
* Tool will print warnings when using all Swift Package plugins and encourage you to remove CocoaPods

This PR also converts `integration_test` and `integration_test_macos` plugins to be both Swift Packages and CocoaPod Pods.

## How it Works
The Flutter CLI will generate a Swift Package called `FlutterGeneratedPluginSwiftPackage`, which will have local dependencies on all Swift Package compatible Flutter plugins.  

The `FlutterGeneratedPluginSwiftPackage` package will be added to the Xcode project via altering of the `project.pbxproj`. 

In addition, a "Pre-action" script will be added via altering of the `Runner.xcscheme`. This script will invoke the flutter tool to copy the Flutter/FlutterMacOS framework to the `BUILT_PRODUCTS_DIR` directory before the build starts. This is needed because plugins need to be linked to the Flutter framework and fortunately Swift Package Manager automatically uses `BUILT_PRODUCTS_DIR` as a framework search path.

CocoaPods will continue to run and be used to support non-Swift Package compatible Flutter plugins.

## Not Included Features

It does not include the following (will be added in future PRs):
* Create plugin template
* Create app template
* Add-to-App integration
2024-04-18 21:12:36 +00:00
Jackson Gardner fd25493f60
Changing the renderer on the web target should change its build key. (#147003)
Changing the web renderer doesn't directly modify the environment's dart defines, and so doesn't do a full build invalidation. We need to include the web renderer in the build key for the compiler configuration. This information is used directly by the web targets to modify the dart defines that are passed into the compiler, so we need to rebuild if this information changes.
2024-04-18 21:05:06 +00:00
Chris Bracken c219bf73fc
[tools] Make SnapshotType.platform non-nullable (#146958)
When performing artifact lookups for `Artifact.genSnapshot` for macOS desktop builds, a `TargetPlatform` is used to determine the name of the tool, typically `gen_snapshot_$TARGET_ARCH`. Formerly, this tool was always named `gen_snapshot`.

The astute reader may ask "but Chris, didn't we support TWO target architectures on iOS and therefore need TWO `gen_snapshot` binaries?" Yes, we did support both armv7 and arm64 target architectures on iOS. But no, we didn't initially have two `gen_snapshot` binaries. We did *build* two `gen_snapshots`:
   * A 32-bit x86 binary that emitted armv7 AOT code
   * A 64-bit x64 binary that emitted arm64 AOT code 

At the time, the bitness of the `gen_snapshot` tool needed to match the bitness of the target architecture, and to avoid having to do a lot of work plumbing through suffixed `gen_snapshot` names, the author of that work (who, as evidenced by this patch, is still paying for his code crimes) elected to "cleverly" lipo the two together into a single multi-architecture macOS binary still named `gen_snapshot`. See: https://github.com/flutter/engine/pull/4948

This was later remediated over the course of several patches, including:
   * https://github.com/flutter/engine/pull/10430
   * https://github.com/flutter/engine/pull/22818
   * https://github.com/flutter/flutter/pull/37445 

However, there were still cases (notably `--local-engine` workflows in the tool) where we weren't computing the target platform and thus referenced the generic `gen_snapshot` tool.
See: https://github.com/flutter/flutter/issues/38933
Fixed in: https://github.com/flutter/engine/pull/28345

The test removed in this PR, which ensured that null `SnapshotType.platform` was supported was introduced in https://github.com/flutter/flutter/pull/11924 as a followup to https://github.com/flutter/flutter/pull/11820 when the snapshotting logic was originally extracted to the `GenSnapshot` class, and most invocations still passed a null target platform.

Since there are no longer any cases where `TargetPlatform` isn't passed when looking up `Artifact.genSnapshot`, we can safely make the platform non-nullable and remove the test.

This is pre-factoring towards the removal of the generic `gen_snapshot` artifact from the macOS host binaries (which are currently unused since we never pass a null `TargetPlatform`), which is pre-factoring towards the goal of building `gen_snapshot` binaries with an arm64 host architecture, and eliminate the need to use Rosetta during iOS and macOS Flutter builds.

Part of: https://github.com/flutter/flutter/issues/101138
Umbrella issue: https://github.com/flutter/flutter/issues/103386
Umbrella issue: https://github.com/flutter/flutter/issues/69157

No new tests since the behaviour is enforced by the compiler.
2024-04-18 16:34:06 +00:00
Loïc Sharma 86135b7774
[macOS] Migrate @NSApplicationMain attribute to @main (#146848)
This migrates Flutter to use the `@main` attribute introduced in Swift 5.3. The `@NSApplicationMain` attribute is deprecated and will be removed in Swift 6. See: https://github.com/apple/swift-evolution/blob/main/proposals/0383-deprecate-uiapplicationmain-and-nsapplicationmain.md

This change is split into two commits:

1. a508d3e503 - This updates the macOS app template and adds a migration to replace `@NSApplicationMain` uses with `@main`. 
2. f43482786e - I ran `flutter run -d macos` on each Flutter macOS app in this repository to verify the app migrates and launches successfully.

Follow-up to https://github.com/flutter/flutter/pull/146707
Fixes https://github.com/flutter/flutter/issues/143044
2024-04-18 03:08:36 +00:00
Michael Goderbauer 63f917c36d
Bump meta to 1.14.0 (#146925)
Not sure why the auto-roller hasn't picked this up...
2024-04-17 15:25:51 -07:00
flutter-pub-roller-bot 8f85c7c5b8
Roll pub packages (#146929)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-04-17 19:22:32 +00:00
Derek Xu cf26b1150f
Unpin frontend_server_client and roll packages (#146650) 2024-04-17 12:43:20 -04:00
Pierre-Louis 4a65a76279
Reland: Update link branches to main (#146882)
Reland https://github.com/flutter/flutter/pull/146558, reverted in https://github.com/flutter/flutter/pull/146880 due to an outdated test result

## Original description

- Update CS and googlesource.com link branches
- Update GitHub /blob/ and /tree/ links

Tested links manually and fixes a few broken or deprecated links

Added a test that validates that `master` isn't used, except for specified repos.

Part of https://github.com/flutter/flutter/issues/121564
2024-04-17 13:16:33 +00:00
Pierre-Louis 33a9643b5d
Revert "Update link branches to main" (#146880)
Reverts flutter/flutter#146558

Causes failure
2024-04-17 13:25:18 +02:00
Pierre-Louis 072b8874a0
Update link branches to main (#146558)
- Update CS and googlesource.com link branches
- Update GitHub /blob/ and /tree/ links

Tested links manually and fixes a few broken or deprecated links

Added a test that validates that `master` isn't used, except for
specified repos.

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

## 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/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
[Data Driven Fixes]:
https://github.com/flutter/flutter/wiki/Data-driven-Fixes
2024-04-17 09:44:23 +02:00
Loïc Sharma 194fefaa53
[iOS] Migrate @UIApplicationMain attribute to @main (#146707)
This migrates Flutter to use the `@main` attribute introduced in Swift 5.3. The `@UIApplicationMain` attribute is deprecated and will be removed in Swift 6. See: https://github.com/apple/swift-evolution/blob/main/proposals/0383-deprecate-uiapplicationmain-and-nsapplicationmain.md

This change is split into two commits:

1. ad18797428 - This updates the iOS app template and adds a migration to replace `@UIApplicationMain` uses with `@main`. 
2. 8ecbb2f29f - I ran `flutter run` on each Flutter iOS app in this repository to verify the app migrates and launches successfully.

Part of https://github.com/flutter/flutter/issues/143044
2024-04-16 22:13:03 +00:00
flutter-pub-roller-bot 4efdf190a8
Roll pub packages (#146842)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-04-16 22:07:27 +00:00
Loïc Sharma 882bcbb9aa
[Doctor] Improve CocoaPods messages (#146701)
This tweaks the Flutter doctor messages for CocoaPods.

This also switches the "unknown version" error to link to the update instructions instead of the installation instructions; the user has already installed CocoaPods in this scenario.

Example error before:

```
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
```

Example error after:

```
    ✗ CocoaPods not installed.
        CocoaPods is a package manager for iOS or macOS platform code.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      For installation instructions, see https://guides.cocoapods.org/using/getting-started.html#installation
```
2024-04-15 18:45:12 +00:00
Lau Ching Jun 8a9e74e8d7
Avoid forwarding the data after socket is disconnected. (#146665)
In a ProxiedDevicePortForwarder, there might be a race condition where the local socket has been disconnected, but the remote end was still sending new data. In this case, avoid forwarding new data to the socket.
2024-04-12 21:45:32 +00:00
Christopher Fujino 7a30d2b4ca
[flutter_tools] Fix conductor for package args roll (#146646)
The interface for `ArgResults` from `package:args` has added new fields. Change the implementations of these in the conductor to extend `Fake` so that these aren't analyzer errors.

This broke the pub roll here: https://github.com/flutter/flutter/pull/146642#issuecomment-2050169629
2024-04-12 21:38:03 +00:00
Jackson Gardner 9973673752
Support flutter run --wasm and flutter drive --wasm. (#146231)
This adds support for adding the `--wasm` flag to `flutter run` and `flutter drive`
* Emits errors if you attempt to use the skwasm renderer without the `--wasm` flag
* Emits errors if you try to use `--wasm` when not using a web device
* Uses the skwasm renderer by default if you pass `--wasm` and no `--web-renderer`
2024-04-12 19:27:26 +00:00
Chris Bracken a34086a573
[Windows] Drop support for Windows 7/8 apps in template (#146668)
Since Flutter no longer supports Windows 7.x or 8.x, this eliminates support from the Windows app template. No tests to eliminate, since Windows 7 and 8 were "best-efforts" tier and untested.

Fixes: https://github.com/flutter/flutter/issues/140830
RFC: http://flutter.dev/go/flutter-drop-win7-2024
2024-04-12 01:07:20 +00:00
hangyu 07f3103c67
Update the gradle task to add fallback scheme and host if needed when retrieving deep links. (#146470)
This is to support feature:
https://github.com/flutter/devtools/issues/7541

before behavior: do not show this link in the dev tool if there's no
scheme or host
target behavior: show the link in the dev tool with a error text : (
missing scheme/ missing domain)



## 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/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
[Data Driven Fixes]:
https://github.com/flutter/flutter/wiki/Data-driven-Fixes
2024-04-11 14:24:51 -07:00
Bartek Pacia 557fbf5167
Update app Android gradle scripts to use flutter.versionName and flutter.versionCode (#146604)
Follow up of #146044 and #141417

Minor change to make Gradle buildscripts shorter.
2024-04-11 13:46:13 +00:00
Daco Harkes ac5be2d821
[tools] Fix --template=plugin_ffi formatting (#146269)
It looks like the formatter was updated.

We have a test running on the FFIgen repo that checks that rerunning the generated bindings with FFIgen generates identical bindings.

Closes:

* https://github.com/dart-lang/native/issues/1072
2024-04-11 10:24:09 +00:00
Jason Simmons c9d4c749b5
Disable single character mode in the terminal when exiting flutter_tools (#146534) 2024-04-10 23:54:42 +00:00
flutter-pub-roller-bot aff5477dad
Roll pub packages (#146606)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-04-10 23:02:54 +00:00
Victoria Ashworth 0f6756d750
Convert ProjectMigration and ProjectMigrator to be async (#146537)
Convert `ProjectMigration.run()` and `ProjectMigrator.migrate()` to be async.

Needed for Swift Package Manager migration, which requires some async processes: https://github.com/flutter/flutter/pull/146256
2024-04-10 16:26:19 +00:00
Lau Ching Jun 80042124ad
Support mdns when attaching to proxied devices. (#146021)
Also move the vm service discovery logic into platform-specific implementation of `Device`s. This is to avoid having platform-specific code in attach.dart.
2024-04-09 20:00:21 +00:00
Jackson Gardner 51e70fa16b
Fix skwasm tests (#145570)
Skwasm tests are now running as `bringup: true` in postsubmit, but failing. Let's get them fixed.
2024-04-09 19:35:07 +00:00
flutter-pub-roller-bot 84c7298ba1
Roll pub packages (#146444)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-04-08 18:48:19 +00:00
Jenn Magder a5fea8c795
Increase the recommended Xcode version to Xcode 15 (#146367)
Xcode 15 will be required for iOS App Store submission 
> Please note that as of April 2024 all iOS and iPadOS apps submitted to the App Store must be built with a minimum of Xcode 15 and the iOS 17 SDK.

https://developer.apple.com/ios/submit/

And will also be required for Swift Package Manager support https://github.com/flutter/flutter/pull/146256.

We could swap to "required" but macOS developers don't technically need to upgrade.  We can let the Store itself enforce its policies.  And we can swap to Xcode 15 "required" when SPM adoption is further along.

Part of https://github.com/flutter/flutter/issues/144582
2024-04-08 16:56:06 +00:00
Jackson Gardner 75ae44df77
Copy part files and sourcemaps when building with dart2js. (#146356)
This fixes https://github.com/flutter/flutter/issues/145653

When dart2js emits deferred part files, they need to be copied from the build folder to the output folder.
2024-04-05 19:43:15 +00:00
August 9c6fcdac6f
refactor: Perform plugin resolution per platform (#144506)
Part of #137040 and #80374

`possibleResolutions` and `possibleResolutions` used a key containing the platform and the plugin name via `getResolutionKey`. The global list is not necessary and also confusing. It can be avoided by handling the resolution of plugins per platform. This helps to have a more self-contained plugin resolution. This also is necessary to reuse the plugin resolution logic (per platform) for #137040.
2024-04-05 00:19:12 +00:00
Jenn Magder d754a371d9
Remove dead compareIosVersions function (#146298)
Dead all the back in #10780
2024-04-04 21:19:46 +00:00
Daco Harkes ef826ec50b
Flutter templates example app Gradle memory settings (#146275)
Tries to address: https://github.com/flutter/flutter/issues/146236
2024-04-04 15:43:52 +00:00
flutter-pub-roller-bot 7db25fe30f
Roll pub packages (#146245)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-04-04 00:27:34 +00:00
Qun Cheng 69db714fbb
Update material_color_utilities package version to latest 0.11.1 (#145959)
This PR is to update material_color_utilities package version to the latest. `material_color_utilities/scheme/scheme_fruit_salad.dart` and `material_color_utilities/scheme/scheme_rainbow.dart` are exported after version 0.9.0.

Once this PR is merged, we don't need to explicitly import these two files like the change in PR #144805, which breaks some dependencies in `Google testing`.
2024-04-03 02:16:13 +00:00
Kallen Tu 972725332f
Add none language strings to code blocks. (#146154)
Part 2 from https://github.com/flutter/flutter/pull/146085
In preparation to add the lint
`missing_code_block_language_in_doc_comment`, added `none` info strings
to a bunch of fenced code blocks that have miscellaneous text or output
text.

Related to issue: https://github.com/dart-lang/linter/issues/4904

## 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/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
[Data Driven Fixes]:
https://github.com/flutter/flutter/wiki/Data-driven-Fixes
2024-04-02 16:42:25 -07:00
Kallen Tu 9fd9f042fc
Add info strings to code blocks. (#146085)
In preparation to add the lint
`missing_code_block_language_in_doc_comment`, added info strings to a
bunch of fenced code blocks.

Related to issue: https://github.com/dart-lang/linter/issues/4904

## 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/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
[Data Driven Fixes]:
https://github.com/flutter/flutter/wiki/Data-driven-Fixes
2024-04-01 14:05:16 -07:00
Bartek Pacia ec82f0d895
Flutter Gradle Plugin: add versionName and versionCode to FlutterExtension (#146044)
This PR is a follow-up of a previous PR of mine:
https://github.com/flutter/flutter/pull/141417. It was unfinished, i.e.
I only implemented it and used it in `examples/hello_world`. No "flutter
create" templates were modified.

This change is theoretically breaking, but in practice, I am pretty sure
nobody uses this. It was not accounced anywhere, the only app using it
is `examples/hello_world`. I did not do that (that=update docs and
templates) because I wanted a solution that is idiomatic in both Gradle
and Kotlin, and only now I found time to do this.

### Without this change

```groovy
defaultConfig {
    applicationId = "io.flutter.examples.hello_world"
    minSdk = flutter.minSdkVersion
    targetSdk = flutter.targetSdkVersion
    versionCode = flutter.versionCode()
    versionName = flutter.versionName()
}
```

### With this change

```groovy
defaultConfig {
    applicationId = "io.flutter.examples.hello_world"
    minSdk = flutter.minSdkVersion
    targetSdk = flutter.targetSdkVersion
    versionCode = flutter.versionCode
    versionName = flutter.versionName
}
```

Idiomatic getter - yay! It's consistent between assignment of all four
props.

### Issue

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

## 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: Reid Baker <reidbaker@google.com>
2024-04-01 18:09:13 +02:00
Nate a17d4b34f0
Implementing switch expressions in flutter_tools/ (#145632)
This pull request is step 12 in the journey to make this entire repository more readable.

(previous PRs: #139048, #139882, #141591, #142279, #142634, #142793, #143293, #143496, #143634, #143812, #144580)

We're getting close to the end! 😄
2024-03-29 22:31:19 +00:00
Polina Cherkasova bca1d6ad1f
Upgrade leak_tracker. (#145997) 2024-03-29 12:31:52 -07:00
Gray Mackall 85288818b5
Remove trailing commas in android dependency version checking gradle plugin (#145718)
Apparently old versions of kotlin (pre 1.4) don't allow trailing commas.

Example logs: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8752506486861217537/+/u/Run_package_tests/build_all_packages_for_Android_-_legacy_version/stdout
2024-03-29 16:31:06 +00:00
Polina Cherkasova 1a2f34ab5b
Upgrade leak_tracker. (#145940) 2024-03-29 02:39:17 +00:00
Gray Mackall 0984a7f04b
Point kotlin message in gradle_errors.dart towards new place where templates define the kotlin version (#145936)
Fixes https://github.com/flutter/flutter/issues/144454

For reference, after formatting it looks like:
```
┌─ Flutter Fix ──────────────────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project requires a newer version of the Kotlin Gradle plugin.                                 │
│ Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then update the  │
│ version number of the plugin with id "org.jetbrains.kotlin.android" in the plugins block of            │
│ /Users/mackall/development/BugTesting/ELIMINATEME/blah/android/settings.gradle.                        │
│                                                                                                        │
│ Alternatively (if your project was created before Flutter 3.19), update                                │
│ /Users/mackall/development/BugTesting/ELIMINATEME/blah/android/build.gradle                            │
│ ext.kotlin_version = '<latest-version>'                                                                │
└────────────────────────────────────────────────────────────────────────────────────────────────────────┘
```
2024-03-29 00:31:01 +00:00
Christopher Fujino 385bec0abb
Roll pub packages and regenerate gradle lockfiles (#145727)
Example failing devicelab build https://ci.chromium.org/ui/p/flutter/builders/prod/Linux_pixel_7pro%20platform_views_scroll_perf__timeline_summary/2980/overview

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

Supercedes https://github.com/flutter/flutter/pull/145564
2024-03-26 22:07:06 +00:00