Skip to content

Commit e94881e

Browse files
ObjectBox Swift database 1.9.1
1 parent 4ee28c8 commit e94881e

29 files changed

+371
-206
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
url = https://github.com/realm/SwiftLint.git
44
[submodule "Source/external/objectbox-swift-generator"]
55
path = Source/external/objectbox-swift-generator
6-
url=https://github.com/objectbox/objectbox-swift-generator.git
6+
url=https://github.com/objectbox/objectbox-swift-generator.git

Package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import PackageDescription
66
let package = Package(
77
name: "ObjectBox",
88
platforms: [
9-
.iOS(.v11)
9+
.macOS(.v10_15), .iOS(.v12)
1010
],
1111
products: [
1212
.library(
@@ -16,8 +16,8 @@ let package = Package(
1616
targets: [
1717
.binaryTarget(
1818
name: "ObjectBox",
19-
url: "https://github.com/objectbox/objectbox-swift/releases/download/v1.9.0/ObjectBox-xcframework-1.9.0.zip",
20-
checksum: "039889a100789aaf1b0ae0de4a881f281f4e2c423d890a660eb06b3538c49111"
19+
url: "https://github.com/objectbox/objectbox-swift/releases/download/v1.9.1/ObjectBox-xcframework-1.9.1.zip",
20+
checksum: "e79910ffaac143b84427fa58748a33ce4f5afbad5e6bb2e1f025a239c8fcafd2"
2121
)
2222
]
2323
)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ Here's a list of ObjectBox releases, and the Swift versions they were compiled w
118118

119119
| ObjectBox version(s) | Swift version |
120120
|:--------------------:|:-------------:|
121+
| 1.9.1 | 5.9 |
121122
| 1.9.0 | 5.8.1 |
122123
| 1.8.1 | 5.7.2 |
123124
| 1.8.0 | 5.7.1 |

Source/Gemfile.lock

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,47 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
CFPropertyList (3.0.5)
4+
CFPropertyList (3.0.6)
55
rexml
6-
activesupport (6.1.7)
6+
activesupport (7.1.2)
7+
base64
8+
bigdecimal
79
concurrent-ruby (~> 1.0, >= 1.0.2)
10+
connection_pool (>= 2.2.5)
11+
drb
812
i18n (>= 1.6, < 2)
913
minitest (>= 5.1)
14+
mutex_m
1015
tzinfo (~> 2.0)
11-
zeitwerk (~> 2.3)
12-
addressable (2.8.1)
16+
addressable (2.8.5)
1317
public_suffix (>= 2.0.2, < 6.0)
1418
algoliasearch (1.27.5)
1519
httpclient (~> 2.8, >= 2.8.3)
1620
json (>= 1.5.1)
1721
atomos (0.1.3)
22+
base64 (0.2.0)
23+
bigdecimal (3.1.4)
1824
claide (1.1.0)
19-
cocoapods (1.11.3)
25+
cocoapods (1.14.2)
2026
addressable (~> 2.8)
2127
claide (>= 1.0.2, < 2.0)
22-
cocoapods-core (= 1.11.3)
28+
cocoapods-core (= 1.14.2)
2329
cocoapods-deintegrate (>= 1.0.3, < 2.0)
24-
cocoapods-downloader (>= 1.4.0, < 2.0)
30+
cocoapods-downloader (>= 2.0)
2531
cocoapods-plugins (>= 1.0.0, < 2.0)
2632
cocoapods-search (>= 1.0.0, < 2.0)
27-
cocoapods-trunk (>= 1.4.0, < 2.0)
33+
cocoapods-trunk (>= 1.6.0, < 2.0)
2834
cocoapods-try (>= 1.1.0, < 2.0)
2935
colored2 (~> 3.1)
3036
escape (~> 0.0.4)
3137
fourflusher (>= 2.3.0, < 3.0)
3238
gh_inspector (~> 1.0)
3339
molinillo (~> 0.8.0)
3440
nap (~> 1.0)
35-
ruby-macho (>= 1.0, < 3.0)
36-
xcodeproj (>= 1.21.0, < 2.0)
37-
cocoapods-core (1.11.3)
38-
activesupport (>= 5.0, < 7)
41+
ruby-macho (>= 2.3.0, < 3.0)
42+
xcodeproj (>= 1.23.0, < 2.0)
43+
cocoapods-core (1.14.2)
44+
activesupport (>= 5.0, < 8)
3945
addressable (~> 2.8)
4046
algoliasearch (~> 1.0)
4147
concurrent-ruby (~> 1.1)
@@ -45,7 +51,7 @@ GEM
4551
public_suffix (~> 4.0)
4652
typhoeus (~> 1.0)
4753
cocoapods-deintegrate (1.0.5)
48-
cocoapods-downloader (1.6.3)
54+
cocoapods-downloader (2.0)
4955
cocoapods-plugins (1.0.0)
5056
nap
5157
cocoapods-search (1.0.1)
@@ -54,60 +60,64 @@ GEM
5460
netrc (~> 0.11)
5561
cocoapods-try (1.2.0)
5662
colored2 (3.1.2)
57-
concurrent-ruby (1.1.10)
63+
concurrent-ruby (1.2.2)
64+
connection_pool (2.4.1)
65+
drb (2.2.0)
66+
ruby2_keywords
5867
escape (0.0.4)
5968
ethon (0.16.0)
6069
ffi (>= 1.15.0)
61-
ffi (1.15.5)
70+
ffi (1.16.3)
6271
fourflusher (2.3.1)
6372
fuzzy_match (2.0.4)
6473
gh_inspector (1.1.3)
6574
httpclient (2.8.3)
66-
i18n (1.12.0)
75+
i18n (1.14.1)
6776
concurrent-ruby (~> 1.0)
68-
jazzy (0.14.3)
77+
jazzy (0.14.4)
6978
cocoapods (~> 1.5)
7079
mustache (~> 1.1)
7180
open4 (~> 1.3)
7281
redcarpet (~> 3.4)
7382
rexml (~> 3.2)
74-
rouge (>= 2.0.6, < 4.0)
83+
rouge (>= 2.0.6, < 5.0)
7584
sassc (~> 2.1)
7685
sqlite3 (~> 1.3)
7786
xcinvoke (~> 0.3.0)
7887
json (2.6.3)
7988
liferaft (0.0.6)
80-
mini_portile2 (2.8.0)
81-
minitest (5.16.3)
89+
mini_portile2 (2.8.5)
90+
minitest (5.20.0)
8291
molinillo (0.8.0)
8392
mustache (1.1.1)
93+
mutex_m (0.2.0)
8494
nanaimo (0.3.0)
8595
nap (1.1.0)
8696
netrc (0.11.0)
8797
open4 (1.3.4)
8898
public_suffix (4.0.7)
89-
redcarpet (3.5.1)
90-
rexml (3.2.5)
91-
rouge (3.30.0)
99+
redcarpet (3.6.0)
100+
rexml (3.2.6)
101+
rouge (4.2.0)
92102
ruby-macho (2.5.1)
103+
ruby2_keywords (0.0.5)
93104
sassc (2.4.0)
94105
ffi (~> 1.9)
95-
sqlite3 (1.5.4)
106+
sqlite3 (1.6.8)
96107
mini_portile2 (~> 2.8.0)
97108
typhoeus (1.4.0)
98109
ethon (>= 0.9.0)
99-
tzinfo (2.0.5)
110+
tzinfo (2.0.6)
100111
concurrent-ruby (~> 1.0)
101112
xcinvoke (0.3.0)
102113
liferaft (~> 0.0.6)
103-
xcodeproj (1.22.0)
114+
xcodeproj (1.23.0)
104115
CFPropertyList (>= 2.3.3, < 4.0)
105116
atomos (~> 0.1.3)
106117
claide (>= 1.0.2, < 2.0)
107118
colored2 (~> 3.1)
108119
nanaimo (~> 0.3.0)
109120
rexml (~> 3.2.4)
110-
zeitwerk (2.6.6)
111121

112122
PLATFORMS
113123
ruby
@@ -120,4 +130,4 @@ RUBY VERSION
120130
ruby 3.0.3p157
121131

122132
BUNDLED WITH
123-
2.2.32
133+
2.2.33

Source/Makefile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
SWIFT_LINT_PATH=$(shell pwd)/external/SwiftLint
2-
SOURCERY_PATH=$(shell pwd)/external/objectbox-swift-generator
32
FRAMEWORK_PATH=$(shell pwd)/ios-framework
43

54
GREEN=\033[0;32m
65
RED=\033[0;31m
76
BLUE=\033[1;34m
87
NC=\033[0m # No color
98

10-
all: build_swiftlint build_sourcery
9+
all: build_swiftlint
1110

1211
build_swiftlint:
1312
@echo "$(BLUE)Building SwiftLint...$(NC)"
1413
@echo $(SWIFT_LINT_PATH)
1514
(cd "$(SWIFT_LINT_PATH)"; make build)
1615

17-
build_sourcery:
18-
@echo "$(BLUE)Building Sourcery...$(NC)"
19-
@echo $(SOURCERY_PATH)
20-
(cd "$(SOURCERY_PATH)"; rake build)
21-
2216
archive_framework:
2317
(cd "$(FRAMEWORK_PATH)"; make all)

Source/create-xcframework.sh

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
#!/usr/bin/env bash
22
set -e
33

4-
# macOS does not have realpath and readlink does not have -f option, so do this instead:
5-
myDir=$( cd "$(dirname "$0")" ; pwd -P )
6-
4+
myDir=$( readlink -f "$(dirname "$0")" )
75
cd "${myDir}/ios-framework"
86
dir_build="${myDir}/build-deploy"
97
mkdir -p "$dir_build"
10-
derived_data_path=$( mktemp -d )
8+
9+
# Since Xcode 15 xcodebuild expects canonical paths.
10+
# mktemp creates in /var which is actually /private/var on macOS.
11+
derived_data_path=$( readlink -f $( mktemp -d ) )
1112
mkdir -p $derived_data_path
1213

14+
echo "dir_build=$dir_build"
15+
echo "derived_data_path=$derived_data_path"
16+
1317
xcodebuild -version
1418

1519
function build() {
@@ -26,11 +30,6 @@ function build() {
2630

2731
build "ObjectBox-macOS" "platform=macOS"
2832
build "ObjectBox-iOS" "generic/platform=iOS"
29-
30-
# Note: Attempt to build simulator target twice.
31-
# The first time will fail to build obx_fbb with bitcode the second try will succeed.
32-
# This is a workaround to an unknown (at time) problem.
33-
build "ObjectBox-iOS Simulator" "generic/platform=iOS Simulator"
3433
build "ObjectBox-iOS Simulator" "generic/platform=iOS Simulator"
3534

3635
echo "************* Building XCFramework *************"

Source/fetch_dependencies.command

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ else
2222
staging_repo=false
2323
fi
2424

25+
clean_build=true
26+
if [ "${1:-}" == "--dirty" ]; then
27+
clean_build=false
28+
shift
29+
fi
30+
2531
# macOS does not have realpath and readlink does not have -f option, so do this instead:
2632
my_dir=$( cd "$(dirname "$0")" ; pwd -P )
2733

@@ -74,6 +80,11 @@ if [ -d "$code_dir" ] && [ "$staging_repo" != "true" ]; then # Do we have an exi
7480
sleep 0.5
7581
fi
7682
if [ "$do_build" = true ]; then
83+
if [ "$clean_build" == "true" ]; then
84+
# By default, we clean: after an update, we had issues with standard C includes not found and cleaning helped
85+
echo "Cleaning $code_dir/cbuild/ ..."
86+
rm -Rf $code_dir/cbuild/
87+
fi
7788
"$code_dir/scripts/apple-build-static-libs.sh" $build_params "$dest_dir" release
7889
if [ "$git_clean" = true ] ; then # clean before?
7990
git_status=${git_status#"?? objectbox/src/main/cpp/external/uws-objectbox/"}
@@ -88,7 +99,7 @@ if [ -d "$code_dir" ] && [ "$staging_repo" != "true" ]; then # Do we have an exi
8899
popd
89100
else # Download static public release and unzip into $dest
90101
if [ ! -d "${dest_dir}" ] || [ ! -e "${dest_dir}/libObjectBoxCore-iOS.a" ]; then
91-
version=1.9.0
102+
version=1.9.1
92103
c_version=0.19.0
93104
archive_path="${my_dir}/external/objectbox-static.zip"
94105
if [ "$staging_repo" == "true" ]; then

Source/ios-framework/CodeGenTests/ToolTestProject.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3119,7 +3119,7 @@
31193119
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
31203120
GCC_WARN_UNUSED_FUNCTION = YES;
31213121
GCC_WARN_UNUSED_VARIABLE = YES;
3122-
MACOSX_DEPLOYMENT_TARGET = 10.14;
3122+
MACOSX_DEPLOYMENT_TARGET = 10.15;
31233123
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
31243124
MTL_FAST_MATH = YES;
31253125
ONLY_ACTIVE_ARCH = YES;
@@ -3174,7 +3174,7 @@
31743174
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
31753175
GCC_WARN_UNUSED_FUNCTION = YES;
31763176
GCC_WARN_UNUSED_VARIABLE = YES;
3177-
MACOSX_DEPLOYMENT_TARGET = 10.14;
3177+
MACOSX_DEPLOYMENT_TARGET = 10.15;
31783178
MTL_ENABLE_DEBUG_INFO = NO;
31793179
MTL_FAST_MATH = YES;
31803180
SDKROOT = macosx;

Source/ios-framework/CodeGenTests/expected/entity-info/EntityInfo.generated43.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ extension Book: ObjectBox.EntityInspectable {
156156
let entityBuilder = try modelBuilder.entityBuilder(for: Book.self, id: 2, uid: 21504)
157157
try entityBuilder.addProperty(name: "id", type: PropertyType.long, flags: [.id], id: 1, uid: 17664)
158158
try entityBuilder.addProperty(name: "name", type: PropertyType.string, id: 2, uid: 18688)
159-
try entityBuilder.addToOneRelation(name: "author", targetEntityInfo: ToOne<Author>.Target.entityInfo, id: 3, uid: 20736, indexId: 1, indexUid: 19712)
159+
try entityBuilder.addToOneRelation(name: "author", targetEntityInfo: ToOne<Author>.Target.entityInfo, flags: [.indexed, .indexPartialSkipZero], id: 3, uid: 20736, indexId: 1, indexUid: 19712)
160160

161161
try entityBuilder.lastProperty(id: 3, uid: 20736)
162162
}

Source/ios-framework/CodeGenTests/expected/entity-info/EntityInfo.generated53.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ extension Book: ObjectBox.EntityInspectable {
156156
let entityBuilder = try modelBuilder.entityBuilder(for: Book.self, id: 2, uid: 21504)
157157
try entityBuilder.addProperty(name: "id", type: PropertyType.long, flags: [.id], id: 1, uid: 17664)
158158
try entityBuilder.addProperty(name: "name", type: PropertyType.string, id: 2, uid: 18688)
159-
try entityBuilder.addToOneRelation(name: "author", targetEntityInfo: ToOne<Author>.Target.entityInfo, id: 3, uid: 20736, indexId: 1, indexUid: 19712)
159+
try entityBuilder.addToOneRelation(name: "author", targetEntityInfo: ToOne<Author>.Target.entityInfo, flags: [.indexed, .indexPartialSkipZero], id: 3, uid: 20736, indexId: 1, indexUid: 19712)
160160

161161
try entityBuilder.lastProperty(id: 3, uid: 20736)
162162
}

Source/ios-framework/CodeGenTests/expected/model/model38.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"type": 9
4040
},
4141
{
42-
"flags": 8,
42+
"flags": 520,
4343
"id": "3:20736",
4444
"indexId": "1:19712",
4545
"name": "author",

Source/ios-framework/CodeGenTests/expected/model/model39.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"type": 9
4040
},
4141
{
42-
"flags": 8,
42+
"flags": 520,
4343
"id": "3:20736",
4444
"indexId": "1:19712",
4545
"name": "author",

Source/ios-framework/CommonSource/Entities/EntityBuilder.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,8 @@ public class EntityBuilder<T> {
7474
/// Add a to-one-relation (e.g. a pointer from a parent to its children) to the model.
7575
public func addToOneRelation(name: String, targetEntityInfo: EntityInfo, flags: [PropertyFlags] = [],
7676
id propertyID: UInt32, uid propertyUID: UInt64,
77-
indexId indexID: UInt32, indexUid indexUID: UInt64) throws {
78-
var finalFlags = flags
79-
finalFlags.append(.indexed)
80-
finalFlags.append(.indexPartialSkipZero)
81-
82-
try addProperty(name: name, type: .relation, flags: finalFlags, id: propertyID, uid: propertyUID,
77+
indexId indexID: UInt32, indexUid indexUID: UInt64) throws {
78+
try addProperty(name: name, type: .relation, flags: flags, id: propertyID, uid: propertyUID,
8379
indexId: indexID, indexUid: indexUID)
8480

8581
let err1 = obx_model_property_relation(model, targetEntityInfo.entityName, indexID, indexUID)

0 commit comments

Comments
 (0)