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"] }
|
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 10:03:36 +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 08:43:12 +00:00
|
|
|
[tasks.sdk_build]
|
2021-11-04 10:03:36 +00:00
|
|
|
condition = { platforms = ["mac"] }
|
2021-06-19 15:41:19 +00:00
|
|
|
description = "Build desktop targets."
|
|
|
|
script = [
|
|
|
|
"""
|
|
|
|
cd rust-lib/
|
2021-11-04 10:03:36 +00:00
|
|
|
cargo build --${BUILD_FLAG} --package=dart-ffi --target ${DESKTOP_TARGET} --features="observable","http_server"
|
2021-06-19 15:41:19 +00:00
|
|
|
cd ../
|
|
|
|
""",
|
|
|
|
]
|
|
|
|
|
|
|
|
[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-04 10:03:36 +00:00
|
|
|
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/x86_64-apple-darwin/${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
|
|
|
|
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-04 10:03:36 +00:00
|
|
|
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/x86_64-apple-darwin/${BUILD_FLAG}/lib${CARGO_MAKE_CRATE_FS_NAME}.dylib ${target_path}
|
2021-06-19 15:41:19 +00:00
|
|
|
""",
|
|
|
|
]
|
|
|
|
script_runner = "@duckscript"
|
|
|
|
|
2021-11-04 08:00:08 +00:00
|
|
|
#[tasks.export-env]
|
|
|
|
#script = [
|
|
|
|
# """
|
|
|
|
# export MACOSX_DEPLOYMENT_TARGET=10.11
|
|
|
|
# """,
|
|
|
|
#]
|
|
|
|
#script_runner = "@shell"
|
2021-06-19 15:41:19 +00:00
|
|
|
|