[rust]: fix scripts errors

This commit is contained in:
appflowy 2021-11-15 21:47:51 +08:00
parent 96560d2b3e
commit 92ab7eac17
3 changed files with 9 additions and 10 deletions

View File

@ -17,8 +17,8 @@ VERSION = "0.0.2"
FEATURES = "flutter"
PRODUCT_NAME = "AppFlowy"
#CRATE_TYPE: https://doc.rust-lang.org/reference/linkage.html
CRATE_TYPE = "cdylib"
CRATE_TYPE = "staticlib"
SDK_EXT = "a"
[env.development-mac]
TARGET_OS = "macos"
@ -40,7 +40,6 @@ TARGET_OS = "macos"
RUST_COMPILE_TARGET = "x86_64-apple-darwin"
FLUTTER_OUTPUT_DIR = "Release"
PRODUCT_EXT = "app"
CRATE_TYPE = "staticlib"
[env.production-desktop-windows-x86]
BUILD_FLAG = "release"
@ -76,7 +75,7 @@ private = true
script = [
"""
toml = readfile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml
val = replace ${toml} "dylib" ${CRATE_TYPE}
val = replace ${toml} "cdylib" ${CRATE_TYPE}
result = writefile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml ${val}
assert ${result}
""",
@ -88,7 +87,7 @@ private = true
script = [
"""
toml = readfile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml
val = replace ${toml} ${CRATE_TYPE} "dylib"
val = replace ${toml} ${CRATE_TYPE} "cdylib"
result = writefile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml ${val}
assert ${result}
""",

View File

@ -44,9 +44,9 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/window_size/macos
SPEC CHECKSUMS:
flowy_editor: 26060a984848e6afac1f6a4455511f4114119d8d
flowy_infra_ui: 9d5021b1610fe0476eb1191bf7cd41c4a4138d8f
flowy_sdk: b7efddcc3af4ea87dc2f842c22dc37283bb9e169
flowy_editor: 0e67fc03e2a7466116f2d068b636d30d96c4f38d
flowy_infra_ui: c34d49d615ed9fe552cd47f90d7850815a74e9e9
flowy_sdk: 57c926d0979a826d6bdc6bd784b2bb7682895fe7
FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424
package_info_plus_macos: f010621b07802a241d96d01876d6705f15e77c1c
path_provider_macos: 160cab0d5461f0c0e02995469a98f24bdb9a3f1f

View File

@ -33,8 +33,8 @@ private = true
script = [
"""
echo "🚀 🚀 🚀 Flowy-SDK build success"
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${RUST_COMPILE_TARGET}/${BUILD_FLAG}/lib${CARGO_MAKE_CRATE_FS_NAME}.a \
${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/packages/flowy_sdk/macos/lib${CARGO_MAKE_CRATE_FS_NAME}.a
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${RUST_COMPILE_TARGET}/${BUILD_FLAG}/lib${CARGO_MAKE_CRATE_FS_NAME}.${SDK_EXT} \
${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/packages/flowy_sdk/macos/lib${CARGO_MAKE_CRATE_FS_NAME}.${SDK_EXT}
""",
"""
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/binding.h \