|
| 1 | +# 🛠️ Build Guide |
| 2 | + |
| 3 | +## 📦 Prerequisites |
| 4 | + |
| 5 | +Flutter Desktop requires that the build environment matches the target platform. That is, to build for **Windows**, you must compile on **Windows**; to build for **Linux**, you must compile on **Linux**. |
| 6 | + |
| 7 | +> 📌 This guide is based on **Windows 11** and **Ubuntu 24.04 LTS**. |
| 8 | +
|
| 9 | +## ⚙️ Environment Setup |
| 10 | + |
| 11 | +This project depends on Flutter, Rust, and flutter rust bridge. |
| 12 | + |
| 13 | +Please refer to the official documentation for installing Flutter and Rust: |
| 14 | + |
| 15 | +* [Install Flutter](https://docs.flutter.dev/get-started/install) |
| 16 | +* [Install Rust](https://www.rust-lang.org/tools/install) |
| 17 | + |
| 18 | +To install flutter rust bridge using Cargo: |
| 19 | + |
| 20 | +```shell |
| 21 | +# Install flutter rust bridge |
| 22 | +cargo install flutter_rust_bridge_codegen |
| 23 | +``` |
| 24 | + |
| 25 | +### 🐧 Additional Steps for Linux |
| 26 | + |
| 27 | +Due to [tray_manager requirements](https://github.com/leanflutter/tray_manager?tab=readme-ov-file#quick-start), you need to install the following package on Linux: |
| 28 | + |
| 29 | +```shell |
| 30 | +sudo apt-get install libayatana-appindicator3-dev |
| 31 | +``` |
| 32 | + |
| 33 | +## 🧱 Code Generation |
| 34 | + |
| 35 | +The scaffolded code generated by flutter rust bridge is excluded from version control, so it must be generated manually: |
| 36 | + |
| 37 | +```shell |
| 38 | +# Generate flutter rust bridge code |
| 39 | +flutter_rust_bridge_codegen generate |
| 40 | +``` |
| 41 | + |
| 42 | +## 🏗️ Build Application |
| 43 | + |
| 44 | +```shell |
| 45 | +# Windows |
| 46 | +flutter build windows --release |
| 47 | + |
| 48 | +# Linux |
| 49 | +flutter build linux --release |
| 50 | +``` |
| 51 | + |
| 52 | +> 💡 **Tip:** If you attempt to build without generating code first, you may encounter a permission error on Linux. Run `flutter clean` before building to resolve this. |
| 53 | +
|
| 54 | +## 📁 Add restic Executable |
| 55 | + |
| 56 | +The application expects the `restic` binary to be located in the `bin` directory. Please create a `bin` folder and place the appropriate version of `restic` for your system inside it. |
| 57 | + |
| 58 | +Download restic from: |
| 59 | +[Restic Releases](https://github.com/restic/restic/releases) |
| 60 | + |
| 61 | +Example directory structure: |
| 62 | + |
| 63 | +```shell |
| 64 | +project_root/ |
| 65 | +├── bin/ |
| 66 | +│ └── restic # The restic binary for your platform |
| 67 | +├── data/ |
| 68 | +├── RestLite |
| 69 | +└── ... |
| 70 | +``` |
| 71 | + |
| 72 | +## 📝 Feedback & Issues |
| 73 | + |
| 74 | +If you encounter any issues during the build process, please submit a ticket on the [Issues](https://github.com/rest-lite/RestLite/issues) page or refer to the [GitHub Action build script](../.github/workflows/flutter-build.yml). |
0 commit comments