Commit Graph

27 Commits

Author SHA1 Message Date
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
Matan Lurey
78cfc1ae9b
Plugin.isDevDependency if exclusively in dev_dependencies (#157462)
Work towards https://github.com/flutter/flutter/issues/56591.

I explicitly want an LGTM from @andrewkolos @jmagman @jonahwilliams before merging.

---

After this PR, `<Plugin>.isDevDependency` is resolved based on the following logic, IFF:

- The plugin comes from a package _A_ listed in the app's package's `dev_dependencies: ...`
- The package _A_ is not a normal dependency of any transitive non-dev dependency of the app

See [`compute_dev_dependencies_test.dart`](51676093a3/packages/flutter_tools/test/general.shard/compute_dev_dependencies_test.dart) for probably the best specification of this behavior.

We (still) do not write the property to disk (i.e. it never makes it to `.flutter-plugins-dependencies`), so there is no impact to build artifacts at this time; that would come in a follow-up PR (and then follow-up follow-up PRs for the various build systems in both Gradle and Xcode to actually use that value to omit dependencies).

Some tests had to be updated; for the most part it was updating the default `ProcessManager` because a call to `dart pub deps --json` is now made in code that computes what plugins are available, but there should be no change in behavior.

_/cc @jonasfj @sigurdm for FYI only (we talked on an internal thread about this; see https://github.com/dart-lang/sdk/issues/56968)._

_/cc @camsim99 @cbracken @johnmccutchan for visibility on the change._
2024-11-07 18:09:22 +00:00
Mikhail Novoseltsev
d9321159bf
[tool] Add dartFileName setting for platform plugins (#153099)
This PR introduces the `dartFileName` parameter for platform plugin configurations with Dart platform implementations. This new parameter allows plugin developers to specify a custom path to the file where the `dartPluginClass` is defined.

**Implementation is opt-in**. `dartFileName` is completely optional and is taken in account only with `dartClassName`. Possibility to set `dartClassName` without `dartFileName` remains. 

**Implementation is backward compatible** – existing configurations using only `dartClassName` remain fully supported. If `dartFileName` is omitted, the system falls back to the previous behavior of deriving the file name from the plugin name.

## Example

```yaml
flutter:
  plugin:
    platforms:
      some_platform:
        dartPluginClass: MyPlugin
        dartFileName: 'src/my_plugin_implementation.dart'
```

fixes #152833
2024-09-06 18:27:09 +00:00
Jenn Magder
eaaacdcba9
Allow iOS and macOS plugins to share darwin directory (#115337) 2023-01-09 10:33:03 -08:00
Christopher Fujino
672fe20bde
[flutter_tools] Fix null check in parsing web plugin from pubspec.yaml (#117939)
* fix null check in parsing web plugin yaml

* revert accidental diff

* remove comment
2023-01-04 20:28:26 +00:00
Jonah Williams
944fcda67f
[flutter_tools] remove UWP tooling (#102174) 2022-04-26 11:19:07 -07:00
stuartmorgan
25b2edbda0
Enable inline Dart plugin implementation on Desktop (#96610) 2022-01-19 09:35:23 -08:00
stuartmorgan
23cea26715
Add dartPluginClass support for Android and iOS (#87991) 2021-10-01 16:03:04 -07:00
stuartmorgan
57fcee28c7
Allow platform variants for Windows plugins (#82816)
Windows plugins are designed to share implementations between Win32 and
UWP, but not all plugins will support both. This adds a new
'supportedVariants' key to Windows plugins that allows specifying
'win32' and/or 'uwp' (and potentially others in the future in case that
becomes necessary).

Plugins without any supported variants will be assumed to be Win32 for
backward compatibility.

This will allow compiling Windows projects that use Win32-only Windows
plugins (which is currently all of them) in UWP mode. The plugins will
of course throw missing implementation exceptions at runtime, but tehy
won't prevent being able to build as they currently do.

Fixes https://github.com/flutter/flutter/issues/82815
2021-05-26 16:20:21 -07:00
Emmanuel Garcia
b0a63c4ffe
Reland the Dart plugin registry (#79669) 2021-04-23 15:34:04 -07:00
Jenn Magder
d40cc5af8f
Migrate flutter_tool plugins.dart to null safety (#80304) 2021-04-13 13:52:58 -07:00
Zachary Anderson
5efc7169eb
Reverts "Implement dartPluginClass support for plugins #74469" (#78623)
* Revert "Enable dart_plugin_registry_test (#76645)"

This reverts commit 109e0bb9f5.

* Revert "Apply changes caused by https://github.com/flutter/flutter/pull/76662 (#77093)"

This reverts commit cdca6485f0.

* Revert "Disable clang format in the plugin registrants (#76662)"

This reverts commit dadbd47d09.

* Revert "Disable warnings for the dart plugin registrant (#76561)"

This reverts commit 098ece522d.

* Revert "Remove dart_plugin_registry_test timeouts (#76838)"

This reverts commit 1610a27476.

* Revert "Implement dartPluginClass support for plugins (#74469)"

This reverts commit b7d4806243.

Kick.
2021-03-23 14:28:11 -07:00
Emmanuel Garcia
b7d4806243
Implement dartPluginClass support for plugins (#74469) 2021-02-19 09:22:45 -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
186765b3a7
[flutter_tools] cleanups to plugin test cases (#67242)
Removes usage of global variables, expands documentation, and fixes some formatting inconsistencies. Increased test coverage for android plugin to prove it can determine the embedding version.
2020-10-05 14:45:39 -07:00
Francisco Magdaleno
e012752634
[flutter_tools] Don't generate native registrant classes if no pluginClass is defined (#53785) 2020-04-03 11:51:01 -07:00
Jenn Magder
e31521eab5
Validate empty pubspec plugin section (#51503) 2020-02-26 15:44:35 -08:00
Jenn Magder
8a3c98633a
Disallow empty platforms and specific platforms when parsing manifest for plugins (#49262) 2020-01-22 10:52:23 -08:00
Alek Åström
853c8c569f [flutter_tools] Add violating plugin name to validation errors (#46601) 2019-12-17 14:08:03 -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
Emmanuel Garcia
b6e92003c8
Add .flutter-plugins-dependencies to the project, which contains the app's plugin dependency graph (#45379) 2019-11-22 15:02:20 -08:00
Amir Hardon
e43a69a9fe
Allow a no-op default_package key for a plugin platform (#45364) 2019-11-21 16:37:34 -08:00
Amir Hardon
53c7ca7d5a
Allow unknown fields in pubspec plugin section (#45303) 2019-11-20 17:00:46 -08:00
stuartmorgan
56d68a9071
Add the beginnings of plugin support for Windows and Linux (#41015)
Adds very preliminary support for Windows and Linux plugins:
- Adds those platforms to the new plugin schema, initially supporting just a plugin class.
- Adds C++ plugin registrant generation for any Windows or Linux plugins found.

This doesn't have yet have any build tooling for either platform, so anyone using the generated registrant still needs to do manual build configuration. This reduces the manual work, however, and creates a starting point for future tooling work.

As with all Windows and Linux work at this time, this is not final, and subject to change without warning in the future (e.g., Windows could potentially switch to a C# interface, or
'linux' may change to 'gtk' or 'linux_gtk' in pubspec.yaml).
2019-09-26 14:01:57 -07:00
Harry Terkelsen
d33cf11556
Automatically generated registrants for web plugins (#39628)
* WIP on web plugin registry

* WIP on registering plugins

* WIP on web plugin registration

* Only generate `package:flutter_web_plugins` imports if plugins are
defined

* Add parsing test

* Add documentation

* Fix analyzer warnings

* add license headers

* Add tests for package:flutter_web_plugins

* Run `flutter update-packages --force-upgrade`

* Fix analyzer errors

* Fix analyzer error in test

* Update copyright and remove flutter SDK constraints

* Enable tests since engine has rolled

* add flutter_web_plugins tests to bots

* Create an empty .packages file for WebFs test
2019-09-03 10:37:34 -07:00
Kaushik Iska
fc05c3738c
Flutter Plugin Tool supports multi-platform plugin config (#38632) 2019-08-29 21:51:31 -07:00