AppFlowy/scripts/makefile/flutter.toml
Alex to 5ee37972ef #19 - [FR] Successfully to build workable version for windows (Rust target: x86_64-pc-windows-msvc), request to contribute
1. scripts\flowy-tool\Cargo.toml
  - Remove shell dependency which does not support windows
2. scripts\makefile\env.toml
  - Enhance environment checking for building app on windows
3. scripts\flowy-tool\src\util\file.rs
  - Trim unnecessary prefix "\\?\" for std::fs::canonicalize(root) on windows
4.  scripts\makefile\flutter.toml
  - add dependency for "tasks.appflowy-windows" to copy dart_ffi.dll from rust build folder to flutter build folder
5. scripts\flowy-tool\src\proto\proto_gen.rs
  - Remove dir by using platform independent code rather than calling *nix shell command
6. scripts\makefile\protobuf.toml
  - tasks.gen_dart_event: call duckscript to gen_dart_event on windows platform
2021-11-17 21:45:18 +08:00

94 lines
2.1 KiB
TOML

[tasks.appflowy]
mac_alias = "appflowy-macos"
windows_alias = "appflowy-windows"
[tasks.appflowy-macos]
dependencies = ["flowy-sdk-release"]
run_task = { name = ["flutter-build", "copy-to-product"] }
script_runner = "@shell"
[tasks.appflowy-windows]
dependencies = ["flowy-sdk-release"]
run_task = { name = ["flutter-build", "copy-dll-to-build-folder", "copy-to-product"] }
[tasks.copy-to-product]
mac_alias = "copy-to-product-macos"
windows_alias = "copy-to-product-windows"
[tasks.copy-to-product-macos]
script = [
"""
product_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${VERSION}
output_path=${product_path}/${TARGET_OS}/${FLUTTER_OUTPUT_DIR}
if [ -d "${output_path}" ]; then
rm -rf ${output_path}/
fi
mkdir -p ${output_path}
product=${PRODUCT_NAME}.${PRODUCT_EXT}
cp -R ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/build/${TARGET_OS}/Build/Products/${FLUTTER_OUTPUT_DIR}/${product} \
${output_path}/${product}
""",
]
script_runner = "@shell"
[tasks.copy-dll-to-build-folder]
script = [
"""
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${RUST_COMPILE_TARGET}/${BUILD_FLAG}/${CARGO_MAKE_CRATE_FS_NAME}.${SDK_EXT} \
${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/build/${TARGET_OS}/runner/${BUILD_FLAG}/${CARGO_MAKE_CRATE_FS_NAME}.${SDK_EXT}
""",
]
script_runner = "@duckscript"
[tasks.copy-to-product-windows]
script = [
"""
# TODO:
echo TBD...
""",
]
script_runner = "@duckscript"
[tasks.flutter-build]
script = [
"""
cd app_flowy/
flutter clean
flutter pub get
flutter build ${TARGET_OS} --${BUILD_FLAG} --build-name=${VERSION}
""",
]
script_runner = "@shell"
[tasks.flutter-build.windows]
script = [
"""
cd app_flowy
exec cmd.exe /c flutter clean
exec cmd.exe /c flutter pub get
exec cmd.exe /c flutter build ${TARGET_OS} --${BUILD_FLAG}
""",
]
script_runner = "@duckscript"
[tasks.freeze_setup]
script = [
"""
flutter clean
flutter pub get
flutter pub run build_runner build --delete-conflicting-outputs
""",
]
script_runner = "@shell"
[tasks.freeze_watch]
script = [
"""
flutter pub run build_runner watch
""",
]
script_runner = "@shell"