Commit Graph

49 Commits

Author SHA1 Message Date
Sigurd Meldgaard
b23840d044
Only bundle assets and plugins from transitive closure of dependencies (#160443)
Fixes https://github.com/dart-lang/pub/issues/4486
Fixes https://github.com/dart-lang/pub/issues/4473
Fixes https://github.com/flutter/flutter/issues/79261
Fixes https://github.com/flutter/flutter/issues/160142
Fixes https://github.com/flutter/flutter/issues/155242

Use the new `.dart_tool/package_graph.json` file to compute the
dependency graph. Determining

* which are transitive dependencies of the main app's direct and
dev-dependencies, (not other packages from the workspace)
* which of these are only in the transitive set of the direct
dependencies

Bundles assets from dev_dependencies when running `flutter test`, but
not otherwise.
2025-05-19 15:30:58 +00:00
Sigurd Meldgaard
45b21ec3bb
Refactor writing of package config in tests (#163734)
Seems like each test had its own way of doing this.

Extracted from https://github.com/flutter/flutter/pull/160443
2025-02-28 08:51:59 +00:00
Michael Goderbauer
5491c8c146
Auto-format Framework (#160545)
This auto-formats all *.dart files in the repository outside of the
`engine` subdirectory and enforces that these files stay formatted with
a presubmit check.

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

---------

Co-authored-by: Kate Lovett <katelovett@google.com>
Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
2024-12-19 20:06:21 +00:00
Sigurd Meldgaard
2812d4685c
Stop reading .packages from flutter_tools. (#154912) 2024-09-13 13:53:05 +02:00
Sigurd Meldgaard
a9daf58829
Reland "Load parent package config" (#153754)
Reverts flutter/flutter#153752
Relands https://github.com/flutter/flutter/pull/150850

Now with attached g3fix
2024-08-20 15:30:46 +02:00
Sigurd Meldgaard
276674e760
Revert "Load parent package config" (#153752)
Reverts flutter/flutter#150850

Seems we need a G3Fix
2024-08-20 12:49:42 +02:00
Sigurd Meldgaard
1a2e25c2d8
Load parent package config (#150850)
Fixes #150196
2024-08-20 09:34:35 +02: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
Michael Goderbauer
5e1ba701ed
enable no_literal_bool_comparisons lint (#126647) 2023-05-16 16:14:23 +00:00
Enguerrand ARMINJON
6259b690f6
feature/clean-a-specific-scheme: Add this-scheme new flag for clean command (#116733)
Co-authored-by: Enguerrand_ARMINJON_MAC_2 <earminjon@sqli.com>
2023-02-21 17:35:13 +00:00
Victoria Ashworth
378387b139
when getting xcworkspace, exclude hidden files (#114099)
* exclude xcworkspace that begins with a period

* fix if spacing, add comment

* add unit test for when no xcworkspace found

* update to use xcodeWorkspace, make it nullable and refactor

* check if hostAppRoot exists before trying to get xcworkspace

* use local variables to take advantage of type promotion

* only check if not null, don't need to check if exists

* readd exist check for migrate

* readd missing line at end of file
2022-11-07 18:48:52 +00:00
Christopher Fujino
b156c0c440
[flutter_tools] migrate clean_test to null-safety (#107750) 2022-07-18 19:10:07 +00:00
Dan Field
e36e62e9a6
Revert "Revert "Audit hashCode overrides outside of packages/flutter (#85370)" (#85451)" (#85567)
This reverts commit 2be0d57fa2.
2021-06-30 09:46:54 -07:00
Ren You
2be0d57fa2
Revert "Audit hashCode overrides outside of packages/flutter (#85370)" (#85451)
This reverts commit 9846fa5145.
2021-06-28 09:55:31 -07:00
Dan Field
9846fa5145
Audit hashCode overrides outside of packages/flutter (#85370) 2021-06-26 17:36:04 -07:00
Jonah Williams
c7d1dc9ba2
[flutter_tools] remove mocks from clean test (#81311) 2021-04-27 15:51:52 -07:00
Jenn Magder
72976f552c
Migrate xcodeproj to null safety (#80549) 2021-04-16 17:22:46 -07:00
Sam Rawlins
3e4320847a
Remove "unnecessary" imports in test/commands.shard. (#78665) 2021-04-06 11:14:01 -07:00
Jenn Magder
8ddc27e607
Split globals.dart into null sound and unsound libraries (#79016) 2021-03-31 16:55:20 -07:00
Jenn Magder
d099ae60f0
Add ephemeral iOS directory to put future generated files (#76830) 2021-02-25 18:16:03 -08:00
Jenn Magder
5e61466794
Adopt FileExceptionHandler in a few tests (#76279) 2021-02-17 23:41:04 -08:00
Jonah Williams
021311ed8a
Revert "[flutter_tools] move process manager into tool (#75350)" (#75639)
This reverts commit 8b6baae44c.
2021-02-08 09:21:46 -08:00
Jonah Williams
8b6baae44c
[flutter_tools] move process manager into tool (#75350)
Our current top crasher is an unclear error when ProcessManager fails to resolve an executable path. To fix this, we'd like to being adjusting the process resolution logic and adding more instrumentation to track failures. In order to begin the process, the ProcessManager has been folded back into the flutter tool
2021-02-04 13:19:11 -08:00
Jonah Williams
74bd7b6f6d
[flutter_tools] opt all flutter tool libraries and tests out of null safety. (#74832)
* opt out the flutter tool

* oops EOF

* fix import

* Update tool_backend.dart

* Update daemon_client.dart

* fix more
2021-01-27 15:17:53 -08:00
Jenn Magder
fe921211df
Replace MockXcode with Xcode.test in more unit tests (#74827) 2021-01-27 13:07:07 -08:00
Jonah Williams
66175760be
[flutter_tools] delete .packages during flutter clean (#73364) 2021-01-05 18:54:03 -08:00
Jenn Magder
617c57bc95
Flutter clean Flutter.podspec (#72306) 2020-12-14 19:13:03 -08:00
Jenn Magder
2529e358b6
Move Flutter.framework to build directory instead of ios/Flutter (#70224) 2020-11-17 10:09:29 -08:00
Jenn Magder
91b82347af
Build App.framework directly to build directory (#69699) 2020-11-03 12:48:25 -08:00
Jonah Williams
a2a4e9eda4
Revert "Build App.framework directly to build directory (#69612)" (#69641)
This reverts commit b77088319a.
2020-11-02 20:12:47 -08:00
Jenn Magder
b77088319a
Build App.framework directly to build directory (#69612) 2020-11-02 18:48:03 -08:00
Jenn Magder
e8fbb43aac
Replace MockFile with memory file system files (#66941) 2020-09-29 17:50:33 -07:00
Jonah Williams
3a976feb58
[flutter_tools] clean plugin dependencies file (#62061)
Clean even more, in case the plugin dependency update logic is wrong-o.
2020-07-22 18:39:33 -07:00
Jenn Magder
e110ca7209
Case insensitive check flavor names against Xcode schemes (#61140) 2020-07-09 16:56:02 -07:00
Zachary Anderson
6f0ed5e142
[flutter_tools] Restore base/platform.dart (#56410) 2020-05-06 08:15:39 -07:00
Jenn Magder
a61bff2fcf
Show Xcode workspace clean output with verbose flag (#52860) 2020-03-19 09:51:01 -07:00
Jenn Magder
ee845255de
Move XcodeProjectInterpreter to globals (#52847) 2020-03-18 15:55:09 -07:00
Jenn Magder
4fb9ce8414
Clean App.framework, Generated.xcconfig, flutter_export_environment.sh (#51532) 2020-02-27 12:18:06 -08:00
Jenn Magder
0407a318c6
Replace clean command test functions with test groups (#51508) 2020-02-26 15:13:43 -08:00
Jonah Williams
f7b8d62cbc
[flutter_tool] Refactor Logger and Terminal to (mostly) no longer depend directly on context (#47269) 2020-01-08 12:35:12 -08:00
Jonah Williams
ee7a37f1d3
[flutter_tools] Ensure that global variables are easily identifiable (#47398) 2020-01-06 11:04:20 -08:00
Ian Hickson
449f4a6673
License update (#45373)
* Update project.pbxproj files to say Flutter rather than Chromium

Also, the templates now have an empty organization so that we don't cause people to give their apps a Flutter copyright.

* Update the copyright notice checker to require a standard notice on all files

* Update copyrights on Dart files. (This was a mechanical commit.)

* Fix weird license headers on Dart files that deviate from our conventions; relicense Shrine.

Some were already marked "The Flutter Authors", not clear why. Their
dates have been normalized. Some were missing the blank line after the
license. Some were randomly different in trivial ways for no apparent
reason (e.g. missing the trailing period).

* Clean up the copyrights in non-Dart files. (Manual edits.)

Also, make sure templates don't have copyrights.

* Fix some more ORGANIZATIONNAMEs
2019-11-27 15:04:02 -08:00
Alexandre Ardhuin
980f14e0c5
implicit-casts:false on flutter_tools (#45153)
* implicit-casts:false on flutter_tools

* use castStringKeyedMap

* address review comments

* address review comments

* fix issues after rebase
2019-11-24 06:54:43 +01:00
Jonah Williams
ae207b5e42
Handle permission error during flutter clean (#43401) 2019-10-25 15:02:38 -07:00
Jonah Williams
4c677e4148
Extra defensive programming for pub modification time assert (#43315) 2019-10-22 22:05:00 -07:00
Jonah Williams
46ea99122b
Revert "Extra defensive programming for pub modification time assert (#42491)" (#43235)
This reverts commit 3597bae6a0.
2019-10-21 20:54:02 -07:00
Ian Hickson
3597bae6a0 Extra defensive programming for pub modification time assert (#42491) 2019-10-21 20:15:20 -07:00
Ian Hickson
08643c41d7
Always fake ProcessManager when you fake Filesystem in tests (#42369)
...because otherwise, processes that think they're manipulating your
filesystem will be doing crazy things the test is ignoring, leading to
(at best) failures and (at worst) flakes or disk corruption.
2019-10-11 11:23:12 -07:00
Ian Hickson
8c6d60bcfd
Move commands into their own shard (#39140) 2019-10-02 12:46:51 -07:00