AppFlowy/scripts/makefile/desktop.toml

59 lines
1.9 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-14 12:17:31 +00:00
condition = { 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]
dependencies = ["echo_env"]
2021-11-15 07:53:08 +00:00
condition = { env_set = [ "BUILD_FLAG", "RUST_COMPILE_TARGET", "CRATE_TYPE", "TARGET_OS"] }
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]
2021-06-19 15:41:19 +00:00
description = "Build desktop targets."
script = [
"""
cd rust-lib/
2021-11-15 07:53:08 +00:00
if [ ${BUILD_FLAG} == release ]
2021-11-04 14:13:05 +00:00
then
2021-11-14 14:46:59 +00:00
cargo build --${BUILD_FLAG} --package=dart-ffi --target ${RUST_COMPILE_TARGET} --features=${FEATURES}
2021-11-04 14:13:05 +00:00
else
2021-11-14 14:46:59 +00:00
cargo build --package=dart-ffi --target ${RUST_COMPILE_TARGET} --features=${FEATURES}
2021-11-04 14:13:05 +00:00
fi
2021-06-19 15:41:19 +00:00
cd ../
""",
]
2021-11-14 14:46:59 +00:00
script_runner = "@shell"
2021-06-19 15:41:19 +00:00
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
script = [
"""
2021-07-21 07:43:05 +00:00
echo "🚀 🚀 🚀 Flowy-SDK build success"
2021-11-15 13:47:51 +00:00
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}
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
2021-11-14 12:17:31 +00:00
condition = { profiles = [ "development-mac" ], 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-14 14:46:59 +00:00
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${RUST_COMPILE_TARGET}/${BUILD_FLAG}/lib${CARGO_MAKE_CRATE_FS_NAME}.dylib ${target_path}
2021-06-19 15:41:19 +00:00
""",
]
script_runner = "@duckscript"