tool.toml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. [tasks.flutter_clean]
  2. run_task = { name = [
  3. "rust_lib_clean",
  4. "rm_macro_build_cache",
  5. "rm_rust_generated_files",
  6. "rm_dart_generated_files",
  7. ] }
  8. [tasks.rust_lib_clean]
  9. script = ["""
  10. cd rust-lib
  11. cargo clean -q
  12. cd ../../shared-lib
  13. cargo clean -q
  14. """]
  15. script_runner = "@shell"
  16. [tasks.rm_macro_build_cache]
  17. script = ["""
  18. path = canonicalize ../frontend/rust-lib/flowy-codegen/.cache
  19. if is_path_exists ${path}
  20. rm -rf ${path}
  21. end
  22. """]
  23. script_runner = "@duckscript"
  24. #Rust Clean
  25. [tasks.rm_rust_generated_files]
  26. run_task = { name = [
  27. "rm_rust_lib_generated_protobuf_files",
  28. "rm_shared_lib_generated_protobuf_files",
  29. ] }
  30. [tasks.rm_rust_lib_generated_protobuf_files]
  31. private = true
  32. env = { "rm_proto_path" = "./rust-lib/**/resources/proto", "rm_protobuf_path" = "./rust-lib/**/protobuf" }
  33. run_task = { name = "remove_files_with_pattern" }
  34. [tasks.rm_shared_lib_generated_protobuf_files]
  35. private = true
  36. env = { "rm_proto_path" = "../shared-lib/**/resources/proto", "rm_protobuf_path" = "../shared-lib/**/protobuf" }
  37. run_task = { name = "remove_files_with_pattern" }
  38. #Dart Clean
  39. [tasks.rm_dart_generated_files]
  40. env = { "dart_flowy_sdk_path" = "./appflowy_flutter/packages/appflowy_backend/" }
  41. run_task = { name = [
  42. "rm_dart_generated_protobuf_files",
  43. "rm_dart_generated_event_files",
  44. ] }
  45. [tasks.rm_dart_generated_protobuf_files]
  46. private = true
  47. script = ["""
  48. protobuf_file_paths = glob_array ${dart_flowy_sdk_path}/lib/protobuf
  49. if not array_is_empty ${protobuf_file_paths}
  50. echo Remove generated protobuf files:
  51. for path in ${protobuf_file_paths}
  52. echo remove ${path}
  53. rm -rf ${path}
  54. end
  55. end
  56. """]
  57. script_runner = "@duckscript"
  58. [tasks.rm_dart_generated_event_files]
  59. private = true
  60. script = ["""
  61. dart_event_folder = glob_array ${dart_flowy_sdk_path}/lib/dispatch/dart_event
  62. if not array_is_empty ${dart_event_folder}
  63. echo Remove generated dart event files:
  64. for path in ${dart_event_folder}
  65. echo remove ${path}
  66. rm -rf ${path}
  67. end
  68. end
  69. """]
  70. script_runner = "@duckscript"
  71. [tasks.remove_files_with_pattern]
  72. private = true
  73. script = ["""
  74. proto_file_paths = glob_array ${rm_proto_path}
  75. is_proto_file_paths_empty = array_is_empty ${proto_file_paths}
  76. if not ${is_proto_file_paths_empty}
  77. echo Remove generated proto files:
  78. for path in ${proto_file_paths}
  79. echo remove ${path}
  80. rm -rf ${path}
  81. end
  82. end
  83. protobuf_file_paths = glob_array ${rm_protobuf_path}
  84. is_protobuf_file_paths_empty = array_is_empty ${protobuf_file_paths}
  85. if not ${is_protobuf_file_paths_empty}
  86. echo Remove generated protobuf files:
  87. for path in ${protobuf_file_paths}
  88. echo remove ${path}
  89. rm -rf ${path}
  90. end
  91. end
  92. """]
  93. script_runner = "@duckscript"