2021-11-04 08:00:08 +00:00
|
|
|
# cargo make --profile production task
|
2021-06-19 15:41:19 +00:00
|
|
|
|
2021-11-17 06:17:46 +00:00
|
|
|
# Run the task with profile, e.g.
|
|
|
|
# cargo make --profile development-mac flowy-sdk-dev
|
2021-11-23 09:45:18 +00:00
|
|
|
# cargo make --profile production-windows-x86 flowy-sdk-dev
|
2021-06-19 15:41:19 +00:00
|
|
|
|
2021-11-17 06:17:46 +00:00
|
|
|
[tasks.env_check]
|
2022-02-08 17:14:54 +00:00
|
|
|
dependencies = ["echo_env", "install_protobuf"]
|
2022-01-23 03:34:41 +00:00
|
|
|
condition = { env_set = [ "BUILD_FLAG", "RUST_COMPILE_TARGET", "CRATE_TYPE", "TARGET_OS"], channels = ["stable"] }
|
2021-11-17 06:17:46 +00:00
|
|
|
|
|
|
|
[tasks.flowy-sdk-dev]
|
|
|
|
mac_alias = "flowy-sdk-dev-macos"
|
|
|
|
windows_alias = "flowy-sdk-dev-windows"
|
2021-11-19 03:13:07 +00:00
|
|
|
linux_alias = "flowy-sdk-dev-linux"
|
2021-11-17 06:17:46 +00:00
|
|
|
|
|
|
|
[tasks.flowy-sdk-dev-macos]
|
|
|
|
category = "Build"
|
|
|
|
dependencies = ["env_check"]
|
|
|
|
run_task = { name = ["setup-crate-type","sdk-build", "post-desktop", "restore-crate-type"] }
|
|
|
|
|
|
|
|
[tasks.flowy-sdk-dev-windows]
|
|
|
|
category = "Build"
|
|
|
|
dependencies = ["env_check"]
|
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-19 03:13:07 +00:00
|
|
|
[tasks.flowy-sdk-dev-linux]
|
|
|
|
category = "Build"
|
|
|
|
dependencies = ["env_check"]
|
|
|
|
run_task = { name = ["setup-crate-type","sdk-build", "post-desktop", "restore-crate-type"] }
|
|
|
|
|
2021-11-17 06:17:46 +00:00
|
|
|
#
|
2021-11-04 14:13:05 +00:00
|
|
|
[tasks.sdk-build]
|
2021-11-17 06:17:46 +00:00
|
|
|
private = true
|
2021-06-19 15:41:19 +00:00
|
|
|
script = [
|
|
|
|
"""
|
|
|
|
cd rust-lib/
|
2022-02-07 06:40:45 +00:00
|
|
|
rustup show
|
2021-12-05 08:39:41 +00:00
|
|
|
echo cargo build --package=dart-ffi --target ${RUST_COMPILE_TARGET} --features "${FEATURES}"
|
|
|
|
cargo build --package=dart-ffi --target ${RUST_COMPILE_TARGET} --features "${FEATURES}"
|
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-23 00:28:59 +00:00
|
|
|
[tasks.sdk-build.windows]
|
|
|
|
private = true
|
|
|
|
script = [
|
|
|
|
"""
|
|
|
|
cd rust-lib
|
2021-12-05 08:39:41 +00:00
|
|
|
exec cargo build --package=dart-ffi --target ${RUST_COMPILE_TARGET} --features "${FEATURES}"
|
2021-11-23 00:28:59 +00:00
|
|
|
cd ..
|
|
|
|
""",
|
|
|
|
]
|
|
|
|
script_runner = "@duckscript"
|
|
|
|
|
2021-11-17 06:17:46 +00:00
|
|
|
#
|
|
|
|
[tasks.flowy-sdk-release]
|
|
|
|
description = "Build flowy sdk in release mode"
|
|
|
|
category = "Build"
|
|
|
|
dependencies = ["env_check"]
|
|
|
|
run_task = { name = ["setup-crate-type","sdk-release-build", "post-desktop", "restore-crate-type"] }
|
2021-11-04 14:13:05 +00:00
|
|
|
|
2021-11-17 06:17:46 +00:00
|
|
|
#
|
|
|
|
[tasks.sdk-release-build]
|
|
|
|
script = [
|
|
|
|
"""
|
|
|
|
cd rust-lib/
|
2021-12-05 08:39:41 +00:00
|
|
|
cargo build --${BUILD_FLAG} --package=dart-ffi --target ${RUST_COMPILE_TARGET} --features "${FEATURES}"
|
2021-11-17 06:17:46 +00:00
|
|
|
cd ../
|
|
|
|
""",
|
|
|
|
]
|
|
|
|
script_runner = "@shell"
|
|
|
|
|
|
|
|
#
|
2021-06-19 15:41:19 +00:00
|
|
|
[tasks.post-desktop]
|
2021-11-17 06:17:46 +00:00
|
|
|
mac_alias = "post-desktop-macos"
|
|
|
|
windows_alias = "post-desktop-windows"
|
2021-11-19 03:13:07 +00:00
|
|
|
linux_alias = "post-desktop-linux"
|
2021-11-17 06:17:46 +00:00
|
|
|
|
|
|
|
[tasks.post-desktop-macos]
|
2021-11-04 10:03:36 +00:00
|
|
|
private = true
|
2021-06-19 15:41:19 +00:00
|
|
|
script = [
|
|
|
|
"""
|
2021-11-17 06:17:46 +00:00
|
|
|
echo "🚀 🚀 🚀 Flowy-SDK(macOS) build success"
|
2021-11-20 01:32:46 +00:00
|
|
|
|
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} \
|
2021-11-17 06:17:46 +00:00
|
|
|
${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/packages/flowy_sdk/${TARGET_OS}/lib${CARGO_MAKE_CRATE_FS_NAME}.${SDK_EXT}
|
|
|
|
|
|
|
|
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/binding.h \
|
|
|
|
${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/packages/flowy_sdk/${TARGET_OS}/Classes/binding.h
|
2021-06-19 15:41:19 +00:00
|
|
|
""",
|
2021-11-17 06:17:46 +00:00
|
|
|
]
|
|
|
|
script_runner = "@duckscript"
|
|
|
|
|
|
|
|
|
|
|
|
[tasks.post-desktop-windows]
|
|
|
|
private = true
|
|
|
|
script = [
|
2021-06-19 15:41:19 +00:00
|
|
|
"""
|
2021-11-17 06:17:46 +00:00
|
|
|
echo "🚀 🚀 🚀 Flowy-SDK(windows) build success"
|
2021-11-18 08:18:20 +00:00
|
|
|
dart_ffi_dir= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/windows/flutter/dart_ffi
|
|
|
|
|
|
|
|
# copy dll
|
2021-11-17 06:17:46 +00:00
|
|
|
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${RUST_COMPILE_TARGET}/${BUILD_FLAG}/${CARGO_MAKE_CRATE_FS_NAME}.${SDK_EXT} \
|
2021-11-18 08:18:20 +00:00
|
|
|
${dart_ffi_dir}/${CARGO_MAKE_CRATE_FS_NAME}.${SDK_EXT}
|
2021-11-17 06:17:46 +00:00
|
|
|
|
2021-11-18 08:18:20 +00:00
|
|
|
# copy binding.h
|
2021-06-19 15:41:19 +00:00
|
|
|
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/binding.h \
|
2021-11-18 08:18:20 +00:00
|
|
|
${dart_ffi_dir}/binding.h
|
2021-06-19 15:41:19 +00:00
|
|
|
""",
|
2021-11-04 10:03:36 +00:00
|
|
|
]
|
|
|
|
script_runner = "@duckscript"
|
|
|
|
|
2021-11-19 03:13:07 +00:00
|
|
|
[tasks.post-desktop-linux]
|
|
|
|
private = true
|
|
|
|
script = [
|
|
|
|
"""
|
|
|
|
echo "🚀 🚀 🚀 Flowy-SDK(linux) build success"
|
|
|
|
dart_ffi_dir= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/linux/flutter/dart_ffi
|
|
|
|
|
|
|
|
# copy dll
|
|
|
|
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${RUST_COMPILE_TARGET}/${BUILD_FLAG}/lib${CARGO_MAKE_CRATE_FS_NAME}.${SDK_EXT} \
|
|
|
|
${dart_ffi_dir}/lib${CARGO_MAKE_CRATE_FS_NAME}.${SDK_EXT}
|
|
|
|
|
|
|
|
# copy binding.h
|
|
|
|
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/binding.h \
|
|
|
|
${dart_ffi_dir}/binding.h
|
|
|
|
""",
|
|
|
|
]
|
|
|
|
script_runner = "@duckscript"
|
|
|
|
|
2021-11-17 06:17:46 +00:00
|
|
|
#
|
2021-11-04 10:03:36 +00:00
|
|
|
[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
|
2021-11-16 05:40:45 +00:00
|
|
|
target_path = set ${TMPDIR}/appflowy/lib${CARGO_MAKE_CRATE_FS_NAME}.${SDK_EXT}
|
2021-06-19 15:41:19 +00:00
|
|
|
rm ${target_path}
|
2021-11-16 05:40:45 +00:00
|
|
|
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${RUST_COMPILE_TARGET}/${BUILD_FLAG}/lib${CARGO_MAKE_CRATE_FS_NAME}.${SDK_EXT} ${target_path}
|
2021-06-19 15:41:19 +00:00
|
|
|
""",
|
|
|
|
]
|
|
|
|
script_runner = "@duckscript"
|
2022-02-08 14:42:00 +00:00
|
|
|
|
|
|
|
[tasks.check_protoc_cmd]
|
|
|
|
script = [
|
|
|
|
"""
|
|
|
|
ret = which protoc
|
|
|
|
if is_empty ${ret}
|
|
|
|
echo Please make sure <protoc_installation_folder>/bin/ is in PATH env var
|
|
|
|
echo See BUILD_ON_{LINUX|WINDOWS}.md for how to get protoc
|
|
|
|
exit -1
|
|
|
|
end
|
|
|
|
""",
|
|
|
|
]
|
|
|
|
script_runner = "@duckscript"
|