tauri.toml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. [tasks.tauri_env]
  2. script_runner = "@rust"
  3. script = '''
  4. //! ```cargo
  5. use std::env;
  6. fn main() {
  7. env.set_var("TAURI_PROTOBUF_PATH", "appflowy_tauri/src/protobuf");
  8. }
  9. '''
  10. [tasks.tauri_build]
  11. script = ["""
  12. cd appflowy_tauri/src-tauri
  13. npm run tauri build
  14. """]
  15. script_runner = "@shell"
  16. [tasks.tauri_pb]
  17. script = ["""
  18. cd appflowy_tauri/src-tauri
  19. cargo build
  20. """]
  21. script_runner = "@shell"
  22. [tasks.tauri_dev]
  23. script = ["""
  24. cd appflowy_tauri
  25. npm run tauri dev
  26. """]
  27. script_runner = "@shell"
  28. [tasks.tauri_clean]
  29. run_task = { name = [
  30. "rust_lib_clean",
  31. "rm_macro_build_cache",
  32. "rm_rust_generated_files",
  33. "rm_tauri_generated_protobuf_files",
  34. "rm_tauri_generated_event_files",
  35. ] }
  36. [tasks.rm_tauri_generated_protobuf_files]
  37. private = true
  38. script = ["""
  39. protobuf_file_paths = glob_array ${TAURI_PROTOBUF_PATH}/classes
  40. if not array_is_empty ${protobuf_file_paths}
  41. echo Remove generated protobuf files:
  42. for path in ${protobuf_file_paths}
  43. echo remove ${path}
  44. rm -rf ${path}
  45. end
  46. end
  47. """]
  48. script_runner = "@duckscript"
  49. [tasks.rm_tauri_generated_event_files]
  50. private = true
  51. script = ["""
  52. protobuf_file_paths = glob_array ${TAURI_PROTOBUF_PATH}/events
  53. if not array_is_empty ${protobuf_file_paths}
  54. echo Remove generated protobuf files:
  55. for path in ${protobuf_file_paths}
  56. echo remove ${path}
  57. rm -rf ${path}
  58. end
  59. end
  60. """]
  61. script_runner = "@duckscript"