AppFlowy/scripts/makefile/desktop.toml

84 lines
2.3 KiB
TOML
Raw Normal View History

2021-06-19 15:41:19 +00:00
[tasks.desktop]
category = "Build"
dependencies = ["desktop-debug", "desktop-release", "post-desktop"]
2021-06-19 15:41:19 +00:00
description = "Build desktop targets"
[tasks.desktop-debug]
condition = { env_true = ["DEV"] }
env = { DESKTOP_TARGET = "x86_64-apple-darwin" }
private = true
run_task = { name = ["desktop-build", "post-desktop-dylib-to-system"] }
[tasks.desktop-release]
condition = { env_true = ["RELEASE"] }
env = { DESKTOP_TARGET = "x86_64-apple-darwin" }
private = true
run_task = "desktop-build"
[tasks.desktop-build]
category = "Build"
condition = { platforms = ["mac"], env_true = ["DEV"] }
dependencies = ["export-env", "setup-crate-type-macos"]
description = "Build desktop targets."
script = [
"""
cd rust-lib/
cargo build --package=dart-ffi --target ${DESKTOP_TARGET}
2021-06-19 15:41:19 +00:00
cd ../
""",
]
[tasks.post-desktop]
condition = { platforms = ["mac"] }
dependencies = ["restore-crate-type"]
script = [
"""
2021-07-21 07:43:05 +00:00
echo "🚀 🚀 🚀 Flowy-SDK build success"
2021-06-19 15:41:19 +00:00
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/x86_64-apple-darwin/${LIB_OUT_DIR}/lib${CARGO_MAKE_CRATE_FS_NAME}.dylib \
${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/packages/flowy_sdk/macos/lib${CARGO_MAKE_CRATE_FS_NAME}.dylib
2021-06-19 15:41:19 +00:00
""",
"""
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/binding.h \
${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/packages/flowy_sdk/macos/Classes/binding.h
2021-06-19 15:41:19 +00:00
""",
]
script_runner = "@duckscript"
[tasks.setup-crate-type-macos]
env = { TARGET_OS = "macos" }
private = true
run_task = "setup-crate-type"
[tasks.export-env]
script = [
"""
export MACOSX_DEPLOYMENT_TARGET=10.11
""",
]
script_runner = "@shell"
[tasks.post-desktop-dylib-to-system]
condition = { platforms = ["mac"] }
script = [
"""
target_path = set ${TMPDIR}/appflowy_client/lib${CARGO_MAKE_CRATE_FS_NAME}.dylib
2021-06-19 15:41:19 +00:00
rm ${target_path}
2021-07-20 15:51:08 +00:00
# echo "🚀 🚀 🚀 Copy Flowy-SDK to system"
2021-06-19 15:41:19 +00:00
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/x86_64-apple-darwin/${LIB_OUT_DIR}/lib${CARGO_MAKE_CRATE_FS_NAME}.dylib ${target_path}
""",
]
script_runner = "@duckscript"
[tasks.clean-flowy-sdk]
condition = { platforms = ["mac"] }
script = [
"""
cd ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/flutter-lib/packages/flowy_sdk
flutter clean
""",
]
script_runner = "@shell"