flutter.toml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. [tasks.appflowy]
  2. mac_alias = "appflowy-macos"
  3. windows_alias = "appflowy-windows"
  4. linux_alias = "appflowy-linux"
  5. [tasks.appflowy-macos]
  6. dependencies = ["flowy-sdk-release"]
  7. run_task = { name = ["flutter-build", "copy-to-product"] }
  8. script_runner = "@shell"
  9. [tasks.appflowy-windows]
  10. dependencies = ["flowy-sdk-release"]
  11. run_task = { name = ["flutter-build", "copy-to-product"] }
  12. [tasks.appflowy-linux]
  13. dependencies = ["flowy-sdk-release"]
  14. run_task = { name = ["flutter-build", "copy-to-product"] }
  15. script_runner = "@shell"
  16. [tasks.copy-to-product]
  17. mac_alias = "copy-to-product-macos"
  18. windows_alias = "copy-to-product-windows"
  19. linux_alias = "copy-to-product-linux"
  20. [tasks.copy-to-product-macos]
  21. script = [
  22. """
  23. product_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${VERSION}
  24. output_path=${product_path}/${TARGET_OS}/${FLUTTER_OUTPUT_DIR}
  25. if [ -d "${output_path}" ]; then
  26. rm -rf ${output_path}/
  27. fi
  28. mkdir -p ${output_path}
  29. product=${PRODUCT_NAME}.${PRODUCT_EXT}
  30. cp -R ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/build/${TARGET_OS}/Build/Products/${FLUTTER_OUTPUT_DIR}/${product} \
  31. ${output_path}/${product}
  32. """,
  33. ]
  34. script_runner = "@shell"
  35. [tasks.copy-to-product-linux]
  36. script = [
  37. """
  38. product_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${VERSION}
  39. output_path=${product_path}/${TARGET_OS}/${FLUTTER_OUTPUT_DIR}
  40. if [ -d "${output_path}" ]; then
  41. rm -rf ${output_path}/
  42. fi
  43. mkdir -p ${output_path}
  44. product=${PRODUCT_NAME}
  45. cp -R ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/build/${TARGET_OS}/${LINUX_ARCH}/${BUILD_FLAG}/bundle \
  46. ${output_path}/${product}
  47. """,
  48. ]
  49. script_runner = "@shell"
  50. [tasks.copy-to-product-windows]
  51. script = [
  52. """
  53. product_path= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${VERSION}
  54. output_path= set ${product_path}/${TARGET_OS}
  55. if is_path_exists ${output_path}
  56. rm -r ${output_path}/
  57. fi
  58. mkdir ${output_path}
  59. product= set ${PRODUCT_NAME}
  60. glob_cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/build/${TARGET_OS}/runner/${FLUTTER_OUTPUT_DIR}/**/* \
  61. ${output_path}/${product}
  62. """,
  63. ]
  64. script_runner = "@duckscript"
  65. [tasks.flutter-build]
  66. script = [
  67. """
  68. cd app_flowy/
  69. flutter clean
  70. flutter pub get
  71. flutter build ${TARGET_OS} --${BUILD_FLAG} --build-name=${VERSION}
  72. """,
  73. ]
  74. script_runner = "@shell"
  75. [tasks.flutter-build.linux]
  76. script = [
  77. """
  78. cd app_flowy/
  79. flutter clean
  80. flutter pub get
  81. flutter build ${TARGET_OS} --${BUILD_FLAG}
  82. """,
  83. ]
  84. script_runner = "@shell"
  85. [tasks.flutter-build.windows]
  86. script = [
  87. """
  88. cd app_flowy
  89. exec cmd.exe /c flutter clean
  90. exec cmd.exe /c flutter pub get
  91. exec cmd.exe /c flutter build ${TARGET_OS} --${BUILD_FLAG}
  92. """,
  93. ]
  94. script_runner = "@duckscript"
  95. [tasks.freeze_setup]
  96. script = [
  97. """
  98. flutter clean
  99. flutter pub get
  100. flutter pub run build_runner build --delete-conflicting-outputs
  101. """,
  102. ]
  103. script_runner = "@shell"
  104. [tasks.freeze_watch]
  105. script = [
  106. """
  107. flutter pub run build_runner watch
  108. """,
  109. ]
  110. script_runner = "@shell"