tool.toml 2.7 KB

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