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.
|
2022-11-26 14:18:39 +00:00
|
|
|
# cargo make --profile development-mac appflowy-sdk-dev
|
|
|
|
# cargo make --profile production-windows-x86 appflowy-sdk-dev
|
2021-06-19 15:41:19 +00:00
|
|
|
|
2021-11-17 06:17:46 +00:00
|
|
|
[tasks.env_check]
|
2023-01-17 08:27:17 +00:00
|
|
|
dependencies = ["echo_env", "install_flutter_protobuf"]
|
2023-01-01 15:26:27 +00:00
|
|
|
condition = { env_set = [
|
|
|
|
"BUILD_FLAG",
|
|
|
|
"RUST_COMPILE_TARGET",
|
|
|
|
"CRATE_TYPE",
|
|
|
|
"TARGET_OS",
|
|
|
|
], channels = [
|
|
|
|
"stable",
|
|
|
|
] }
|
2021-11-17 06:17:46 +00:00
|
|
|
|
2022-11-26 14:18:39 +00:00
|
|
|
[tasks.appflowy-sdk-dev]
|
|
|
|
mac_alias = "appflowy-sdk-dev-macos"
|
|
|
|
windows_alias = "appflowy-sdk-dev-windows"
|
|
|
|
linux_alias = "appflowy-sdk-dev-linux"
|
2021-11-17 06:17:46 +00:00
|
|
|
|
2022-11-26 14:18:39 +00:00
|
|
|
[tasks.appflowy-sdk-dev-android]
|
2022-09-01 04:27:09 +00:00
|
|
|
category = "Build"
|
|
|
|
dependencies = ["env_check"]
|
2023-01-01 15:26:27 +00:00
|
|
|
run_task = { name = [
|
|
|
|
"setup-crate-type",
|
|
|
|
"sdk-build-android",
|
|
|
|
"restore-crate-type",
|
|
|
|
] }
|
2022-09-01 04:27:09 +00:00
|
|
|
|
2022-11-26 14:18:39 +00:00
|
|
|
[tasks.appflowy-sdk-dev-macos]
|
2021-11-17 06:17:46 +00:00
|
|
|
category = "Build"
|
|
|
|
dependencies = ["env_check"]
|
2023-01-01 15:26:27 +00:00
|
|
|
run_task = { name = [
|
|
|
|
"setup-crate-type",
|
|
|
|
"sdk-build",
|
|
|
|
"post-desktop",
|
|
|
|
"restore-crate-type",
|
|
|
|
] }
|
2021-11-17 06:17:46 +00:00
|
|
|
|
2022-11-26 14:18:39 +00:00
|
|
|
[tasks.appflowy-sdk-dev-windows]
|
2021-11-17 06:17:46 +00:00
|
|
|
category = "Build"
|
|
|
|
dependencies = ["env_check"]
|
2023-01-01 15:26:27 +00:00
|
|
|
run_task = { name = [
|
|
|
|
"setup-crate-type",
|
|
|
|
"sdk-build",
|
|
|
|
"post-desktop",
|
|
|
|
"restore-crate-type",
|
|
|
|
] }
|
2021-07-25 03:08:59 +00:00
|
|
|
|
2022-11-26 14:18:39 +00:00
|
|
|
[tasks.appflowy-sdk-dev-linux]
|
2021-11-19 03:13:07 +00:00
|
|
|
category = "Build"
|
|
|
|
dependencies = ["env_check"]
|
2023-01-01 15:26:27 +00:00
|
|
|
run_task = { name = [
|
|
|
|
"setup-crate-type",
|
|
|
|
"sdk-build",
|
|
|
|
"post-desktop",
|
|
|
|
"restore-crate-type",
|
|
|
|
] }
|
2022-10-15 15:34:56 +00:00
|
|
|
|
2021-11-19 03:13:07 +00:00
|
|
|
|
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
|
2023-01-12 05:09:08 +00:00
|
|
|
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
|
|
|
|
2022-09-01 04:27:09 +00:00
|
|
|
[tasks.sdk-build-android]
|
|
|
|
private = true
|
|
|
|
script = [
|
|
|
|
"""
|
|
|
|
cd rust-lib/
|
|
|
|
rustup show
|
|
|
|
rustup target add aarch64-linux-android \
|
|
|
|
armv7-linux-androideabi \
|
|
|
|
i686-linux-android \
|
|
|
|
x86_64-linux-android
|
|
|
|
DEST=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/android/app/src/main/jniLibs
|
|
|
|
rm -rf $DEST/arm64-v8a \
|
|
|
|
$DEST/armeabi-v7a \
|
|
|
|
$DEST/x86 \
|
|
|
|
$DEST/x86_64
|
|
|
|
cargo ndk \
|
|
|
|
-t arm64-v8a \
|
|
|
|
-t armeabi-v7a \
|
|
|
|
-t x86 \
|
|
|
|
-t x86_64 \
|
|
|
|
-o $DEST build
|
|
|
|
cd ../
|
|
|
|
""",
|
|
|
|
]
|
|
|
|
script_runner = "@shell"
|
|
|
|
|
2021-11-23 00:28:59 +00:00
|
|
|
[tasks.sdk-build.windows]
|
|
|
|
private = true
|
|
|
|
script = [
|
|
|
|
"""
|
|
|
|
cd rust-lib
|
2023-01-12 05:09:08 +00:00
|
|
|
exec cargo build --package=dart-ffi --target ${RUST_COMPILE_TARGET} --features "${FLUTTER_DESKTOP_FEATURES}"
|
2021-11-23 00:28:59 +00:00
|
|
|
cd ..
|
|
|
|
""",
|
|
|
|
]
|
|
|
|
script_runner = "@duckscript"
|
|
|
|
|
2021-11-17 06:17:46 +00:00
|
|
|
#
|
2022-11-26 14:18:39 +00:00
|
|
|
[tasks.appflowy-sdk-release]
|
2021-11-17 06:17:46 +00:00
|
|
|
description = "Build flowy sdk in release mode"
|
|
|
|
category = "Build"
|
|
|
|
dependencies = ["env_check"]
|
2023-01-01 15:26:27 +00:00
|
|
|
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/
|
2023-01-12 05:09:08 +00:00
|
|
|
cargo build --${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"
|
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"
|
2023-01-08 04:10:53 +00:00
|
|
|
dart_ffi_dir= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/packages/appflowy_backend/${TARGET_OS}
|
2022-10-15 15:34:56 +00:00
|
|
|
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
|
|
|
"""
|
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
|
2022-10-15 15:34:56 +00:00
|
|
|
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
|
|
|
""",
|
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
|
2022-10-15 15:34:56 +00:00
|
|
|
lib = set lib${LIB_NAME}.${LIB_EXT}
|
2021-11-19 03:13:07 +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-19 03:13:07 +00:00
|
|
|
|
|
|
|
# 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"
|
|
|
|
|
2022-10-22 12:58:33 +00:00
|
|
|
[tasks.build-test-lib]
|
2022-10-15 15:34:56 +00:00
|
|
|
category = "Build"
|
|
|
|
dependencies = ["env_check"]
|
2023-01-01 15:26:27 +00:00
|
|
|
run_task = { name = [
|
|
|
|
"setup-test-crate-type",
|
|
|
|
"build-test-backend",
|
|
|
|
"copy-to-sandbox-folder",
|
|
|
|
"restore-test-crate-type",
|
|
|
|
] }
|
2022-10-15 15:34:56 +00:00
|
|
|
|
2022-10-22 12:58:33 +00:00
|
|
|
[tasks.build-test-backend]
|
2023-01-01 15:26:27 +00:00
|
|
|
mac_alias = "build-test-backend-default"
|
|
|
|
windows_alias = "build-test-backend-widnows"
|
|
|
|
linux_alias = "build-test-backend-default"
|
|
|
|
|
|
|
|
[tasks.build-test-backend-default]
|
2021-11-04 10:03:36 +00:00
|
|
|
private = true
|
|
|
|
script = [
|
2021-06-19 15:41:19 +00:00
|
|
|
"""
|
2022-10-15 15:34:56 +00:00
|
|
|
cd rust-lib/
|
|
|
|
rustup show
|
2023-01-12 05:09:08 +00:00
|
|
|
echo cargo build --package=dart-ffi --target ${TEST_COMPILE_TARGET} --features "${FLUTTER_DESKTOP_FEATURES}"
|
|
|
|
RUST_LOG=${RUST_LOG} cargo build --package=dart-ffi --target ${TEST_COMPILE_TARGET} --features "${FLUTTER_DESKTOP_FEATURES}"
|
2022-10-15 15:34:56 +00:00
|
|
|
cd ../
|
2021-06-19 15:41:19 +00:00
|
|
|
""",
|
|
|
|
]
|
2022-10-15 15:34:56 +00:00
|
|
|
script_runner = "@shell"
|
2022-02-08 14:42:00 +00:00
|
|
|
|
2023-01-01 15:26:27 +00:00
|
|
|
[tasks.build-test-backend-widnows]
|
|
|
|
private = true
|
|
|
|
script = [
|
|
|
|
"""
|
|
|
|
cd rust-lib/
|
|
|
|
rustup show
|
2023-01-12 05:09:08 +00:00
|
|
|
echo cargo build --package=dart-ffi --target ${TEST_COMPILE_TARGET} --features "${FLUTTER_DESKTOP_FEATURES}"
|
2023-01-17 13:54:25 +00:00
|
|
|
RUST_LOG=${TEST_RUST_LOG} cargo build --package=dart-ffi --target ${TEST_COMPILE_TARGET} --features "${FLUTTER_DESKTOP_FEATURES}"
|
2023-01-01 15:26:27 +00:00
|
|
|
cd ../
|
|
|
|
""",
|
|
|
|
]
|
|
|
|
script_runner = "@shell"
|
|
|
|
|
2022-10-15 15:34:56 +00:00
|
|
|
[tasks.copy-to-sandbox-folder]
|
2023-01-01 15:26:27 +00:00
|
|
|
mac_alias = "copy-to-sandbox-folder-default"
|
|
|
|
windows_alias = "copy-to-sandbox-folder-windows"
|
|
|
|
linux_alias = "copy-to-sandbox-folder-default"
|
|
|
|
|
|
|
|
[tasks.copy-to-sandbox-folder-windows]
|
|
|
|
private = true
|
|
|
|
script = [
|
|
|
|
"""
|
2023-01-08 04:10:53 +00:00
|
|
|
# Copy the appflowy_backend lib to system temp directory for flutter unit test.
|
2023-01-01 15:26:27 +00:00
|
|
|
lib = set ${LIB_NAME}.${TEST_LIB_EXT}
|
|
|
|
dest = set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/.sandbox/${lib}
|
|
|
|
rm ${dest}
|
|
|
|
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${TEST_COMPILE_TARGET}/${TEST_BUILD_FLAG}/${lib} \
|
|
|
|
${dest}
|
|
|
|
""",
|
|
|
|
]
|
|
|
|
script_runner = "@duckscript"
|
|
|
|
|
|
|
|
[tasks.copy-to-sandbox-folder-default]
|
2022-02-19 08:48:57 +00:00
|
|
|
private = true
|
2022-02-08 14:42:00 +00:00
|
|
|
script = [
|
|
|
|
"""
|
2023-01-08 04:10:53 +00:00
|
|
|
# Copy the appflowy_backend lib to system temp directory for flutter unit test.
|
2022-10-15 15:34:56 +00:00
|
|
|
lib = set lib${LIB_NAME}.${TEST_LIB_EXT}
|
|
|
|
dest = set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/.sandbox/${lib}
|
|
|
|
rm ${dest}
|
|
|
|
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${TEST_COMPILE_TARGET}/${TEST_BUILD_FLAG}/${lib} \
|
|
|
|
${dest}
|
2022-02-08 14:42:00 +00:00
|
|
|
""",
|
|
|
|
]
|
2022-10-15 15:34:56 +00:00
|
|
|
script_runner = "@duckscript"
|