AppFlowy/scripts/makefile/desktop.toml

59 lines
1.8 KiB
TOML
Raw Normal View History

2021-11-04 08:00:08 +00:00
# cargo make --profile production task
2021-06-19 15:41:19 +00:00
2021-11-04 08:43:12 +00:00
[tasks.flowy-sdk]
2021-06-19 15:41:19 +00:00
category = "Build"
2021-11-04 08:00:08 +00:00
condition = { profiles = [ "development-mac" ], channels = ["nightly"] }
dependencies = ["flowy-sdk-build"]
run_task = { name = ["copy-to-sys-tmpdir"] }
2021-06-19 15:41:19 +00:00
[tasks.flowy-sdk-build]
2021-11-04 08:00:08 +00:00
condition = { channels = ["nightly"] }
2021-11-04 14:13:05 +00:00
run_task = { name = ["setup-crate-type","sdk-build", "post-desktop", "restore-crate-type"] }
2021-11-04 14:13:05 +00:00
[tasks.sdk-build]
condition = { platforms = ["mac"] }
2021-06-19 15:41:19 +00:00
description = "Build desktop targets."
script = [
"""
cd rust-lib/
2021-11-04 14:13:05 +00:00
if [ ${PROD} == true ]
then
2021-11-13 07:20:17 +00:00
cargo build --${BUILD_FLAG} --package=dart-ffi --target ${DEPLOY_TARGET} --features=${FEATURES}
2021-11-04 14:13:05 +00:00
else
2021-11-13 07:20:17 +00:00
cargo build --package=dart-ffi --target ${DEPLOY_TARGET} --features=${FEATURES}
2021-11-04 14:13:05 +00:00
fi
2021-06-19 15:41:19 +00:00
cd ../
""",
]
2021-11-04 14:13:05 +00:00
2021-06-19 15:41:19 +00:00
[tasks.post-desktop]
private = true
2021-06-19 15:41:19 +00:00
condition = { platforms = ["mac"] }
script = [
"""
2021-07-21 07:43:05 +00:00
echo "🚀 🚀 🚀 Flowy-SDK build success"
2021-11-13 07:20:17 +00:00
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${DEPLOY_TARGET}/${BUILD_FLAG}/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.copy-to-sys-tmpdir]
private = true
condition = { platforms = ["mac"] }
script = [
2021-06-19 15:41:19 +00:00
"""
2021-11-04 08:00:08 +00:00
# post the dylib target_path that use for flutter unit test
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-11-13 07:20:17 +00:00
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${DEPLOY_TARGET}/${BUILD_FLAG}/lib${CARGO_MAKE_CRATE_FS_NAME}.dylib ${target_path}
2021-06-19 15:41:19 +00:00
""",
]
script_runner = "@duckscript"