Skip to content

Commit 08db801

Browse files
Merge branch 'c-library-0.20.0' into 'main'
Update C libraries and C API to 0.20.0 level See merge request objectbox/objectbox-dart!64
2 parents 2c4ef41 + 3bcf259 commit 08db801

File tree

36 files changed

+211
-87
lines changed

36 files changed

+211
-87
lines changed

dev-doc/updating-c-library.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,36 @@
1-
# Updating the C library
1+
# Updating the C API bindings and libraries
22

3-
It's important that the generated dart bindings and the c-api library version match.
3+
It's important that the generated Dart C bindings have APIs matching the included C libraries.
44
Dart won't error on C function signature mismatch, leading to obscure memory bugs.
55

6+
## C libraries
7+
8+
For Dart Native and unit tests:
9+
610
- Update [install.sh](../install.sh).
7-
8-
## Flutter libs
9-
Update `flutter_libs` and `sync_flutter_libs` with **compatible library versions**:
11+
12+
For Flutter (`flutter_libs` and `sync_flutter_libs` plugins):
1013

1114
- Linux and Windows
12-
- Shortcut: search and replace e.g. `set(OBJECTBOX_VERSION 0.19.0)` in `CMakeLists.txt`.
15+
- Shortcut: search and replace e.g. `set(OBJECTBOX_VERSION 0.20.0)` in `CMakeLists.txt`.
1316
- [flutter_libs Linux](../flutter_libs/linux/CMakeLists.txt)
1417
- [flutter_libs Windows](../flutter_libs/windows/CMakeLists.txt)
1518
- [sync_flutter_libs Linux](../sync_flutter_libs/linux/CMakeLists.txt)
1619
- [sync_flutter_libs Windows](../sync_flutter_libs/windows/CMakeLists.txt)
1720
- Android ([view releases](https://github.com/objectbox/objectbox-java/releases))
1821
```
19-
./tool/set-android-version.sh 3.7.0
22+
./tool/set-android-version.sh 3.7.1
2023
```
2124
- Swift (iOS/macOS) ([view releases](https://github.com/objectbox/objectbox-swift/releases))
2225
```
23-
./tool/set-swift-version.sh 1.9.0
26+
./tool/set-swift-version.sh 1.9.1
2427
```
2528

26-
## Dart bindings
29+
Note: the embedded C library and core version can be looked up
30+
for Android from the relevant core repository release tag and
31+
for Swift from its repos release tag and the core commit it points to.
32+
33+
## Dart C API bindings
2734
Download source code of an [objectbox-c release version](https://github.com/objectbox/objectbox-c/releases).
2835
- Update [objectbox.h](../objectbox/lib/src/native/bindings/objectbox.h)
2936
- Update [objectbox-dart.h](../objectbox/lib/src/native/bindings/objectbox-dart.h)
@@ -36,6 +43,4 @@ Download source code of an [objectbox-c release version](https://github.com/obje
3643
- Copy/update enums from [objectbox_c.dart](../objectbox/lib/src/native/bindings/objectbox_c.dart)
3744
in [enums.dart](../objectbox/lib/src/modelinfo/enums.dart) that need to be exposed to users.
3845
- Have a look at the changed files to see if some call sites need to be updated.
39-
40-
Version check:
4146
- Update minimum C library and core version and notes in [bindings.dart](../objectbox/lib/src/native/bindings/bindings.dart).

flutter_libs/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ android {
5252
// ObjectBox Android library that includes an ObjectBox C library version compatible with
5353
// the C API binding of the ObjectBox Dart package.
5454
// https://central.sonatype.com/search?q=g:io.objectbox%20objectbox-android
55-
implementation "io.objectbox:objectbox-android:3.7.0"
55+
implementation "io.objectbox:objectbox-android:3.7.1"
5656
}
5757
}

flutter_libs/ios/objectbox_flutter_libs.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ Pod::Spec.new do |s|
1313
s.homepage = 'https://objectbox.io'
1414
s.license = 'Apache 2.0, ObjectBox Binary License'
1515
s.author = 'ObjectBox'
16-
s.platform = :ios, '11.0' # ObjectBox Swift requires 64-bit, so iOS 11.
16+
s.platform = :ios, '12.0' # ObjectBox Swift requires iOS 12
1717
s.source = { :path => '.' }
1818
s.source_files = 'Classes/**/*'
1919

2020
s.dependency 'Flutter'
21-
s.dependency 'ObjectBox', '1.9.0'
21+
s.dependency 'ObjectBox', '1.9.1'
2222

2323
# Flutter.framework does not contain a i386 slice.
2424
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }

flutter_libs/linux/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK)
4444
# ----------------------------------------------------------------------
4545
# Download and add objectbox-c prebuilt library.
4646

47-
set(OBJECTBOX_VERSION 0.19.0)
47+
set(OBJECTBOX_VERSION 0.20.0)
4848

4949
set(OBJECTBOX_ARCH ${CMAKE_SYSTEM_PROCESSOR})
5050
if (${OBJECTBOX_ARCH} MATCHES "x86_64")

flutter_libs/macos/objectbox_flutter_libs.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ Pod::Spec.new do |s|
1313
s.homepage = 'https://objectbox.io'
1414
s.license = 'Apache 2.0, ObjectBox Binary License'
1515
s.author = 'ObjectBox'
16-
s.platform = :osx, '10.13' # ObjectBox Swift requires macOS 10.13.
16+
s.platform = :osx, '10.15' # ObjectBox Swift requires macOS 10.15
1717
s.source = { :path => '.' }
1818
s.source_files = 'Classes/**/*'
1919

2020
s.dependency 'FlutterMacOS'
21-
s.dependency 'ObjectBox', '1.9.0'
21+
s.dependency 'ObjectBox', '1.9.1'
2222

2323
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
2424
s.swift_version = '5.3'

flutter_libs/windows/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ set(objectbox_flutter_libs_bundled_libraries
5050
# ----------------------------------------------------------------------
5151
# Download and add objectbox-c prebuilt library.
5252

53-
set(OBJECTBOX_VERSION 0.19.0)
53+
set(OBJECTBOX_VERSION 0.20.0)
5454

5555
set(OBJECTBOX_ARCH ${CMAKE_SYSTEM_PROCESSOR})
5656
if (${OBJECTBOX_ARCH} MATCHES "AMD64")

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -eu
55
# It's important that the generated dart bindings and the c-api library version match. Dart won't error on C function
66
# signature mismatch, leading to obscure memory bugs.
77
# For how to upgrade the version see dev-doc/updating-c-library.md
8-
cLibVersion=0.19.0
8+
cLibVersion=0.20.0
99
os=$(uname)
1010
cLibArgs="$*"
1111

objectbox/CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22

33
* Fix crash in Flutter plugin when running in debug mode on iOS. [#561](https://github.com/objectbox/objectbox-dart/issues/561)
44
* Support Flutter projects using Android Gradle Plugin 8. [#581](https://github.com/objectbox/objectbox-dart/issues/581)
5-
* Flutter for Linux, Windows: fix CMake build deprecation warning. [#522](https://github.com/objectbox/objectbox-dart/issues/522)
5+
* Flutter for Linux/Windows: fix CMake build deprecation warning. [#522](https://github.com/objectbox/objectbox-dart/issues/522)
6+
* Flutter for Linux/Windows, Dart Native: update to [objectbox-c 0.20.0](https://github.com/objectbox/objectbox-c/releases/tag/v0.20.0).
7+
* Flutter for Android: update to [objectbox-android 3.7.1](https://github.com/objectbox/objectbox-java/releases/tag/V3.7.1).
8+
If you are [using Admin](https://docs.objectbox.io/data-browser#admin-for-android), make sure to
9+
update to `io.objectbox:objectbox-android-objectbrowser:3.7.1` in `android/app/build.gradle`.
10+
Notably requires Android 4.4 (API 19) or higher.
11+
* Flutter for iOS/macOS: update to [objectbox-swift 1.9.1](https://github.com/objectbox/objectbox-swift/releases/tag/v1.9.1).
12+
Existing projects may have to run `pod repo update` and `pod update ObjectBox`.
13+
Notably requires at least iOS 12.0 and macOS 10.15.
614

715
## 2.3.1 (2023-10-02)
816

objectbox/example/flutter/objectbox_demo/ios/Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Uncomment this line to define a global platform for your project
2-
# platform :ios, '11.0'
1+
# ObjectBox requires iOS 12.0
2+
platform :ios, '12.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

objectbox/example/flutter/objectbox_demo/lib/objectbox.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ class ObjectBox {
3131
// On mobile this is typically fine, as each app has its own directory
3232
// structure.
3333

34+
// Note: set macosApplicationGroup for sandboxed macOS applications, see the
35+
// info boxes at https://docs.objectbox.io/getting-started for details.
36+
3437
// Future<Store> openStore() {...} is defined in the generated objectbox.g.dart
3538
final store = await openStore(
36-
directory: p.join(
37-
(await getApplicationDocumentsDirectory()).path, "obx-demo"));
39+
directory:
40+
p.join((await getApplicationDocumentsDirectory()).path, "obx-demo"),
41+
macosApplicationGroup: "objectbox.demo");
3842
return ObjectBox._create(store);
3943
}
4044

objectbox/example/flutter/objectbox_demo/macos/Podfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
platform :osx, '10.13'
1+
# ObjectBox requires macOS 10.15
2+
platform :osx, '10.15'
23

34
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
45
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

objectbox/example/flutter/objectbox_demo/macos/Runner.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@
405405
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
406406
GCC_WARN_UNUSED_FUNCTION = YES;
407407
GCC_WARN_UNUSED_VARIABLE = YES;
408-
MACOSX_DEPLOYMENT_TARGET = 10.13;
408+
MACOSX_DEPLOYMENT_TARGET = 10.15;
409409
MTL_ENABLE_DEBUG_INFO = NO;
410410
SDKROOT = macosx;
411411
SWIFT_COMPILATION_MODE = wholemodule;
@@ -427,7 +427,7 @@
427427
"$(inherited)",
428428
"@executable_path/../Frameworks",
429429
);
430-
MACOSX_DEPLOYMENT_TARGET = 10.13;
430+
MACOSX_DEPLOYMENT_TARGET = 10.15;
431431
PROVISIONING_PROFILE_SPECIFIER = "";
432432
SWIFT_VERSION = 5.0;
433433
};
@@ -485,7 +485,7 @@
485485
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
486486
GCC_WARN_UNUSED_FUNCTION = YES;
487487
GCC_WARN_UNUSED_VARIABLE = YES;
488-
MACOSX_DEPLOYMENT_TARGET = 10.13;
488+
MACOSX_DEPLOYMENT_TARGET = 10.15;
489489
MTL_ENABLE_DEBUG_INFO = YES;
490490
ONLY_ACTIVE_ARCH = YES;
491491
SDKROOT = macosx;
@@ -532,7 +532,7 @@
532532
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
533533
GCC_WARN_UNUSED_FUNCTION = YES;
534534
GCC_WARN_UNUSED_VARIABLE = YES;
535-
MACOSX_DEPLOYMENT_TARGET = 10.13;
535+
MACOSX_DEPLOYMENT_TARGET = 10.15;
536536
MTL_ENABLE_DEBUG_INFO = NO;
537537
SDKROOT = macosx;
538538
SWIFT_COMPILATION_MODE = wholemodule;
@@ -554,7 +554,7 @@
554554
"$(inherited)",
555555
"@executable_path/../Frameworks",
556556
);
557-
MACOSX_DEPLOYMENT_TARGET = 10.13;
557+
MACOSX_DEPLOYMENT_TARGET = 10.15;
558558
PROVISIONING_PROFILE_SPECIFIER = "";
559559
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
560560
SWIFT_VERSION = 5.0;
@@ -575,7 +575,7 @@
575575
"$(inherited)",
576576
"@executable_path/../Frameworks",
577577
);
578-
MACOSX_DEPLOYMENT_TARGET = 10.13;
578+
MACOSX_DEPLOYMENT_TARGET = 10.15;
579579
PROVISIONING_PROFILE_SPECIFIER = "";
580580
SWIFT_VERSION = 5.0;
581581
};

objectbox/example/flutter/objectbox_demo/macos/Runner/DebugProfile.entitlements

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
<true/>
99
<key>com.apple.security.network.server</key>
1010
<true/>
11-
<key>com.apple.security.application-groups</key>
12-
<array>
13-
<string>objectbox.demo</string>
14-
</array>
11+
<key>com.apple.security.application-groups</key>
12+
<array>
13+
<string>objectbox.demo</string>
14+
</array>
1515
</dict>
1616
</plist>

objectbox/example/flutter/objectbox_demo/macos/Runner/Release.entitlements

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<dict>
55
<key>com.apple.security.app-sandbox</key>
66
<true/>
7-
<key>com.apple.security.application-groups</key>
8-
<array>
9-
<string>objectbox.demo</string>
10-
</array>
7+
<key>com.apple.security.application-groups</key>
8+
<array>
9+
<string>objectbox.demo</string>
10+
</array>
1111
</dict>
1212
</plist>

objectbox/example/flutter/objectbox_demo_relations/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,5 @@ dependencies {
8181
// Add objectbox-android-objectbrowser only for debug builds.
8282
// Warning: when objectbox_flutter_libs updates check if version
8383
// needs update, e.g. check https://github.com/objectbox/objectbox-dart/releases.
84-
debugImplementation("io.objectbox:objectbox-android-objectbrowser:3.7.0")
84+
debugImplementation("io.objectbox:objectbox-android-objectbrowser:3.7.1")
8585
}

objectbox/example/flutter/objectbox_demo_relations/ios/Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Uncomment this line to define a global platform for your project
2-
# platform :ios, '11.0'
1+
# ObjectBox requires iOS 12.0
2+
platform :ios, '12.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

objectbox/example/flutter/objectbox_demo_relations/lib/objectbox.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,14 @@ class ObjectBox {
4545
// On mobile this is typically fine, as each app has its own directory
4646
// structure.
4747

48+
// Note: set macosApplicationGroup for sandboxed macOS applications, see the
49+
// info boxes at https://docs.objectbox.io/getting-started for details.
50+
4851
// Future<Store> openStore() {...} is defined in the generated objectbox.g.dart
4952
final store = await openStore(
5053
directory: p.join((await getApplicationDocumentsDirectory()).path,
51-
"obx-demo-relations"));
54+
"obx-demo-relations"),
55+
macosApplicationGroup: "objectbox.demo");
5256
return ObjectBox._create(store);
5357
}
5458

objectbox/example/flutter/objectbox_demo_relations/macos/Podfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
platform :osx, '10.13'
1+
# ObjectBox requires macOS 10.15
2+
platform :osx, '10.15'
23

34
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
45
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

objectbox/example/flutter/objectbox_demo_relations/macos/Runner.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@
405405
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
406406
GCC_WARN_UNUSED_FUNCTION = YES;
407407
GCC_WARN_UNUSED_VARIABLE = YES;
408-
MACOSX_DEPLOYMENT_TARGET = 10.13;
408+
MACOSX_DEPLOYMENT_TARGET = 10.15;
409409
MTL_ENABLE_DEBUG_INFO = NO;
410410
SDKROOT = macosx;
411411
SWIFT_COMPILATION_MODE = wholemodule;
@@ -427,7 +427,7 @@
427427
"$(inherited)",
428428
"@executable_path/../Frameworks",
429429
);
430-
MACOSX_DEPLOYMENT_TARGET = 10.13;
430+
MACOSX_DEPLOYMENT_TARGET = 10.15;
431431
PROVISIONING_PROFILE_SPECIFIER = "";
432432
SWIFT_VERSION = 5.0;
433433
};
@@ -485,7 +485,7 @@
485485
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
486486
GCC_WARN_UNUSED_FUNCTION = YES;
487487
GCC_WARN_UNUSED_VARIABLE = YES;
488-
MACOSX_DEPLOYMENT_TARGET = 10.13;
488+
MACOSX_DEPLOYMENT_TARGET = 10.15;
489489
MTL_ENABLE_DEBUG_INFO = YES;
490490
ONLY_ACTIVE_ARCH = YES;
491491
SDKROOT = macosx;
@@ -532,7 +532,7 @@
532532
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
533533
GCC_WARN_UNUSED_FUNCTION = YES;
534534
GCC_WARN_UNUSED_VARIABLE = YES;
535-
MACOSX_DEPLOYMENT_TARGET = 10.13;
535+
MACOSX_DEPLOYMENT_TARGET = 10.15;
536536
MTL_ENABLE_DEBUG_INFO = NO;
537537
SDKROOT = macosx;
538538
SWIFT_COMPILATION_MODE = wholemodule;
@@ -554,7 +554,7 @@
554554
"$(inherited)",
555555
"@executable_path/../Frameworks",
556556
);
557-
MACOSX_DEPLOYMENT_TARGET = 10.13;
557+
MACOSX_DEPLOYMENT_TARGET = 10.15;
558558
PROVISIONING_PROFILE_SPECIFIER = "";
559559
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
560560
SWIFT_VERSION = 5.0;
@@ -575,7 +575,7 @@
575575
"$(inherited)",
576576
"@executable_path/../Frameworks",
577577
);
578-
MACOSX_DEPLOYMENT_TARGET = 10.13;
578+
MACOSX_DEPLOYMENT_TARGET = 10.15;
579579
PROVISIONING_PROFILE_SPECIFIER = "";
580580
SWIFT_VERSION = 5.0;
581581
};

