flutter.toml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. [tasks.appflowy]
  2. mac_alias = "appflowy-macos"
  3. windows_alias = "appflowy-windows"
  4. [tasks.appflowy-macos]
  5. dependencies = ["flowy-sdk-release"]
  6. run_task = { name = ["flutter-build", "copy-to-product"] }
  7. script_runner = "@shell"
  8. [tasks.appflowy-windows]
  9. dependencies = ["flowy-sdk-release"]
  10. run_task = { name = ["flutter-build", "copy-dll-to-build-folder", "copy-to-product"] }
  11. [tasks.copy-to-product]
  12. mac_alias = "copy-to-product-macos"
  13. windows_alias = "copy-to-product-windows"
  14. [tasks.copy-to-product-macos]
  15. script = [
  16. """
  17. product_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${VERSION}
  18. output_path=${product_path}/${TARGET_OS}/${FLUTTER_OUTPUT_DIR}
  19. if [ -d "${output_path}" ]; then
  20. rm -rf ${output_path}/
  21. fi
  22. mkdir -p ${output_path}
  23. product=${PRODUCT_NAME}.${PRODUCT_EXT}
  24. cp -R ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/build/${TARGET_OS}/Build/Products/${FLUTTER_OUTPUT_DIR}/${product} \
  25. ${output_path}/${product}
  26. """,
  27. ]
  28. script_runner = "@shell"
  29. [tasks.copy-dll-to-build-folder]
  30. script = [
  31. """
  32. cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${RUST_COMPILE_TARGET}/${BUILD_FLAG}/${CARGO_MAKE_CRATE_FS_NAME}.${SDK_EXT} \
  33. ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/build/${TARGET_OS}/runner/${BUILD_FLAG}/${CARGO_MAKE_CRATE_FS_NAME}.${SDK_EXT}
  34. """,
  35. ]
  36. script_runner = "@duckscript"
  37. [tasks.copy-to-product-windows]
  38. script = [
  39. """
  40. # TODO:
  41. echo TBD...
  42. """,
  43. ]
  44. script_runner = "@duckscript"
  45. [tasks.flutter-build]
  46. script = [
  47. """
  48. cd app_flowy/
  49. flutter clean
  50. flutter pub get
  51. flutter build ${TARGET_OS} --${BUILD_FLAG} --build-name=${VERSION}
  52. """,
  53. ]
  54. script_runner = "@shell"
  55. [tasks.flutter-build.windows]
  56. script = [
  57. """
  58. cd app_flowy
  59. exec cmd.exe /c flutter clean
  60. exec cmd.exe /c flutter pub get
  61. exec cmd.exe /c flutter build ${TARGET_OS} --${BUILD_FLAG}
  62. """,
  63. ]
  64. script_runner = "@duckscript"
  65. [tasks.freeze_setup]
  66. script = [
  67. """
  68. flutter clean
  69. flutter pub get
  70. flutter pub run build_runner build --delete-conflicting-outputs
  71. """,
  72. ]
  73. script_runner = "@shell"
  74. [tasks.freeze_watch]
  75. script = [
  76. """
  77. flutter pub run build_runner watch
  78. """,
  79. ]
  80. script_runner = "@shell"