protobuf.toml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. [tasks.install_tauri_protobuf]
  2. script = """
  3. npm install -g protoc-gen-ts
  4. """
  5. script_runner = "@duckscript"
  6. [tasks.install_flutter_protobuf]
  7. mac_alias = "install-protobuf"
  8. windows_alias = "install-protobuf-windows"
  9. linux_alias = "install-protobuf"
  10. [tasks.install-protobuf]
  11. condition_script = [
  12. """
  13. if ! command -v protoc-gen-dart
  14. then
  15. exit 0
  16. fi
  17. # installed
  18. exit 1
  19. """,
  20. ]
  21. run_task = { name = ["install_flutter_protobuf_compiler"] }
  22. [tasks.install-protobuf-windows]
  23. script = """
  24. ret = which dart
  25. if is_empty ${ret}
  26. echo Please make sure flutter/dart is properly installed and in PATH env var
  27. exit -1
  28. end
  29. ret = which protoc-gen-dart
  30. if is_empty ${ret}
  31. exec cmd.exe /c dart pub global activate protoc_plugin
  32. end
  33. ret = which protoc-gen-dart
  34. if is_empty ${ret}
  35. home_dir = get_home_dir
  36. echo Please add '${home_dir}\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\bin' into PATH env var
  37. exit -1
  38. end
  39. """
  40. script_runner = "@duckscript"
  41. [tasks.install_flutter_protobuf_compiler]
  42. script = """
  43. echo "Install protoc_plugin (Dart)"
  44. dart pub global activate protoc_plugin
  45. """
  46. script_runner = "@shell"
  47. [tasks.install_flutter_protobuf_compiler.linux]
  48. script = """
  49. echo "Install protoc_plugin (Dart)"
  50. dart pub global activate protoc_plugin
  51. """
  52. script_runner = "@shell"