feat: build flowy_sdk as dylib on macOS

This commit is contained in:
appflowy 2022-02-19 16:59:36 +08:00
parent c559c5cc6b
commit 6fc8197468
4 changed files with 6 additions and 10 deletions

View File

@ -19,8 +19,8 @@ VERSION = "0.0.3"
FEATURES = "flutter"
PRODUCT_NAME = "AppFlowy"
#CRATE_TYPE: https://doc.rust-lang.org/reference/linkage.html
CRATE_TYPE = "staticlib"
SDK_EXT = "a"
CRATE_TYPE = "cdylib"
SDK_EXT = "dylib"
APP_ENVIRONMENT = "local"
FLUTTER_FLOWY_SDK_PATH="app_flowy/packages/flowy_sdk"
PROTOBUF_DERIVE_CACHE="../shared-lib/flowy-derive/src/derive_cache/derive_cache.rs"
@ -32,8 +32,6 @@ RUST_COMPILE_TARGET = "x86_64-apple-darwin"
BUILD_FLAG = "debug"
FLUTTER_OUTPUT_DIR = "Debug"
PRODUCT_EXT = "app"
CRATE_TYPE = "cdylib"
SDK_EXT = "dylib"
[env.production-mac-aarch64]
BUILD_FLAG = "release"
@ -42,7 +40,6 @@ RUST_COMPILE_TARGET = "aarch64-apple-darwin"
FLUTTER_OUTPUT_DIR = "Release"
PRODUCT_EXT = "app"
APP_ENVIRONMENT = "production"
CRATE_TYPE = "staticlib"
[env.production-mac-x86]
BUILD_FLAG = "release"
@ -128,7 +125,6 @@ script_runner = "@shell"
[env.production-ios]
BUILD_FLAG = "release"
TARGET_OS = "ios"
CRATE_TYPE = "staticlib"
FLUTTER_OUTPUT_DIR = "Release"
PRODUCT_EXT = "ipa"

View File

@ -44,7 +44,7 @@ class System {
// add task
getIt<AppLauncher>().addTask(InitRustSDKTask());
getIt<AppLauncher>().addTask(AppWidgetTask());
getIt<AppLauncher>().addTask(ApplicationWidgetTask());
getIt<AppLauncher>().addTask(InitPlatformService());
// execute the tasks

View File

@ -10,7 +10,7 @@ import 'package:window_size/window_size.dart';
import 'package:bloc/bloc.dart';
import 'package:flowy_sdk/log.dart';
class AppWidgetTask extends LaunchTask {
class ApplicationWidgetTask extends LaunchTask {
@override
LaunchTaskType get type => LaunchTaskType.appLauncher;

View File

@ -20,6 +20,6 @@ A new flutter plugin project.
s.platform = :osx, '10.11'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.swift_version = '5.0'
s.static_framework = true
s.vendored_libraries = "libdart_ffi.a"
# s.static_framework = true
s.vendored_libraries = "libdart_ffi.dylib"
end