From 73425740690c395fbac0aae7d68fc980ac774258 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Sat, 28 May 2022 00:08:07 +0200 Subject: [PATCH] Fix plugin_ffi bindings regen command and bump ffigen (#104844) --- .../flutter_tools/templates/plugin_ffi/ffigen.yaml.tmpl | 4 ++-- .../lib/projectName_bindings_generated.dart.tmpl | 8 ++++---- .../templates/plugin_shared/pubspec.yaml.tmpl | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/flutter_tools/templates/plugin_ffi/ffigen.yaml.tmpl b/packages/flutter_tools/templates/plugin_ffi/ffigen.yaml.tmpl index 5762da10e4..65aa00e692 100644 --- a/packages/flutter_tools/templates/plugin_ffi/ffigen.yaml.tmpl +++ b/packages/flutter_tools/templates/plugin_ffi/ffigen.yaml.tmpl @@ -1,9 +1,9 @@ -# Run with `dart run ffigen --config ffigen.yaml`. +# Run with `flutter pub run ffigen --config ffigen.yaml`. name: {{pluginDartClass}}Bindings description: | Bindings for `src/{{projectName}}.h`. - Regenerate bindings with `dart run ffigen --config ffigen.yaml`. + Regenerate bindings with `flutter pub run ffigen --config ffigen.yaml`. output: 'lib/{{projectName}}_bindings_generated.dart' headers: entry-points: diff --git a/packages/flutter_tools/templates/plugin_ffi/lib/projectName_bindings_generated.dart.tmpl b/packages/flutter_tools/templates/plugin_ffi/lib/projectName_bindings_generated.dart.tmpl index 0c5f74045e..cb21d861d2 100644 --- a/packages/flutter_tools/templates/plugin_ffi/lib/projectName_bindings_generated.dart.tmpl +++ b/packages/flutter_tools/templates/plugin_ffi/lib/projectName_bindings_generated.dart.tmpl @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; /// Bindings for `src/{{projectName}}.h`. /// -/// Regenerate bindings with `dart run ffigen --config ffigen.yaml`. +/// Regenerate bindings with `flutter pub run ffigen --config ffigen.yaml`. /// class {{pluginDartClass}}Bindings { /// Holds the symbol lookup function. @@ -48,9 +48,9 @@ class {{pluginDartClass}}Bindings { /// A longer lived native function, which occupies the thread calling it. /// - /// Calling these kind of native functions in the main isolate will - /// block Dart execution and cause dropped frames in Flutter applications. - /// Consider calling such native functions from a separate isolate. + /// Do not call these kind of native functions in the main isolate. They will + /// block Dart execution. This will cause dropped frames in Flutter applications. + /// Instead, call these native functions on a separate isolate. int sum_long_running( int a, int b, diff --git a/packages/flutter_tools/templates/plugin_shared/pubspec.yaml.tmpl b/packages/flutter_tools/templates/plugin_shared/pubspec.yaml.tmpl index 1377bb0777..1a000adc17 100644 --- a/packages/flutter_tools/templates/plugin_shared/pubspec.yaml.tmpl +++ b/packages/flutter_tools/templates/plugin_shared/pubspec.yaml.tmpl @@ -23,8 +23,8 @@ dependencies: dev_dependencies: {{#withFfiPluginHook}} - ffi: ^1.1.2 - ffigen: ^4.1.2 + ffi: ^1.2.1 + ffigen: ^5.0.1 {{/withFfiPluginHook}} flutter_test: sdk: flutter