From 7d3d552dc39fb9c78259c5fa9b9a3d2f822f99a5 Mon Sep 17 00:00:00 2001 From: Bin <17426470+boyan01@users.noreply.github.com> Date: Thu, 8 Aug 2024 18:03:49 +0800 Subject: [PATCH] [mixin_logger] export header (#354) * [mixin_logger] export header for ios/macos * export linux header * export linux header * fix * [mixin_logger] bump version --- packages/mixin_logger/CHANGELOG.md | 4 ++ packages/mixin_logger/example/pubspec.lock | 58 +++++++++++++------ packages/mixin_logger/ffigen.yaml | 6 +- .../mixin_logger/ios/Classes/mixin_logger.h | 1 + .../mixin_logger/ios/mixin_logger.podspec | 1 + .../src/mixin_logger_bindings_generated.dart | 2 +- .../mixin_logger/macos/Classes/mixin_logger.h | 1 + .../mixin_logger/macos/mixin_logger.podspec | 1 + packages/mixin_logger/pubspec.yaml | 2 +- packages/mixin_logger/src/CMakeLists.txt | 3 +- .../{ => include/mixin_logger}/mixin_logger.h | 0 packages/mixin_logger/src/mixin_logger.cpp | 2 +- 12 files changed, 57 insertions(+), 24 deletions(-) create mode 120000 packages/mixin_logger/ios/Classes/mixin_logger.h create mode 120000 packages/mixin_logger/macos/Classes/mixin_logger.h rename packages/mixin_logger/src/{ => include/mixin_logger}/mixin_logger.h (100%) diff --git a/packages/mixin_logger/CHANGELOG.md b/packages/mixin_logger/CHANGELOG.md index 26cb09ec..ddcb5f7b 100644 --- a/packages/mixin_logger/CHANGELOG.md +++ b/packages/mixin_logger/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.2 + +* export native c header file + ## 0.1.1 * add android support. diff --git a/packages/mixin_logger/example/pubspec.lock b/packages/mixin_logger/example/pubspec.lock index 83cafba1..619719d4 100644 --- a/packages/mixin_logger/example/pubspec.lock +++ b/packages/mixin_logger/example/pubspec.lock @@ -91,6 +91,30 @@ packages: description: flutter source: sdk version: "0.0.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + url: "https://pub.dev" + source: hosted + version: "10.0.5" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + url: "https://pub.dev" + source: hosted + version: "3.0.5" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" lints: dependency: transitive description: @@ -103,41 +127,41 @@ packages: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.15.0" mixin_logger: dependency: "direct main" description: path: ".." relative: true source: path - version: "0.1.1" + version: "0.1.2" path: dependency: "direct main" description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" sky_engine: dependency: transitive description: flutter @@ -187,10 +211,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "0.7.2" vector_math: dependency: transitive description: @@ -199,14 +223,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" - web: + vm_service: dependency: transitive description: - name: web - sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + name: vm_service + sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "14.2.4" sdks: - dart: ">=3.2.0-194.0.dev <4.0.0" - flutter: ">=2.0.0" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/packages/mixin_logger/ffigen.yaml b/packages/mixin_logger/ffigen.yaml index 34879a4a..23f1ab7f 100644 --- a/packages/mixin_logger/ffigen.yaml +++ b/packages/mixin_logger/ffigen.yaml @@ -3,13 +3,13 @@ name: MixinLoggerBindings description: | Bindings for `src/mixin_logger.h`. - Regenerate bindings with `flutter pub run ffigen --config ffigen.yaml`. + Regenerate bindings with `dart run ffigen --config ffigen.yaml`. output: 'lib/src/mixin_logger_bindings_generated.dart' headers: entry-points: - - 'src/mixin_logger.h' + - 'src/include/mixin_logger/mixin_logger.h' include-directives: - - 'src/mixin_logger.h' + - 'src/include/mixin_logger/mixin_logger.h' preamble: | // ignore_for_file: always_specify_types // ignore_for_file: camel_case_types diff --git a/packages/mixin_logger/ios/Classes/mixin_logger.h b/packages/mixin_logger/ios/Classes/mixin_logger.h new file mode 120000 index 00000000..c3490afe --- /dev/null +++ b/packages/mixin_logger/ios/Classes/mixin_logger.h @@ -0,0 +1 @@ +../../src/include/mixin_logger/mixin_logger.h \ No newline at end of file diff --git a/packages/mixin_logger/ios/mixin_logger.podspec b/packages/mixin_logger/ios/mixin_logger.podspec index 4680e5d6..91d643e7 100644 --- a/packages/mixin_logger/ios/mixin_logger.podspec +++ b/packages/mixin_logger/ios/mixin_logger.podspec @@ -19,6 +19,7 @@ A new Flutter FFI plugin project. # `../src/*` so that the C sources can be shared among all target platforms. s.source = { :path => '.' } s.source_files = 'Classes/**/*' + s.public_header_files = 'Classes/**/*.h' s.dependency 'Flutter' s.platform = :ios, '11.0' diff --git a/packages/mixin_logger/lib/src/mixin_logger_bindings_generated.dart b/packages/mixin_logger/lib/src/mixin_logger_bindings_generated.dart index 228c5d48..edf77152 100644 --- a/packages/mixin_logger/lib/src/mixin_logger_bindings_generated.dart +++ b/packages/mixin_logger/lib/src/mixin_logger_bindings_generated.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; /// Bindings for `src/mixin_logger.h`. /// -/// Regenerate bindings with `flutter pub run ffigen --config ffigen.yaml`. +/// Regenerate bindings with `dart run ffigen --config ffigen.yaml`. /// class MixinLoggerBindings { /// Holds the symbol lookup function. diff --git a/packages/mixin_logger/macos/Classes/mixin_logger.h b/packages/mixin_logger/macos/Classes/mixin_logger.h new file mode 120000 index 00000000..c3490afe --- /dev/null +++ b/packages/mixin_logger/macos/Classes/mixin_logger.h @@ -0,0 +1 @@ +../../src/include/mixin_logger/mixin_logger.h \ No newline at end of file diff --git a/packages/mixin_logger/macos/mixin_logger.podspec b/packages/mixin_logger/macos/mixin_logger.podspec index 79a0dcaf..f67552f1 100644 --- a/packages/mixin_logger/macos/mixin_logger.podspec +++ b/packages/mixin_logger/macos/mixin_logger.podspec @@ -19,6 +19,7 @@ A new Flutter FFI plugin project. # `../src/*` so that the C sources can be shared among all target platforms. s.source = { :path => '.' } s.source_files = 'Classes/**/*' + s.public_header_files = 'Classes/**/*.h' s.dependency 'FlutterMacOS' s.platform = :osx, '10.11' diff --git a/packages/mixin_logger/pubspec.yaml b/packages/mixin_logger/pubspec.yaml index e8a15a65..8aaeaa06 100644 --- a/packages/mixin_logger/pubspec.yaml +++ b/packages/mixin_logger/pubspec.yaml @@ -1,6 +1,6 @@ name: mixin_logger description: Simple logger tool for flutter, make it easy to save your app log to file. -version: 0.1.1 +version: 0.1.2 homepage: https://github.com/MixinNetwork/flutter-plugins environment: diff --git a/packages/mixin_logger/src/CMakeLists.txt b/packages/mixin_logger/src/CMakeLists.txt index 88bcb2f1..42e7cb81 100644 --- a/packages/mixin_logger/src/CMakeLists.txt +++ b/packages/mixin_logger/src/CMakeLists.txt @@ -12,11 +12,12 @@ add_library(mixin_logger SHARED ) set_target_properties(mixin_logger PROPERTIES - PUBLIC_HEADER mixin_logger.h + PUBLIC_HEADER include/mixin_logger/mixin_logger.h OUTPUT_NAME "mixin_logger" ) target_compile_definitions(mixin_logger PUBLIC DART_SHARED_LIB) +target_include_directories(mixin_logger PUBLIC include) find_package(GTest) if (GTest_FOUND) diff --git a/packages/mixin_logger/src/mixin_logger.h b/packages/mixin_logger/src/include/mixin_logger/mixin_logger.h similarity index 100% rename from packages/mixin_logger/src/mixin_logger.h rename to packages/mixin_logger/src/include/mixin_logger/mixin_logger.h diff --git a/packages/mixin_logger/src/mixin_logger.cpp b/packages/mixin_logger/src/mixin_logger.cpp index d864ac06..eddac0d8 100644 --- a/packages/mixin_logger/src/mixin_logger.cpp +++ b/packages/mixin_logger/src/mixin_logger.cpp @@ -1,4 +1,4 @@ -#include "mixin_logger.h" +#include "mixin_logger/mixin_logger.h" #if _MSVC_LANG >= 201703L || __cplusplus >= 201703L && defined(__has_include) // ^ Supports MSVC prior to 15.7 without setting /Zc:__cplusplus to fix __cplusplus