# cargo make --profile production task [tasks.flowy-sdk] category = "Build" condition = { profiles = [ "development-mac" ], channels = ["nightly"] } dependencies = ["flowy-sdk-build"] run_task = { name = ["copy-to-sys-tmpdir"] } [tasks.flowy-sdk-build] condition = { channels = ["nightly"] } run_task = { name = ["setup-crate-type","sdk_build", "post-desktop", "restore-crate-type"] } [tasks.sdk_build] condition = { platforms = ["mac"] } description = "Build desktop targets." script = [ """ cd rust-lib/ cargo build --${BUILD_FLAG} --package=dart-ffi --target ${DESKTOP_TARGET} --features="observable","http_server" cd ../ """, ] [tasks.post-desktop] private = true condition = { platforms = ["mac"] } script = [ """ echo "🚀 🚀 🚀 Flowy-SDK build success" cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/x86_64-apple-darwin/${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 """, """ 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 """, ] script_runner = "@duckscript" [tasks.copy-to-sys-tmpdir] private = true condition = { platforms = ["mac"] } script = [ """ # post the dylib target_path that use for flutter unit test target_path = set ${TMPDIR}/appflowy_client/lib${CARGO_MAKE_CRATE_FS_NAME}.dylib rm ${target_path} cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/x86_64-apple-darwin/${BUILD_FLAG}/lib${CARGO_MAKE_CRATE_FS_NAME}.dylib ${target_path} """, ] script_runner = "@duckscript" #[tasks.export-env] #script = [ # """ # export MACOSX_DEPLOYMENT_TARGET=10.11 # """, #] #script_runner = "@shell"