Skip to content

Conversation

@swift-kim
Copy link
Member

@swift-kim swift-kim commented Apr 30, 2021

[Before]

  • (Native) Plugins are compiled as part of the runner executable.
  • (.NET) Plugins are built separately into each .so and loaded by the runner (managed DLL) via P/Invoke. This results in the error stated by Destroy the plugin properly when exiting the app #90, because each plugin creates its own PluginRegistrarManager instance and tries to register its destruction handler to the embedder.

[After]

  • Plugins are compiled into a single file libflutter_plugins.so regardless of the app type.

Changelog:

  • Re-write the TizenPlugins build target
  • Update DotnetTpk.build() and NativeTpk.build() accordingly and clean up
  • Remove the TizenLibrary class and merge it with TizenPlugin
  • Change the TPK output directory (from build/tizen to build/tizen/tpk)
  • Wrap the plguin class in the plugin template with an unnamed namespace to prevent potential naming conflicts
  • Replace __FILE__ with __MODULE__ in templates/plugin/cpp/src/log.h.tmpl

Fixes #90.

@swift-kim swift-kim requested review from a team, HakkyuKim and bbrto21 April 30, 2021 05:31
Copy link
Contributor

@bbrto21 bbrto21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for fixing #90!

@swift-kim swift-kim force-pushed the plugin-single-so branch from fd7d849 to b2956ba Compare May 3, 2021 05:39
@swift-kim swift-kim merged commit 9e3e07b into flutter-tizen:master May 4, 2021
@swift-kim swift-kim mentioned this pull request Jun 26, 2021
18 tasks
bbrto21 pushed a commit that referenced this pull request Jul 13, 2022
Copy a plugin's res directory to res/[plugin_name] in the output TPK during app build.

This feature has been requested by @xiaowei-guan. He wants to selectively dlopen a shared library (bundled with a plugin) depending on the current platform version at runtime.

Known issue: The incremental build may fail (plugins do not rebuild) if a new lib or res file has been added after an initial build without modification to any other source file. Possible solutions include:

Always force rebuild plugins (this affects the overall build time), or
Support the "sharedLib" plugin type (which has been deprecated as of Compile native plugins into a single shared object #98) and let the user explicitly specify lib names in project_def.prop. (This is a partial solution since res files are not listed by project_def.prop.)
bbrto21 pushed a commit to flutter-tizen/engine that referenced this pull request Jul 14, 2022
Applies flutter#30760 to the Tizen embedder.

This is an actual fix for flutter-tizen/flutter-tizen#90, which has been worked around by flutter-tizen/flutter-tizen#98. We can now support the old-fashioned "sharedLib" style plugins (each plugin is built into an individual shared object) based on this change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Destroy the plugin properly when exiting the app

2 participants