|
@@ -1,19 +1,79 @@
|
|
[tasks.flowy_dev]
|
|
[tasks.flowy_dev]
|
|
-run_task = { name = ["install_targets","install_diesel", "install_protobuf"] }
|
|
|
|
|
|
+run_task = { name = ["install_prerequests","install_diesel", "install_protobuf"] }
|
|
|
|
+
|
|
|
|
+[tasks.install_windows_deps.windows]
|
|
|
|
+dependencies=["check_duckscript_installation", "check_visual_studio_installation", "check_vcpkg", "install_rust_vcpkg_cli"]
|
|
|
|
+
|
|
|
|
+[tasks.check_visual_studio_installation.windows]
|
|
|
|
+script = """
|
|
|
|
+output = exec powershell -Command "Get-CimInstance MSFT_VSInstance | select -ExpandProperty Version"
|
|
|
|
+stdout = set ${output.stdout}
|
|
|
|
+pos = last_indexof ${stdout} .
|
|
|
|
+new_str = substring ${stdout} 0 ${pos}
|
|
|
|
+newer = semver_is_newer ${new_str} 16.11.0
|
|
|
|
+assert ${newer} "Visual studio 2019 is not installed or version is lower than 16.11.0"
|
|
|
|
+"""
|
|
|
|
+script_runner = "@duckscript"
|
|
|
|
+
|
|
|
|
+[tasks.check_duckscript_installation.windows]
|
|
|
|
+script = """
|
|
|
|
+@echo off
|
|
|
|
+@duck -h > nul
|
|
|
|
+if %errorlevel% GTR 0 (
|
|
|
|
+ echo Please install duckscript at first: cargo install --force duckscript_cli
|
|
|
|
+ exit -1
|
|
|
|
+)
|
|
|
|
+"""
|
|
|
|
+
|
|
|
|
+[tasks.check_vcpkg.windows]
|
|
|
|
+script = """
|
|
|
|
+ret = which vcpkg
|
|
|
|
+if is_empty ${ret}
|
|
|
|
+ echo "Please install vcpkg on windows at first. Make sure to put it into PATH env var"
|
|
|
|
+ echo "See: https://github.com/microsoft/vcpkg#quick-start-windows"
|
|
|
|
+ exit -1
|
|
|
|
+end
|
|
|
|
+"""
|
|
|
|
+script_runner = "@duckscript"
|
|
|
|
+
|
|
|
|
+[tasks.install_rust_vcpkg_cli.windows]
|
|
|
|
+script = """
|
|
|
|
+exec cargo install vcpkg_cli
|
|
|
|
+output = exec vcpkg_cli probe sqlite3
|
|
|
|
+stdout = set ${output.stdout}
|
|
|
|
+stderr = set ${output.stderr}
|
|
|
|
+ret = indexof ${stdout} "Failed:"
|
|
|
|
+assert_eq ${ret} "" ${stdout}
|
|
|
|
+"""
|
|
|
|
+script_runner = "@duckscript"
|
|
|
|
|
|
[tasks.install_diesel]
|
|
[tasks.install_diesel]
|
|
script = """
|
|
script = """
|
|
cargo install diesel_cli --no-default-features --features sqlite
|
|
cargo install diesel_cli --no-default-features --features sqlite
|
|
"""
|
|
"""
|
|
|
|
|
|
|
|
+[tasks.install_diesel.windows]
|
|
|
|
+script = """
|
|
|
|
+vcpkg install sqlite3:x64-windows-static-md
|
|
|
|
+cargo install diesel_cli --no-default-features --features sqlite
|
|
|
|
+"""
|
|
|
|
+dependencies = ["check_vcpkg"]
|
|
|
|
+
|
|
[tasks.install_targets]
|
|
[tasks.install_targets]
|
|
script = """
|
|
script = """
|
|
rustup target add x86_64-apple-ios
|
|
rustup target add x86_64-apple-ios
|
|
rustup target add x86_64-apple-darwin
|
|
rustup target add x86_64-apple-darwin
|
|
rustup target add aarch64-apple-ios
|
|
rustup target add aarch64-apple-ios
|
|
rustup target add aarch64-apple-darwin
|
|
rustup target add aarch64-apple-darwin
|
|
|
|
+rustup target add x86_64-pc-windows-msvc
|
|
"""
|
|
"""
|
|
|
|
|
|
|
|
+[tasks.install_prerequests]
|
|
|
|
+dependencies=["install_targets"]
|
|
|
|
+
|
|
|
|
+[tasks.install_prerequests.windows]
|
|
|
|
+dependencies=["install_targets", "install_windows_deps"]
|
|
|
|
+
|
|
[tasks.install_protobuf]
|
|
[tasks.install_protobuf]
|
|
script = """
|
|
script = """
|
|
# Custom dart:
|
|
# Custom dart:
|
|
@@ -27,6 +87,24 @@ dart pub global activate protoc_plugin
|
|
cargo install --version 2.20.0 protobuf-codegen
|
|
cargo install --version 2.20.0 protobuf-codegen
|
|
"""
|
|
"""
|
|
|
|
|
|
|
|
+[tasks.install_protobuf.windows]
|
|
|
|
+script = """
|
|
|
|
+ret = which dart
|
|
|
|
+if is_empty ${ret}
|
|
|
|
+ echo Please make sure flutter/dart is properly installed and in PATH env var
|
|
|
|
+ exit -1
|
|
|
|
+end
|
|
|
|
+ret = which protoc-gen-dart
|
|
|
|
+if is_empty ${ret}
|
|
|
|
+ dart pub global activate protoc_plugin
|
|
|
|
+ home_dir = get_home_dir
|
|
|
|
+ echo Please add '${home_dir}\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\bin' into PATH env var
|
|
|
|
+ exit -1
|
|
|
|
+end
|
|
|
|
+exec cargo install --version 2.22.1 protobuf-codegen
|
|
|
|
+"""
|
|
|
|
+script_runner = "@duckscript"
|
|
|
|
+
|
|
[tasks.install_tools]
|
|
[tasks.install_tools]
|
|
script = """
|
|
script = """
|
|
rustup component add rustfmt
|
|
rustup component add rustfmt
|
|
@@ -64,9 +142,12 @@ brew install fish
|
|
|
|
|
|
[tasks.install_flutter]
|
|
[tasks.install_flutter]
|
|
script = """
|
|
script = """
|
|
-echo "[❤️] Follow the https://flutter.dev/docs/get-started/install instructions to install the flutter, skip if you already installed."
|
|
|
|
-echo "Switch to dev channel with command: flutter channel dev"
|
|
|
|
|
|
+ret = which flutter
|
|
|
|
+if is_empty ${ret}
|
|
|
|
+ echo "[❤️] Follow the https://flutter.dev/docs/get-started/install instructions to install the flutter, skip if you already installed."
|
|
|
|
+ echo "Switch to dev channel with command: flutter channel dev"
|
|
|
|
+ exit -1
|
|
|
|
+end
|
|
"""
|
|
"""
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+script_runner = "@duckscript"
|
|
|
|
|