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"] }
|
2021-11-04 10:03:36 +00:00
|
|
|
dependencies = ["flowy-sdk-build"]
|
|
|
|
run_task = { name = ["copy-to-sys-tmpdir"] }
|
2021-06-19 15:41:19 +00:00
|
|
|
|
2021-11-04 10:03:36 +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-07-25 03:08:59 +00:00
|
|
|
|
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-04 14:13:05 +00:00
|
|
|
if [ ${PROD} == true ]
|
|
|
|
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]
|
2021-11-04 10:03:36 +00:00
|
|
|
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-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 \
|
2021-06-28 14:56:15 +00:00
|
|
|
${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 \
|
2021-06-28 14:56:15 +00:00
|
|
|
${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/packages/flowy_sdk/macos/Classes/binding.h
|
2021-06-19 15:41:19 +00:00
|
|
|
""",
|
2021-11-04 10:03:36 +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"] }
|
2021-11-04 10:03:36 +00:00
|
|
|
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"
|
|
|
|
|