|
5 | 5 | * Go (1.25) |
6 | 6 | * Git |
7 | 7 | * gomobile and Android Studio for Android ([see more](https://pkg.go.dev/golang.org/x/mobile/cmd/gomobile)) |
8 | | -* Flutter (3.38) |
| 8 | +* Flutter (3.38) for Web and Android |
9 | 9 |
|
10 | | -## Build |
| 10 | +## Release build |
11 | 11 |
|
12 | 12 | The first step is to clone [awl](https://github.com/anywherelan/awl) and [awl-flutter](https://github.com/anywherelan/awl-flutter) in one parent directory. |
13 | 13 |
|
14 | 14 | ```bash |
| 15 | +# Example structure: |
| 16 | +# /workspace |
| 17 | +# ├── awl |
| 18 | +# └── awl-flutter |
| 19 | + |
| 20 | +git clone https://github.com/anywherelan/awl.git |
| 21 | +git clone https://github.com/anywherelan/awl-flutter.git |
| 22 | + |
15 | 23 | cd awl |
16 | 24 | ./build.sh release |
17 | 25 | ls build |
18 | 26 | ``` |
19 | 27 |
|
20 | 28 | See [build.sh](build.sh) for more details. |
| 29 | + |
| 30 | +## Local Development |
| 31 | + |
| 32 | +**Note:** To run the application on desktop (Linux/macOS/Windows), you need **root/administrator** rights. This is required to create virtual network interfaces. |
| 33 | + |
| 34 | +### Web Static Files |
| 35 | + |
| 36 | +The project requires a `static` directory containing the Flutter web UI. If you see an error like `pattern static: no matching files found`, you need to set this up. You have two options: |
| 37 | + |
| 38 | +**Option A: Download pre-built (No Flutter required)** |
| 39 | +If you don't want to install Flutter or build the frontend, you can download the pre-built static files. |
| 40 | +1. Download the `awl-release-static.zip` artifact from a recent GitHub Action run from [Manual build release workflow](https://github.com/anywherelan/awl/actions/workflows/build-manual.yml). |
| 41 | +2. Unzip the contents into the `static` directory in the root of the awl project: |
| 42 | + ```bash |
| 43 | + unzip awl-release-static.zip -d static |
| 44 | + ``` |
| 45 | + |
| 46 | +**Option B: Build locally** |
| 47 | +If you have [Flutter installed](#dependencies), you can build the web static files yourself: |
| 48 | +```bash |
| 49 | +./build.sh web |
| 50 | +``` |
| 51 | +This rebuilds the Flutter web frontend and places it in the `static` directory. |
| 52 | + |
| 53 | +### For Windows |
| 54 | + |
| 55 | +If you are developing on Windows, you must download the `wintun` driver dependencies before building: |
| 56 | +```bash |
| 57 | +./build.sh deps |
| 58 | +``` |
| 59 | + |
| 60 | +### For Android |
| 61 | + |
| 62 | +The `./build.sh` script provides commands for Android development: |
| 63 | + |
| 64 | +- **Build Android Library (Go backend)**: |
| 65 | + ```bash |
| 66 | + ./build.sh android-lib |
| 67 | + ``` |
| 68 | + Builds the Go backend as an Android library (`anywherelan.aar`). Use this when you are working on the Go code and want to check for compilation errors without building the full APK. |
| 69 | + |
| 70 | +- **Build Full Android APK**: |
| 71 | + ```bash |
| 72 | + ./build.sh android |
| 73 | + ``` |
| 74 | + Builds the full Android application (requires `android-lib` step implicitly, but this command runs both). |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
0 commit comments