Skip to content

Commit

Permalink
ObjectBox Swift database 1.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
greenrobot-team committed Nov 21, 2023
1 parent 4ee28c8 commit e94881e
Show file tree
Hide file tree
Showing 29 changed files with 371 additions and 206 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Expand Up @@ -3,4 +3,4 @@
url = https://github.com/realm/SwiftLint.git
[submodule "Source/external/objectbox-swift-generator"]
path = Source/external/objectbox-swift-generator
url=https://github.com/objectbox/objectbox-swift-generator.git
url=https://github.com/objectbox/objectbox-swift-generator.git
6 changes: 3 additions & 3 deletions Package.swift
Expand Up @@ -6,7 +6,7 @@ import PackageDescription
let package = Package(
name: "ObjectBox",
platforms: [
.iOS(.v11)
.macOS(.v10_15), .iOS(.v12)
],
products: [
.library(
Expand All @@ -16,8 +16,8 @@ let package = Package(
targets: [
.binaryTarget(
name: "ObjectBox",
url: "https://github.com/objectbox/objectbox-swift/releases/download/v1.9.0/ObjectBox-xcframework-1.9.0.zip",
checksum: "039889a100789aaf1b0ae0de4a881f281f4e2c423d890a660eb06b3538c49111"
url: "https://github.com/objectbox/objectbox-swift/releases/download/v1.9.1/ObjectBox-xcframework-1.9.1.zip",
checksum: "e79910ffaac143b84427fa58748a33ce4f5afbad5e6bb2e1f025a239c8fcafd2"
)
]
)
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -118,6 +118,7 @@ Here's a list of ObjectBox releases, and the Swift versions they were compiled w

| ObjectBox version(s) | Swift version |
|:--------------------:|:-------------:|
| 1.9.1 | 5.9 |
| 1.9.0 | 5.8.1 |
| 1.8.1 | 5.7.2 |
| 1.8.0 | 5.7.1 |
Expand Down
66 changes: 38 additions & 28 deletions Source/Gemfile.lock
@@ -1,41 +1,47 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.5)
CFPropertyList (3.0.6)
rexml
activesupport (6.1.7)
activesupport (7.1.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.1)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
base64 (0.2.0)
bigdecimal (3.1.4)
claide (1.1.0)
cocoapods (1.11.3)
cocoapods (1.14.2)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.11.3)
cocoapods-core (= 1.14.2)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.4.0, < 2.0)
cocoapods-downloader (>= 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.4.0, < 2.0)
cocoapods-trunk (>= 1.6.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 1.0, < 3.0)
xcodeproj (>= 1.21.0, < 2.0)
cocoapods-core (1.11.3)
activesupport (>= 5.0, < 7)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.23.0, < 2.0)
cocoapods-core (1.14.2)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
Expand All @@ -45,7 +51,7 @@ GEM
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.6.3)
cocoapods-downloader (2.0)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
Expand All @@ -54,60 +60,64 @@ GEM
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.1.10)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
drb (2.2.0)
ruby2_keywords
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.15.5)
ffi (1.16.3)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.12.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
jazzy (0.14.3)
jazzy (0.14.4)
cocoapods (~> 1.5)
mustache (~> 1.1)
open4 (~> 1.3)
redcarpet (~> 3.4)
rexml (~> 3.2)
rouge (>= 2.0.6, < 4.0)
rouge (>= 2.0.6, < 5.0)
sassc (~> 2.1)
sqlite3 (~> 1.3)
xcinvoke (~> 0.3.0)
json (2.6.3)
liferaft (0.0.6)
mini_portile2 (2.8.0)
minitest (5.16.3)
mini_portile2 (2.8.5)
minitest (5.20.0)
molinillo (0.8.0)
mustache (1.1.1)
mutex_m (0.2.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
open4 (1.3.4)
public_suffix (4.0.7)
redcarpet (3.5.1)
rexml (3.2.5)
rouge (3.30.0)
redcarpet (3.6.0)
rexml (3.2.6)
rouge (4.2.0)
ruby-macho (2.5.1)
ruby2_keywords (0.0.5)
sassc (2.4.0)
ffi (~> 1.9)
sqlite3 (1.5.4)
sqlite3 (1.6.8)
mini_portile2 (~> 2.8.0)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (2.0.5)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcinvoke (0.3.0)
liferaft (~> 0.0.6)
xcodeproj (1.22.0)
xcodeproj (1.23.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
zeitwerk (2.6.6)

PLATFORMS
ruby
Expand All @@ -120,4 +130,4 @@ RUBY VERSION
ruby 3.0.3p157

BUNDLED WITH
2.2.32
2.2.33
8 changes: 1 addition & 7 deletions Source/Makefile
@@ -1,23 +1,17 @@
SWIFT_LINT_PATH=$(shell pwd)/external/SwiftLint
SOURCERY_PATH=$(shell pwd)/external/objectbox-swift-generator
FRAMEWORK_PATH=$(shell pwd)/ios-framework

GREEN=\033[0;32m
RED=\033[0;31m
BLUE=\033[1;34m
NC=\033[0m # No color

all: build_swiftlint build_sourcery
all: build_swiftlint

build_swiftlint:
@echo "$(BLUE)Building SwiftLint...$(NC)"
@echo $(SWIFT_LINT_PATH)
(cd "$(SWIFT_LINT_PATH)"; make build)

build_sourcery:
@echo "$(BLUE)Building Sourcery...$(NC)"
@echo $(SOURCERY_PATH)
(cd "$(SOURCERY_PATH)"; rake build)

archive_framework:
(cd "$(FRAMEWORK_PATH)"; make all)
17 changes: 8 additions & 9 deletions Source/create-xcframework.sh
@@ -1,15 +1,19 @@
#!/usr/bin/env bash
set -e

# macOS does not have realpath and readlink does not have -f option, so do this instead:
myDir=$( cd "$(dirname "$0")" ; pwd -P )

myDir=$( readlink -f "$(dirname "$0")" )
cd "${myDir}/ios-framework"
dir_build="${myDir}/build-deploy"
mkdir -p "$dir_build"
derived_data_path=$( mktemp -d )

# Since Xcode 15 xcodebuild expects canonical paths.
# mktemp creates in /var which is actually /private/var on macOS.
derived_data_path=$( readlink -f $( mktemp -d ) )
mkdir -p $derived_data_path

echo "dir_build=$dir_build"
echo "derived_data_path=$derived_data_path"

xcodebuild -version

function build() {
Expand All @@ -26,11 +30,6 @@ function build() {

build "ObjectBox-macOS" "platform=macOS"
build "ObjectBox-iOS" "generic/platform=iOS"

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

echo "************* Building XCFramework *************"
Expand Down
2 changes: 1 addition & 1 deletion Source/external/objectbox-swift-generator
Submodule objectbox-swift-generator updated 50 files
+1 −1 .ruby-version
+0 −4 ObjectBox/IdSyncModel.swift
+11 −4 ObjectBox/ObjectBoxGenerator.swift
+7 −1 ObjectBox/Schema.swift
+2 −2 Podfile.lock
+2 −2 Pods/Manifest.lock
+2 −2 Pods/Pods.xcodeproj/project.pbxproj
+1 −1 Pods/Target Support Files/AEXML/AEXML.debug.xcconfig
+1 −1 Pods/Target Support Files/AEXML/AEXML.release.xcconfig
+1 −1 Pods/Target Support Files/Commander/Commander.debug.xcconfig
+1 −1 Pods/Target Support Files/Commander/Commander.release.xcconfig
+1 −1 Pods/Target Support Files/Nimble/Nimble.debug.xcconfig
+1 −1 Pods/Target Support Files/Nimble/Nimble.release.xcconfig
+1 −1 Pods/Target Support Files/PathKit/PathKit.debug.xcconfig
+1 −1 Pods/Target Support Files/PathKit/PathKit.release.xcconfig
+1 −1 Pods/Target Support Files/Pods-CodableContextTests/Pods-CodableContextTests-frameworks.sh
+2 −2 Pods/Target Support Files/Pods-CodableContextTests/Pods-CodableContextTests.debug.xcconfig
+2 −2 Pods/Target Support Files/Pods-CodableContextTests/Pods-CodableContextTests.release.xcconfig
+1 −1 Pods/Target Support Files/Pods-Sourcery/Pods-Sourcery-frameworks.sh
+2 −2 Pods/Target Support Files/Pods-Sourcery/Pods-Sourcery.debug.xcconfig
+2 −2 Pods/Target Support Files/Pods-Sourcery/Pods-Sourcery.release.xcconfig
+2 −2 Pods/Target Support Files/Pods-SourceryFramework/Pods-SourceryFramework.debug.xcconfig
+2 −2 Pods/Target Support Files/Pods-SourceryFramework/Pods-SourceryFramework.release.xcconfig
+2 −2 Pods/Target Support Files/Pods-SourceryJS/Pods-SourceryJS.debug.xcconfig
+2 −2 Pods/Target Support Files/Pods-SourceryJS/Pods-SourceryJS.release.xcconfig
+2 −2 Pods/Target Support Files/Pods-SourcerySwift/Pods-SourcerySwift.debug.xcconfig
+2 −2 Pods/Target Support Files/Pods-SourcerySwift/Pods-SourcerySwift.release.xcconfig
+1 −1 Pods/Target Support Files/Pods-SourceryTests/Pods-SourceryTests-frameworks.sh
+2 −2 Pods/Target Support Files/Pods-SourceryTests/Pods-SourceryTests.debug.xcconfig
+2 −2 Pods/Target Support Files/Pods-SourceryTests/Pods-SourceryTests.release.xcconfig
+2 −2 Pods/Target Support Files/Pods-SourceryUtils/Pods-SourceryUtils.debug.xcconfig
+2 −2 Pods/Target Support Files/Pods-SourceryUtils/Pods-SourceryUtils.release.xcconfig
+1 −1 Pods/Target Support Files/Pods-TemplatesTests/Pods-TemplatesTests-frameworks.sh
+2 −2 Pods/Target Support Files/Pods-TemplatesTests/Pods-TemplatesTests.debug.xcconfig
+2 −2 Pods/Target Support Files/Pods-TemplatesTests/Pods-TemplatesTests.release.xcconfig
+1 −1 Pods/Target Support Files/Quick/Quick.debug.xcconfig
+1 −1 Pods/Target Support Files/Quick/Quick.release.xcconfig
+1 −1 Pods/Target Support Files/SWXMLHash/SWXMLHash.debug.xcconfig
+1 −1 Pods/Target Support Files/SWXMLHash/SWXMLHash.release.xcconfig
+1 −1 Pods/Target Support Files/SourceKittenFramework/SourceKittenFramework.debug.xcconfig
+1 −1 Pods/Target Support Files/SourceKittenFramework/SourceKittenFramework.release.xcconfig
+1 −1 Pods/Target Support Files/Stencil/Stencil.debug.xcconfig
+1 −1 Pods/Target Support Files/Stencil/Stencil.release.xcconfig
+1 −1 Pods/Target Support Files/StencilSwiftKit/StencilSwiftKit.debug.xcconfig
+1 −1 Pods/Target Support Files/StencilSwiftKit/StencilSwiftKit.release.xcconfig
+1 −1 Pods/Target Support Files/Yams/Yams.debug.xcconfig
+1 −1 Pods/Target Support Files/Yams/Yams.release.xcconfig
+1 −1 Pods/Target Support Files/xcproj/xcproj.debug.xcconfig
+1 −1 Pods/Target Support Files/xcproj/xcproj.release.xcconfig
+1 −1 SourceryUtils/Sources/Version.swift
13 changes: 12 additions & 1 deletion Source/fetch_dependencies.command
Expand Up @@ -22,6 +22,12 @@ else
staging_repo=false
fi

clean_build=true
if [ "${1:-}" == "--dirty" ]; then
clean_build=false
shift
fi

# macOS does not have realpath and readlink does not have -f option, so do this instead:
my_dir=$( cd "$(dirname "$0")" ; pwd -P )

Expand Down Expand Up @@ -74,6 +80,11 @@ if [ -d "$code_dir" ] && [ "$staging_repo" != "true" ]; then # Do we have an exi
sleep 0.5
fi
if [ "$do_build" = true ]; then
if [ "$clean_build" == "true" ]; then
# By default, we clean: after an update, we had issues with standard C includes not found and cleaning helped
echo "Cleaning $code_dir/cbuild/ ..."
rm -Rf $code_dir/cbuild/
fi
"$code_dir/scripts/apple-build-static-libs.sh" $build_params "$dest_dir" release
if [ "$git_clean" = true ] ; then # clean before?
git_status=${git_status#"?? objectbox/src/main/cpp/external/uws-objectbox/"}
Expand All @@ -88,7 +99,7 @@ if [ -d "$code_dir" ] && [ "$staging_repo" != "true" ]; then # Do we have an exi
popd
else # Download static public release and unzip into $dest
if [ ! -d "${dest_dir}" ] || [ ! -e "${dest_dir}/libObjectBoxCore-iOS.a" ]; then
version=1.9.0
version=1.9.1
c_version=0.19.0
archive_path="${my_dir}/external/objectbox-static.zip"
if [ "$staging_repo" == "true" ]; then
Expand Down
Expand Up @@ -3119,7 +3119,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -3174,7 +3174,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
Expand Down
Expand Up @@ -156,7 +156,7 @@ extension Book: ObjectBox.EntityInspectable {
let entityBuilder = try modelBuilder.entityBuilder(for: Book.self, id: 2, uid: 21504)
try entityBuilder.addProperty(name: "id", type: PropertyType.long, flags: [.id], id: 1, uid: 17664)
try entityBuilder.addProperty(name: "name", type: PropertyType.string, id: 2, uid: 18688)
try entityBuilder.addToOneRelation(name: "author", targetEntityInfo: ToOne<Author>.Target.entityInfo, id: 3, uid: 20736, indexId: 1, indexUid: 19712)
try entityBuilder.addToOneRelation(name: "author", targetEntityInfo: ToOne<Author>.Target.entityInfo, flags: [.indexed, .indexPartialSkipZero], id: 3, uid: 20736, indexId: 1, indexUid: 19712)

try entityBuilder.lastProperty(id: 3, uid: 20736)
}
Expand Down
Expand Up @@ -156,7 +156,7 @@ extension Book: ObjectBox.EntityInspectable {
let entityBuilder = try modelBuilder.entityBuilder(for: Book.self, id: 2, uid: 21504)
try entityBuilder.addProperty(name: "id", type: PropertyType.long, flags: [.id], id: 1, uid: 17664)
try entityBuilder.addProperty(name: "name", type: PropertyType.string, id: 2, uid: 18688)
try entityBuilder.addToOneRelation(name: "author", targetEntityInfo: ToOne<Author>.Target.entityInfo, id: 3, uid: 20736, indexId: 1, indexUid: 19712)
try entityBuilder.addToOneRelation(name: "author", targetEntityInfo: ToOne<Author>.Target.entityInfo, flags: [.indexed, .indexPartialSkipZero], id: 3, uid: 20736, indexId: 1, indexUid: 19712)

try entityBuilder.lastProperty(id: 3, uid: 20736)
}
Expand Down
Expand Up @@ -39,7 +39,7 @@
"type": 9
},
{
"flags": 8,
"flags": 520,
"id": "3:20736",
"indexId": "1:19712",
"name": "author",
Expand Down
Expand Up @@ -39,7 +39,7 @@
"type": 9
},
{
"flags": 8,
"flags": 520,
"id": "3:20736",
"indexId": "1:19712",
"name": "author",
Expand Down
Expand Up @@ -74,12 +74,8 @@ public class EntityBuilder<T> {
/// Add a to-one-relation (e.g. a pointer from a parent to its children) to the model.
public func addToOneRelation(name: String, targetEntityInfo: EntityInfo, flags: [PropertyFlags] = [],
id propertyID: UInt32, uid propertyUID: UInt64,
indexId indexID: UInt32, indexUid indexUID: UInt64) throws {
var finalFlags = flags
finalFlags.append(.indexed)
finalFlags.append(.indexPartialSkipZero)

try addProperty(name: name, type: .relation, flags: finalFlags, id: propertyID, uid: propertyUID,
indexId indexID: UInt32, indexUid indexUID: UInt64) throws {
try addProperty(name: name, type: .relation, flags: flags, id: propertyID, uid: propertyUID,
indexId: indexID, indexUid: indexUID)

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

0 comments on commit e94881e

Please sign in to comment.