env.toml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. [tasks.flowy_dev]
  2. run_task = { name = ["install_prerequests","install_diesel", "install_protobuf"] }
  3. [tasks.install_windows_deps.windows]
  4. dependencies=["check_duckscript_installation", "check_visual_studio_installation", "check_vcpkg", "install_vcpkg_sqlite", "install_rust_vcpkg_cli"]
  5. [tasks.check_visual_studio_installation.windows]
  6. script = """
  7. output = exec powershell -Command "Get-CimInstance MSFT_VSInstance | select -ExpandProperty Version"
  8. stdout = set ${output.stdout}
  9. versions = split ${stdout} "\\n"
  10. for version in ${versions}
  11. pos = last_indexof ${version} .
  12. new_str = substring ${version} 0 ${pos}
  13. newer = semver_is_newer ${new_str} 16.11.0
  14. if newer
  15. goto :ok
  16. end
  17. end
  18. echo "Visual studio 2019 is not installed or version is lower than 16.11.0"
  19. exit -1
  20. :ok
  21. """
  22. script_runner = "@duckscript"
  23. [tasks.check_duckscript_installation.windows]
  24. script = """
  25. @echo off
  26. @duck -h > nul
  27. if %errorlevel% GTR 0 (
  28. echo Please install duckscript at first: cargo install --force duckscript_cli
  29. exit -1
  30. )
  31. """
  32. [tasks.check_vcpkg.windows]
  33. script = """
  34. ret = which vcpkg
  35. if is_empty ${ret}
  36. echo "Please install vcpkg on windows at first. Make sure to put it into PATH env var"
  37. echo "See: https://github.com/microsoft/vcpkg#quick-start-windows"
  38. exit -1
  39. end
  40. """
  41. script_runner = "@duckscript"
  42. [tasks.install_vcpkg_sqlite.windows]
  43. script = """
  44. vcpkg install sqlite3:x64-windows-static-md
  45. """
  46. [tasks.install_rust_vcpkg_cli.windows]
  47. script = """
  48. exec cargo install vcpkg_cli
  49. output = exec vcpkg_cli probe sqlite3
  50. stdout = set ${output.stdout}
  51. stderr = set ${output.stderr}
  52. ret = indexof ${stdout} "Failed:"
  53. assert_eq ${ret} "" ${stdout}
  54. """
  55. script_runner = "@duckscript"
  56. [tasks.install_diesel]
  57. script = """
  58. cargo install diesel_cli --no-default-features --features sqlite
  59. """
  60. [tasks.install_diesel.windows]
  61. script = """
  62. cargo install diesel_cli --no-default-features --features sqlite
  63. """
  64. dependencies = ["check_vcpkg"]
  65. [tasks.install_targets.mac]
  66. script = """
  67. rustup target add x86_64-apple-ios
  68. rustup target add x86_64-apple-darwin
  69. rustup target add aarch64-apple-ios
  70. rustup target add aarch64-apple-darwin
  71. """
  72. [tasks.install_targets.windows]
  73. script = """
  74. rustup target add x86_64-pc-windows-msvc
  75. """
  76. [tasks.install_targets.linux]
  77. script = """
  78. rustup target add x86_64-unknown-linux-gnu
  79. """
  80. [tasks.install_prerequests]
  81. dependencies=["install_targets"]
  82. [tasks.install_prerequests.windows]
  83. dependencies=["install_targets", "install_windows_deps"]
  84. [tasks.install_tools]
  85. script = """
  86. rustup component add rustfmt
  87. cargo install cargo-expand
  88. cargo install cargo-watch
  89. cargo install cargo-cache
  90. cargo install bunyan
  91. """
  92. [tasks.install_cocoapods]
  93. script = """
  94. # execute "xcode-select --install" before if "extconf.rb failed" error occurs
  95. sudo gem install cocoapods
  96. """
  97. [tasks.install_rbenv]
  98. script = """
  99. brew install rbenv
  100. rbenv init
  101. rbenv install 2.7.1
  102. rbenv global 2.7.1
  103. # https://github.com/rbenv/rbenv
  104. curl -fsSL https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-doctor | bash
  105. """
  106. [tasks.install_fish]
  107. script = """
  108. brew install fish
  109. # https://stackoverflow.com/questions/26208231/modifying-path-with-fish-shell
  110. # Export the PATH using the command:
  111. # set -Ua fish_user_paths the_path_you_want_to_export
  112. """
  113. [tasks.install_flutter]
  114. script = """
  115. ret = which flutter
  116. if is_empty ${ret}
  117. echo "[❤️] Follow the https://flutter.dev/docs/get-started/install instructions to install the flutter, skip if you already installed."
  118. echo "Switch to dev channel with command: flutter channel stable"
  119. exit -1
  120. end
  121. """
  122. script_runner = "@duckscript"