objectbox/example/flutter/objectbox_demo_relations/macos/Runner/DebugProfile.entitlements

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@
88
<true/>
99
<key>com.apple.security.network.server</key>
1010
<true/>
11+
<key>com.apple.security.application-groups</key>
12+
<array>
13+
<string>objectbox.demo</string>
14+
</array>
1115
</dict>
1216
</plist>

objectbox/example/flutter/objectbox_demo_relations/macos/Runner/Release.entitlements

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@
44
<dict>
55
<key>com.apple.security.app-sandbox</key>
66
<true/>
7+
<key>com.apple.security.application-groups</key>
8+
<array>
9+
<string>objectbox.demo</string>
10+
</array>
711
</dict>
812
</plist>

objectbox/example/flutter/objectbox_demo_sync/ios/Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Uncomment this line to define a global platform for your project
2-
# platform :ios, '11.0'
1+
# ObjectBox requires iOS 12.0
2+
platform :ios, '12.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

objectbox/example/flutter/objectbox_demo_sync/lib/objectbox.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@ class ObjectBox {
3737
// On mobile this is typically fine, as each app has its own directory
3838
// structure.
3939

40+
// Note: set macosApplicationGroup for sandboxed macOS applications, see the
41+
// info boxes at https://docs.objectbox.io/getting-started for details.
42+
4043
// Future<Store> openStore() {...} is defined in the generated objectbox.g.dart
4144
final store = await openStore(
4245
directory: p.join(
43-
(await getApplicationDocumentsDirectory()).path, "obx-demo-sync"));
46+
(await getApplicationDocumentsDirectory()).path, "obx-demo-sync"),
47+
macosApplicationGroup: "objectbox.demo");
4448
return ObjectBox._create(store);
4549
}
4650

objectbox/example/flutter/objectbox_demo_sync/macos/Podfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
platform :osx, '10.13'
1+
# ObjectBox requires macOS 10.15
2+
platform :osx, '10.15'
23

34
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
45
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

0 commit comments

Comments
 (0)