Commit Graph

33 Commits

Author SHA1 Message Date
Parker Lougheed
77ba015769
[tool] Fix broken comment references and code spans in doc comments (#168498)
Enables the `comment_references` and `unintended_html_in_doc_comment`
lints in `packages/flutter_tool`, then fixes each of the triggering
cases.

This PR is test exempt due to only affecting documentation comments.

## 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.

[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-05-15 21:14:26 +00:00
Loïc Sharma
a48a1f07b8
[tool] Improve using project files in build targets (#166211)
The Flutter tool's build system executes targets that take inputs and
produces outputs. Previously, targets would hardcode paths if they
needed to use Flutter project files as inputs/outputs. For example:

```dart
class FooTarget extends Target {
  @override
  List<Source> get inputs => <Source>[
    Source.pattern('{PROJECT_DIR}/foo/bar'),
  ];
}
```

This is problematic as the
[`FlutterProject`](05b5e79105/packages/flutter_tools/lib/src/project.dart (L89))
is the source of truth for where a Flutter project's files are located:

1. If we change a project file's location, we need to update
`FlutterProject` as well as any hardcoded target inputs/outputs.
2. Project files' location can be dynamic. For example, a Flutter app
puts iOS files in the `ios/` directory, but a Flutter module puts iOS
files in the `.ios/` directory. Targets need to duplicate
`FlutterProject`'s logic to determine the project file's location.

As a result, hardcoding project file paths in targets can be
error-prone.

This introduces a new `Source` factory that lets you use the
`FlutterProject` to create the source:

```dart
class FooTarget extends Target {
  @override
  List<Source> get inputs => <Source>[
    Source.fromProject((FlutterProject project) => project.fooFile),
  ];
}
```

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

Next pull request: https://github.com/flutter/flutter/pull/165916

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2025-04-01 05:15:25 +00:00
Matan Lurey
71d50a1616
Start using bin/cache/engine.{stamp|realm} instead of bin/internal/engine.{realm|version}. (#164352)
Towards https://github.com/flutter/flutter/issues/164315.

See also:
https://github.com/flutter/flutter/blob/master/docs/tool/Engine-artifacts.md.

There are more usages in `flutter/flutter`, but some will require more
specialized review (i.e. from release folks, or the Dart SDK team), so
I'll split those off.

~~Requires https://github.com/flutter/flutter/pull/164317 to merge
first.~~ 
2025-03-02 00:54:33 +00:00
Matan Lurey
a19509c6c3
Document how engine.version (is/will be) computed (#164335)
Towards https://github.com/flutter/flutter/issues/163896.
2025-02-27 22:48:48 +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
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
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
Phil Quitslund
5bf6318688
Update collection-fors to prefer final (as per updated prefer_final_in_for_each) (#127511)
The newly updated lint will soon flag for-each in collections.

See discussion: https://github.com/dart-lang/linter/pull/4383

/cc @goderbauer
2023-05-26 23:34:36 +00:00
Michael Goderbauer
fda9ecfef7
Remove 1745 decorative breaks (#123259)
Remove 1745 decorative breaks
2023-03-22 21:12:22 +00:00
Jenn Magder
19eab105a5
Migrate build_system, exceptions, and source to null safety (#83147) 2021-05-24 10:29:04 -07:00
Jonah Williams
b30d97a64c
[flutter_tools] split host artifacts out of Artifacts (#80876) 2021-04-22 19:29:02 -07:00
Gary Qian
ee41782732
[flutter_tools] Deferred components build system (#76192) 2021-03-04 18:09:02 -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
Jonah Williams
9e72bf565e
[flutter_tools] don't compute hashes of well known artifacts (#53848) 2020-04-20 12:21:20 -07:00
Jonah Williams
72343ee0e4
[flutter_tools] refactor build_system and targets to be context-free (#53268) 2020-03-30 12:51:04 -07:00
Alexandre Ardhuin
4f9b6cf017
enable lint prefer_final_in_for_each (#47724) 2020-01-07 16:32:04 +01: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
Greg Spencer
a60bf8e23a
Spell check of Flutter docs (#45200)
No code changes, just comments: I spell-checked all the comments in the repo.
2019-11-22 08:43:55 -08:00
Alexandre Ardhuin
adc7351046
implicit-casts:false on flutter_tools/lib (#44447)
* implicit-casts:false on flutter_tools/lib

* address review comments

* use castStringKeyedMap

* introduce {bool,string,strings}Arg

* fix ci
2019-11-19 07:57:42 +01:00
Jonah Williams
58438fca3f Provide specific field to accept depfiles in target class (#44481)
* add depfile slot to Target class

* Update source.dart

* Update source.dart
2019-11-18 14:09:40 -08:00
Jonah Williams
0f6c093d68
Remove Source.behavior, fix bug in depfile invalidation (#43945)
* remove Source.behavior, fix bug in depfile invalidation

* more cleanup of assets

* Add skip

* address comments

* Update build_system.dart
2019-11-04 16:37:43 -08:00
Jonah Williams
27105cba2f
switch dart2js build to depfile, remove Source.function (#42977) 2019-10-21 16:46:44 -07:00
Alexandre Ardhuin
83e5a8a0e4
some formatting changes (#41640) 2019-10-08 18:32:10 +02:00
Alexandre Ardhuin
890b939401
indent formal parameters correctly (#41644) 2019-10-04 11:00:18 +02:00
Jonah Williams
41b87255f5
Add support for depfile dependency in assemble (#41530) 2019-09-30 12:17:45 -07:00
Alexandre Ardhuin
f0553ba58e
Missing trailing commas (#41473)
* add missing trailing commas

* add more missing trailing commas

* add more and more missing trailing commas
2019-09-30 18:48:23 +02:00
Jonah Williams
55a1ba761d
Use output dir instead of specific paths in assemble rules (#39274) 2019-08-27 22:52:51 -07:00
Jonah Williams
2ab469952b
Flutter assemble for macos take 2! (#36987) 2019-07-31 16:19:22 -07:00
Jonah Williams
188093c912
Rearrange flutter assemble implementation (#36240) 2019-07-25 08:50:03 -07:00
Jonah Williams
e91b98a41f
Add initial implementation of flutter assemble (#32816) 2019-07-11 16:53:17 -07:00