Skip to content

Commit c1904f8

Browse files
committed
Update scripts and docs
1 parent d8b9b83 commit c1904f8

6 files changed

Lines changed: 297 additions & 320 deletions

File tree

docs/building/build_project.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Build project
22

3-
## Build with docker
3+
## Build with Docker
44

55
The easiest way to build project is to use our pre-built [docker images](https://github.com/roc-streaming/dockerfiles) with Flutter SDK. In this case you don't need to set up build environment by yourself.
66

@@ -10,17 +10,17 @@ Then open terminal in project root and run:
1010

1111
* On macOS and Linux:
1212

13-
./script/docker_build.py
13+
./script/docker_build.sh
1414

1515
* On Windows:
1616

17-
.\script\docker_build.bat
17+
.\script\docker_build.bat
1818

1919
After building, you can find APK here:
2020

2121
dist/android/release/roc-droid-<version>.apk
2222

23-
## Build without docker
23+
## Build without Docker
2424

2525
First follow instructions to set up build environment:
2626

docs/development/automation.md

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,66 +4,66 @@ For development, it is recommended to use [doit](https://pydoit.org/) task runne
44

55
Example workflow for Android development:
66

7-
- During development, you may frequently run `doit check:android` or `doit test:android`. These commands are quick and perform the most basic checks. They do not perform a full build and do not require a device to be connected.
7+
- During development, you may frequently run `doit android:check` (to check compilation) and `doit android:test` (to run unit tests on host). These commands are quick and perform the most basic checks. They do not perform a full build and do not require a device to be connected.
88

9-
- Run `doit build:android` from time to time to perform a full build and `doit integration:android` to run integration tests on the connected device. These commands are heavy.
9+
- Run `doit android:build` from time to time to perform a full build and `doit android:integration` to run integration tests on the connected device or emulator. These commands are heavy.
1010

11-
- To test the app manually, use `doit install:android` or `doit launch:android`.
11+
- To test the app manually on connected device or emulator, use `doit android:install` or `doit android:launch`.
1212

13-
All commands should be called from the root directory.
13+
All commands should be called from the project root directory.
1414

1515
## Run checks
1616

1717
Run code checks for desktop app (dart analyzer):
1818

1919
```
20-
doit check:desktop
20+
doit desktop:check
2121
```
2222

23-
Run code checks for android app (dart analyzer, kotlin compiler, spotless linter):
23+
Run code checks for android app (dart analyzer, kotlin compiler):
2424

2525
```
26-
doit check:android
26+
doit android:check
2727
```
2828

2929
## Run tests
3030

31-
Run code checks for desktop app (`check:desktop`), then run unit tests on desktop:
31+
Run code checks for desktop app (`desktop:check`), then run unit tests on desktop:
3232

3333
```
34-
doit test:desktop
34+
doit desktop:test
3535
```
3636

37-
Run code checks for android app (`check:android`), then run unit tests on desktop (no android device needed):
37+
Run code checks for android app (`android:check`), then run unit tests on desktop (no android device needed):
3838

3939
```
40-
doit test:android
40+
doit android:test
4141
```
4242

43-
Run code checks for desktop app (`check:desktop`), then run integration tests on desktop:
43+
Run code checks for desktop app (`desktop:check`), then run integration tests on desktop:
4444

4545
```
46-
doit integration:desktop
46+
doit desktop:integration
4747
```
4848

49-
Run code checks for android app (`check:android`), then run integration tests on connected android device:
49+
Run code checks for android app (`android:check`), then run integration tests on connected android device:
5050

5151
```
52-
doit integration:android
52+
doit android:integration
5353
```
5454

5555
## Build and clean
5656

5757
Build desktop app (some sort of bundle, depending on platform):
5858

5959
```
60-
doit build:desktop [variant=debug|release]
60+
doit desktop:build [variant=debug|release]
6161
```
6262

6363
Build android app (.apk file):
6464

6565
```
66-
doit build:android [variant=debug|release]
66+
doit android:build [variant=debug|release]
6767
```
6868

6969
Clean all build artifacts:
@@ -77,55 +77,52 @@ doit wipe
7777
Build desktop app and install system-wide on this machine:
7878

7979
```
80-
doit install:desktop [variant=debug|release]
80+
doit desktop:install [variant=debug|release]
8181
```
8282

8383
Build android app (.apk file) and install to connected device:
8484

8585
```
86-
doit install:android [variant=debug|release]
86+
doit android:install [variant=debug|release]
8787
```
8888

8989
## Launch app
9090

9191
Build and launch desktop app:
9292

9393
```
94-
doit launch:desktop [variant=debug|release]
94+
doit desktop:launch [variant=debug|release]
9595
```
9696

9797
Build android app (.apk file) and launch on connected device:
9898

9999
```
100-
doit launch:android [variant=debug|release]
100+
doit android:launch [variant=debug|release]
101101
```
102102

103-
## Generate code
104-
105-
Code generation is based on `build_runner` package.
103+
## Generate source code
106104

107105
Run all code generation (but not resource generation, described in the next section):
108106

109107
```
110108
doit gen
111109
```
112110

113-
Run individual steps:
111+
The command above is a shorthand for three sub-tasks:
114112

115-
```
116-
doit gen:model
117-
doit gen:agent
113+
```console
114+
# run build_runner generator (for mobx, freezed, etc.)
115+
doit gen:build_runner
116+
117+
# run pigeon generator (for platform channels)
118+
doit gen:pigeon
119+
120+
# run localization generator
118121
doit gen:l10n
119122
```
120123

121-
`watch` parameter runs code generator in watch mode, when it monitors source files updates and automatically regenerates code when needed.
122-
123124
Generated files have `*.g.dart` or `.g.kt` extension and must no be modified by hand.
124125

125-
`model` package uses `mobx_codegen` to generate reactive model classes. `agent` package uses `pigeon` to generate android platform channels bridge.
126-
127-
`l10n` step generates localization package from `.arb` file.
128-
129126
## Generate resources
130127

131128
Icons and splash screen are generated using `flutter_launcher_icons` and `flutter_native_splash` packages. You can find configuration in `pubspec.yaml` and source assets in `assets` directory.
@@ -154,19 +151,25 @@ doit gen:deps
154151

155152
Documentation for website is written in markdown and lives in `docs` directory.
156153

157-
This will build HTML documentation from markdown using `mkdocs` and place it into `site` directory. It will run `mkdocs` in docker container, so docker is required:
154+
This will build HTML documentation from markdown using `mkdocs` and place it into `site` directory:
155+
156+
```
157+
doit docs:site
158+
```
159+
160+
Installing `mkdocs` and all its dependencies may be cumbersome, so there is a script that pulls a pre-built docker container and uses it to build documentation:
158161

159162
```
160-
doit docs:build
163+
python3 ./script/generate_docs.py build
161164
```
162165

163-
This will run a HTTP server on localhost that serves HTML documentation and automatically rebuilds it when markdown files (or other files in `docs` directory) are changed:
166+
It can also start mkdocs preview server (on localhost) that monitors file changes and automatically rebuilds documentation on change:
164167

165168
```
166-
doit docs:serve
169+
python3 ./script/generate_docs.py serve
167170
```
168171

169-
Re-generate some markdown pages:
172+
To re-generate some markdown pages, run:
170173

171174
```
172175
doit docs:md

0 commit comments

Comments
 (0)