You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/building/build_project.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Build project
2
2
3
-
## Build with docker
3
+
## Build with Docker
4
4
5
5
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.
6
6
@@ -10,17 +10,17 @@ Then open terminal in project root and run:
10
10
11
11
* On macOS and Linux:
12
12
13
-
./script/docker_build.py
13
+
./script/docker_build.sh
14
14
15
15
* On Windows:
16
16
17
-
.\script\docker_build.bat
17
+
.\script\docker_build.bat
18
18
19
19
After building, you can find APK here:
20
20
21
21
dist/android/release/roc-droid-<version>.apk
22
22
23
-
## Build without docker
23
+
## Build without Docker
24
24
25
25
First follow instructions to set up build environment:
Copy file name to clipboardExpand all lines: docs/development/automation.md
+42-39Lines changed: 42 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,66 +4,66 @@ For development, it is recommended to use [doit](https://pydoit.org/) task runne
4
4
5
5
Example workflow for Android development:
6
6
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.
8
8
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.
10
10
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`.
12
12
13
-
All commands should be called from the root directory.
13
+
All commands should be called from the project root directory.
14
14
15
15
## Run checks
16
16
17
17
Run code checks for desktop app (dart analyzer):
18
18
19
19
```
20
-
doit check:desktop
20
+
doit desktop:check
21
21
```
22
22
23
-
Run code checks for android app (dart analyzer, kotlin compiler, spotless linter):
23
+
Run code checks for android app (dart analyzer, kotlin compiler):
24
24
25
25
```
26
-
doit check:android
26
+
doit android:check
27
27
```
28
28
29
29
## Run tests
30
30
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:
32
32
33
33
```
34
-
doit test:desktop
34
+
doit desktop:test
35
35
```
36
36
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):
38
38
39
39
```
40
-
doit test:android
40
+
doit android:test
41
41
```
42
42
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:
44
44
45
45
```
46
-
doit integration:desktop
46
+
doit desktop:integration
47
47
```
48
48
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:
50
50
51
51
```
52
-
doit integration:android
52
+
doit android:integration
53
53
```
54
54
55
55
## Build and clean
56
56
57
57
Build desktop app (some sort of bundle, depending on platform):
58
58
59
59
```
60
-
doit build:desktop [variant=debug|release]
60
+
doit desktop:build [variant=debug|release]
61
61
```
62
62
63
63
Build android app (.apk file):
64
64
65
65
```
66
-
doit build:android [variant=debug|release]
66
+
doit android:build [variant=debug|release]
67
67
```
68
68
69
69
Clean all build artifacts:
@@ -77,55 +77,52 @@ doit wipe
77
77
Build desktop app and install system-wide on this machine:
78
78
79
79
```
80
-
doit install:desktop [variant=debug|release]
80
+
doit desktop:install [variant=debug|release]
81
81
```
82
82
83
83
Build android app (.apk file) and install to connected device:
84
84
85
85
```
86
-
doit install:android [variant=debug|release]
86
+
doit android:install [variant=debug|release]
87
87
```
88
88
89
89
## Launch app
90
90
91
91
Build and launch desktop app:
92
92
93
93
```
94
-
doit launch:desktop [variant=debug|release]
94
+
doit desktop:launch [variant=debug|release]
95
95
```
96
96
97
97
Build android app (.apk file) and launch on connected device:
98
98
99
99
```
100
-
doit launch:android [variant=debug|release]
100
+
doit android:launch [variant=debug|release]
101
101
```
102
102
103
-
## Generate code
104
-
105
-
Code generation is based on `build_runner` package.
103
+
## Generate source code
106
104
107
105
Run all code generation (but not resource generation, described in the next section):
108
106
109
107
```
110
108
doit gen
111
109
```
112
110
113
-
Run individual steps:
111
+
The command above is a shorthand for three sub-tasks:
114
112
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
118
121
doit gen:l10n
119
122
```
120
123
121
-
`watch` parameter runs code generator in watch mode, when it monitors source files updates and automatically regenerates code when needed.
122
-
123
124
Generated files have `*.g.dart` or `.g.kt` extension and must no be modified by hand.
124
125
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
-
129
126
## Generate resources
130
127
131
128
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
154
151
155
152
Documentation for website is written in markdown and lives in `docs` directory.
156
153
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:
158
161
159
162
```
160
-
doit docs:build
163
+
python3 ./script/generate_docs.py build
161
164
```
162
165
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:
0 commit comments