AppFlowy/frontend/scripts/makefile/desktop.toml

169 lines
4.3 KiB
TOML
Raw Normal View History

2021-06-19 15:41:19 +00:00
2021-11-17 06:17:46 +00:00
[tasks.env_check]
dependencies = ["echo_env", "install_flutter_protobuf"]
condition = { env_set = [
"BUILD_FLAG",
"RUST_COMPILE_TARGET",
"CRATE_TYPE",
"TARGET_OS",
], channels = [
"stable",
] }
2021-11-17 06:17:46 +00:00
[tasks.appflowy-core-dev]
mac_alias = "appflowy-core-dev-macos"
windows_alias = "appflowy-core-dev-windows"
linux_alias = "appflowy-core-dev-linux"
2021-11-17 06:17:46 +00:00
[tasks.appflowy-core-dev-macos]
2021-11-17 06:17:46 +00:00
category = "Build"
dependencies = ["env_check"]
run_task = { name = [
"setup-crate-type",
"sdk-dev-build",
"post-desktop",
"restore-crate-type",
] }
2021-11-17 06:17:46 +00:00
[tasks.appflowy-core-dev-windows]
2021-11-17 06:17:46 +00:00
category = "Build"
dependencies = ["env_check"]
run_task = { name = [
"setup-crate-type",
"sdk-dev-build",
"post-desktop",
"restore-crate-type",
] }
[tasks.appflowy-core-dev-linux]
category = "Build"
dependencies = ["env_check"]
run_task = { name = [
"setup-crate-type",
"sdk-dev-build",
"post-desktop",
"restore-crate-type",
] }
2021-11-17 06:17:46 +00:00
#
[tasks.sdk-dev-build]
2021-11-17 06:17:46 +00:00
private = true
2021-06-19 15:41:19 +00:00
script = [
"""
cd rust-lib/
rustup show
echo cargo build --package=dart-ffi --target ${RUST_COMPILE_TARGET} --features "${FLUTTER_DESKTOP_FEATURES}"
cargo build --package=dart-ffi --target ${RUST_COMPILE_TARGET} --features "${FLUTTER_DESKTOP_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
[tasks.sdk-dev-build.mac]
private = true
script = [
"""
cd rust-lib/
rustup show
echo RUSTFLAGS="-C target-cpu=native -C link-arg=-mmacosx-version-min=11.0" cargo build --package=dart-ffi --target ${RUST_COMPILE_TARGET} --features "${FLUTTER_DESKTOP_FEATURES}"
RUSTFLAGS="--cfg tokio_unstable" cargo build --package=dart-ffi --target ${RUST_COMPILE_TARGET} --features "${FLUTTER_DESKTOP_FEATURES}"
cd ../
""",
]
script_runner = "@shell"
[tasks.sdk-dev-build.windows]
private = true
script = [
"""
cd rust-lib
exec cargo build --package=dart-ffi --target ${RUST_COMPILE_TARGET} --features "${FLUTTER_DESKTOP_FEATURES}"
cd ..
""",
]
script_runner = "@duckscript"
2021-11-17 06:17:46 +00:00
#
[tasks.appflowy-core-release]
2021-11-17 06:17:46 +00:00
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/
cargo build --profile ${CARGO_PROFILE} --${BUILD_FLAG} --package=dart-ffi --target ${RUST_COMPILE_TARGET} --features "${FLUTTER_DESKTOP_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"
linux_alias = "post-desktop-linux"
2021-11-17 06:17:46 +00:00
[tasks.post-desktop-macos]
private = true
2021-06-19 15:41:19 +00:00
script = [
"""
echo "🚀 🚀 🚀 AppFlowy-Core build success"
dart_ffi_dir= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/packages/appflowy_backend/${TARGET_OS}
lib = set lib${LIB_NAME}.${LIB_EXT}
2021-11-20 01:32:46 +00:00
2022-02-19 08:48:57 +00:00
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${RUST_COMPILE_TARGET}/${BUILD_FLAG}/${lib} \
${dart_ffi_dir}/${lib}
2021-11-17 06:17:46 +00:00
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/binding.h \
2022-02-19 08:48:57 +00:00
${dart_ffi_dir}/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
"""
echo "🚀 🚀 🚀 AppFlowy-Core build success"
dart_ffi_dir= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/windows/flutter/dart_ffi
lib = set ${LIB_NAME}.${LIB_EXT}
2021-11-18 08:18:20 +00:00
# copy dll
2022-02-19 08:48:57 +00:00
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${RUST_COMPILE_TARGET}/${BUILD_FLAG}/${lib} \
${dart_ffi_dir}/${lib}
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
""",
]
script_runner = "@duckscript"
[tasks.post-desktop-linux]
private = true
script = [
"""
echo "🚀 🚀 🚀 AppFlowy-Core build success"
dart_ffi_dir= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/linux/flutter/dart_ffi
lib = set lib${LIB_NAME}.${LIB_EXT}
# copy dll
2022-02-19 08:48:57 +00:00
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${RUST_COMPILE_TARGET}/${BUILD_FLAG}/${lib} \
${dart_ffi_dir}/${lib}
# 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"