flutter.toml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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.appflowy-dev]
  17. mac_alias = "appflowy-macos-dev"
  18. windows_alias = "appflowy-windows-dev"
  19. linux_alias = "appflowy-linux-dev"
  20. [tasks.appflowy-macos-dev]
  21. dependencies = ["flowy-sdk-dev"]
  22. run_task = { name = ["flutter-build", "copy-to-product"] }
  23. script_runner = "@shell"
  24. [tasks.appflowy-windows-dev]
  25. dependencies = ["flowy-sdk-dev"]
  26. run_task = { name = ["flutter-build", "copy-to-product"] }
  27. [tasks.appflowy-linux-dev]
  28. dependencies = ["flowy-sdk-dev"]
  29. run_task = { name = ["flutter-build", "copy-to-product"] }
  30. script_runner = "@shell"
  31. [tasks.copy-to-product]
  32. mac_alias = "copy-to-product-macos"
  33. windows_alias = "copy-to-product-windows"
  34. linux_alias = "copy-to-product-linux"
  35. [tasks.copy-to-product-macos]
  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}.${PRODUCT_EXT}
  45. cp -R ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/build/${TARGET_OS}/Build/Products/${FLUTTER_OUTPUT_DIR}/${product} \
  46. ${output_path}/${product}
  47. """,
  48. ]
  49. script_runner = "@shell"
  50. [tasks.copy-to-product-linux]
  51. script = [
  52. """
  53. product_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${VERSION}
  54. output_path=${product_path}/${TARGET_OS}/${FLUTTER_OUTPUT_DIR}
  55. if [ -d "${output_path}" ]; then
  56. rm -rf ${output_path}/
  57. fi
  58. mkdir -p ${output_path}
  59. product=${PRODUCT_NAME}
  60. cp -R ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/build/${TARGET_OS}/${LINUX_ARCH}/${BUILD_FLAG}/bundle \
  61. ${output_path}/${product}
  62. """,
  63. ]
  64. script_runner = "@shell"
  65. [tasks.copy-to-product-windows]
  66. script = [
  67. """
  68. product_path= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${VERSION}
  69. output_path= set ${product_path}/${TARGET_OS}
  70. if is_path_exists ${output_path}
  71. rm -r ${output_path}/
  72. fi
  73. mkdir ${output_path}
  74. product= set ${PRODUCT_NAME}
  75. glob_cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/build/${TARGET_OS}/runner/${FLUTTER_OUTPUT_DIR}/**/* \
  76. ${output_path}/${product}
  77. """,
  78. ]
  79. script_runner = "@duckscript"
  80. [tasks.flutter-build]
  81. script = [
  82. """
  83. cd app_flowy/
  84. flutter clean
  85. flutter pub get
  86. flutter build ${TARGET_OS} --${BUILD_FLAG} --build-name=${VERSION}
  87. """,
  88. ]
  89. script_runner = "@shell"
  90. [tasks.flutter-build.linux]
  91. script = [
  92. """
  93. cd app_flowy/
  94. flutter clean
  95. flutter pub get
  96. flutter build ${TARGET_OS} --${BUILD_FLAG}
  97. """,
  98. ]
  99. script_runner = "@shell"
  100. [tasks.flutter-build.windows]
  101. script = [
  102. """
  103. cd app_flowy
  104. exec cmd.exe /c flutter clean
  105. exec cmd.exe /c flutter pub get
  106. exec cmd.exe /c flutter build ${TARGET_OS} --${BUILD_FLAG}
  107. """,
  108. ]
  109. script_runner = "@duckscript"
  110. [tasks.freeze_setup]
  111. script = [
  112. """
  113. flutter clean
  114. flutter pub get
  115. flutter pub run build_runner build --delete-conflicting-outputs
  116. """,
  117. ]
  118. script_runner = "@shell"
  119. [tasks.freeze_watch]
  120. script = [
  121. """
  122. flutter pub run build_runner watch
  123. """,
  124. ]
  125. script_runner = "@shell"