diff --git a/doc/BUILD_ON_LINUX.md b/doc/BUILD_ON_LINUX.md index 98e0b20447..acc4c42111 100644 --- a/doc/BUILD_ON_LINUX.md +++ b/doc/BUILD_ON_LINUX.md @@ -21,7 +21,7 @@ Note: * You may need to disable hardware 3D acceleration if you are running it on a VM. Otherwise, certain GL failures will prevent app from launching ### Detail steps -1. Install prerequisites +1. Install prerequisites ```shell sudo apt-get install curl build-essential libsqlite3-dev libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev unzip # optional, for generating protobuf in step 8 only @@ -35,7 +35,7 @@ rustup toolchain install nightly rustup default nightly ``` -3. env settings +3. env settings ``` shell cp backend/configuration/base.example.yaml backend/configuration/base.yaml cp backend/configuration/.env.example backend/configuration/.env @@ -64,13 +64,14 @@ cargo install --force cargo-make ```shell cargo install --force duckscript_cli ``` -8. Check pre-request +8. Check prerequisites ```shell cargo make flowy_dev ``` 9. [Optional] Generate protobuf for dart (optional, if you modify the shared-lib's entities) ```shell +# Make sure to install protobuf-compiler at first. See step 1 cargo make -p development-linux-x86 pb ``` 10. [Optional] Build flowy-sdk-dev (dart-ffi), step 10 covers this step diff --git a/doc/BUILD_ON_WINDOWS.md b/doc/BUILD_ON_WINDOWS.md index 9fb2858289..1f46f91f57 100644 --- a/doc/BUILD_ON_WINDOWS.md +++ b/doc/BUILD_ON_WINDOWS.md @@ -11,7 +11,7 @@ git clone https://github.com/AppFlowy-IO/appflowy.git ------------------------------ Note: -* Please run the commands in windows cmd rather than powershell +* Both Windows cmd and powershell can be used for running commands * Following steps are verified on - [x] Windows 10 X86_64 - [ ] Windows 10 arm64 @@ -32,7 +32,8 @@ flutter doctor ```shell # Download rustup.exe from https://win.rustup.rs/x86_64 # Call rustup.exe from powershell or cmd -rustup.exe toolchain install nightly +.\rustup-init.exe --default-toolchain nightly --default-host x86_64-pc-windows-msvc -y +# Note: you probably need to re-open termial to get cargo command be available in PATH var ``` 5. Install cargo make ```shell @@ -43,15 +44,17 @@ cargo install --force cargo-make ```shell cargo install --force duckscript_cli ``` -7. Check pre-request +7. Check prerequisites ```shell cargo make flowy_dev ``` 8. [Optional] Generate protobuf for dart (optional, if you modify the shared-lib's entities) ```shell +# Need to download protoc tools and add it's bin folder into PATH env var. +# Download protoc from https://github.com/protocolbuffers/protobuf/releases. The latest one is protoc-3.19.1-win64.zip cargo make -p development-windows pb ``` -9. [Optional] Build flowy-sdk (dart-ffi) +9. [Optional] Build flowy-sdk (dart-ffi), step 10 covers this step ```shell # for development cargo make --profile development-windows-x86 flowy-sdk-dev @@ -66,7 +69,7 @@ cargo make -p development-windows-x86 appflowy-windows-dev cargo make -p production-windows-x86 appflowy-windows ``` -## Step 3: Build Server side application (optional if you don't need to host web service locally) +## [Optional] Step 3: Build Server side application (optional if you don't need to host web service locally) ------------------------------ Note: You can launch postgresql server by using docker container diff --git a/frontend/scripts/makefile/protobuf.toml b/frontend/scripts/makefile/protobuf.toml index edb3489db8..1247401988 100644 --- a/frontend/scripts/makefile/protobuf.toml +++ b/frontend/scripts/makefile/protobuf.toml @@ -1,6 +1,19 @@ [tasks.pb] -dependencies = ["gen_pb_file"] +dependencies = ["check_protoc_cmd", "gen_pb_file"] + +[tasks.check_protoc_cmd] +script = [ + """ + ret = which protoc + if is_empty ${ret} + echo Please make sure /bin/ is in PATH env var + echo See BUILD_ON_{LINUX|WINDOWS}.md for how to get protoc + exit -1 + end + """, +] +script_runner = "@duckscript" [tasks.gen_pb_file] script = [ @@ -30,7 +43,7 @@ script = [ flowy_tool=set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/scripts/flowy-tool/Cargo.toml rust_source=set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/ # rust_lib=set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib - shared_lib=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/../shared-lib + shared_lib=set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/../shared-lib flutter_lib=set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/packages derive_meta=set ${shared_lib}/flowy-derive/src/derive_cache/derive_cache.rs