Skip to content

Commit 72397ca

Browse files
Dev docs: update C library update instructions
1 parent 8caf9ba commit 72397ca

File tree

1 file changed

+66
-10
lines changed

1 file changed

+66
-10
lines changed

dev-doc/updating-c-library.md

Lines changed: 66 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,96 @@ Dart won't error on C function signature mismatch, leading to obscure memory bug
55

66
## C libraries
77

8+
For each:
9+
10+
- Update versions below
11+
- Run update script
12+
- Add [CHANGELOG](../objectbox/CHANGELOG.md) entry
13+
- Commit changes
14+
15+
### Desktop, Scripts
16+
817
For Dart Native and unit tests ([install.sh](../install.sh)),
918
for the binding update script (see below) and
10-
for Flutter (`flutter_libs` and `sync_flutter_libs` plugins) on Linux and Windows:
11-
```
19+
for Flutter (`flutter_libs` and `sync_flutter_libs` plugins) on Linux and Windows:
20+
21+
```bash
1222
./tool/set-c-version.sh 4.0.2
1323
```
1424

15-
For the Flutter plugins on Android ([view releases](https://github.com/objectbox/objectbox-java/releases)):
25+
```text
26+
* Flutter for Linux/Windows, Dart Native: update to [objectbox-c 4.0.2](https://github.com/objectbox/objectbox-c/releases/tag/v4.0.2).
27+
```
28+
29+
```text
30+
Update C library [4.0.1 -> 4.0.2]
1631
```
32+
33+
### Android
34+
35+
For the Flutter plugins on Android ([view releases](https://github.com/objectbox/objectbox-java/releases)):
36+
37+
```bash
1738
./tool/set-android-version.sh 4.0.3
1839
```
1940

20-
For the Flutter plugins on iOS/macOS ([view releases](https://github.com/objectbox/objectbox-swift/releases))
41+
```text
42+
* Flutter for Android: update to [objectbox-android 4.0.3](https://github.com/objectbox/objectbox-java/releases/tag/V4.0.3).
43+
If your project is [using Admin](https://docs.objectbox.io/data-browser#admin-for-android), make sure to
44+
update to `io.objectbox:objectbox-android-objectbrowser:4.0.3` in `android/app/build.gradle`.
45+
```
46+
47+
```text
48+
Update objectbox-android [4.0.2 -> 4.0.3]
49+
50+
Bundled with C API 4.0.1 and ObjectBox 4.0.2-2024-10-15
2151
```
52+
53+
Note: the embedded C API and ObjectBox version can be looked up
54+
from the relevant objectbox repository release tag (like `java-4.0.3`).
55+
56+
### Apple OSs
57+
58+
For the Flutter plugins on iOS/macOS ([view releases](https://github.com/objectbox/objectbox-swift/releases))
59+
60+
```bash
2261
./tool/set-swift-version.sh 4.0.1
2362
```
2463

25-
For each, add an entry (see previous releases) to the [CHANGELOG](../objectbox/CHANGELOG.md).
64+
```text
65+
* Flutter for iOS/macOS: update to [objectbox-swift 4.0.1](https://github.com/objectbox/objectbox-swift/releases/tag/v4.0.1).
66+
For existing projects, run `pod repo update` and `pod update ObjectBox` in the `ios` or `macos` directories.
67+
```
68+
69+
```text
70+
Update ObjectBox Swift [4.0.0 -> 4.0.1]
71+
72+
Bundled with C API 4.0.2 and ObjectBox 4.0.2-2024-10-15
73+
```
74+
75+
Note: the embedded C API and ObjectBox version can be looked up
76+
from the objectbox-swift release tag (like `v4.0.1`) and
77+
the objectbox commit it points to (see `external/objectbox`).
2678

2779
## Dart C API bindings
80+
2881
To download the C library header files and generate bindings with ffigen (requires LLVM libraries,
2982
see [ffigen docs](https://pub.dev/packages/ffigen#installing-llvm)
3083
and the ffigen section in [pubspec.yaml](../objectbox/pubspec.yaml)):
31-
```
84+
85+
```bash
3286
./tool/update-c-binding.sh
3387
```
3488

3589
Then manually:
90+
3691
- Copy/update enums that need to be exposed to users
3792
from [objectbox_c.dart](../objectbox/lib/src/native/bindings/objectbox_c.dart)
3893
to [enums.dart](../objectbox/lib/src/modelinfo/enums.dart).
3994
- Check the changed files, make any required changes in the Dart library (like method signature changes).
4095
- ⚠️ Update minimum C API and core version and notes as needed in [bindings.dart](../objectbox/lib/src/native/bindings/bindings.dart).
41-
42-
Note: the embedded C API and core version can be looked up
43-
for Android from the relevant core repository release tag and
44-
for Swift from its repos release tag and the core commit it points to.
96+
- Commit as
97+
98+
```text
99+
Update C-API [4.0.1 -> 4.0.2]
100+
```

0 commit comments

Comments
 (0)