Skip to content

Commit 044f323

Browse files
committed
1.5.0 collected changes, part 2, e.g. objectbox-c-sync.h
1 parent 071b4a3 commit 044f323

File tree

10 files changed

+549
-312
lines changed

10 files changed

+549
-312
lines changed

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,10 @@ Carthage/Checkouts
3737
.idea/
3838

3939
# ObjectBox model backups
40-
*.json.bak
40+
*.json.bak
41+
42+
#DBs
43+
*.mdb
44+
45+
# E.g. built frameworks
46+
*.zip

Source/fetch_dependencies.command

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,25 @@ if [ -d "$code_dir" ]; then # Do we have an existing code repo?
4343
git_status=$(git status --porcelain)
4444
# ignore untracked uws submodule (left over when switching from a sync to a non-sync branch)
4545
git_status=${git_status#"?? objectbox/src/main/cpp/external/uws-objectbox/"}
46+
# Note: doing a mini pause so the color state emoji can be perceived before scrolling it off the screen
4647
if [ -z "$git_status" ]; then
4748
git_clean=true
4849
if [ -f "${cache_zip}" ]; then
49-
echo "ObjectBox core is clean and cache ZIP found for ${cache_key}. Extracting..."
50+
echo "🟢 ObjectBox core is clean and cache ZIP found for ${cache_key}."
51+
echo "📦 Extracting..."
52+
sleep 0.5
5053
unzip -o "${cache_zip}" -d "${dest_dir}"
5154
do_build=false
5255
else
53-
echo "ObjectBox core is clean but no cache ZIP found for ${cache_key}. Building..."
54-
fi
56+
echo "⚪ ObjectBox core is clean but no cache ZIP found for ${cache_key}."
57+
echo "🏗️ Building..."
58+
sleep 0.5
59+
fi
5560
else
5661
git status
57-
echo "ObjectBox core is not clean, won't use caching. Building..."
62+
echo "🔴 ObjectBox core is not clean, won't use caching. 🏗️ Building..."
63+
echo "🏗️ Building..."
64+
sleep 0.5
5865
fi
5966
if [ "$do_build" = true ]; then
6067
"$code_dir/scripts/apple-build-static-libs.sh" $build_params "$dest_dir" release
@@ -95,7 +102,10 @@ fi
95102
fi # verify_only
96103

97104
# Update the header file actually used by our Swift sources
98-
cp "$dest_dir/objectbox.h" "ios-framework/CommonSource/Internal/objectbox-c.h"
105+
c_header_dir="ios-framework/CommonSource/Internal"
106+
cp "$dest_dir/objectbox.h" "${c_header_dir}/objectbox-c.h"
107+
cp "$dest_dir/objectbox-sync.h" "${c_header_dir}/objectbox-c-sync.h"
108+
sed -i '' 's/#include "objectbox.h"/#include "objectbox-c.h"/' "${c_header_dir}/objectbox-c-sync.h"
99109

100110
# Print versions for allow verification of built libs (is it the one we expect?)
101111
echo "============================================================================================"

Source/ios-framework/CodeGenTests/RunToolTests.sh

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ mkdir -p $MYOUTPUTDIR
3333
cd ${BUILT_PRODUCTS_DIR}
3434

3535
test_target_num () {
36-
FAIL=0
36+
local FAIL=0 # yuck, FAIL is also a global var
3737

3838
echo "note: ******************** $2: $1 ********************"
3939

@@ -164,7 +164,7 @@ test_target_num () {
164164
}
165165

166166
fail_codegen_target_num () {
167-
FAIL=0
167+
local FAIL=0 # yuck, FAIL is also a global var
168168

169169
echo "note: ******************** $2: $1 ********************"
170170

@@ -280,66 +280,66 @@ FAIL=0
280280

281281
cd "${MYOUTPUTDIR}"
282282

283-
test_target_num "Simple Model" 1 || FAIL=1
284-
test_target_num "Subclassed Model" 2 || FAIL=1
285-
test_target_num "Annotated minimal entity" 3 || FAIL=1
286-
test_target_num "Un-annotated minimal entity" 4 || FAIL=1
287-
test_target_num "Two IDs one annotated" 5 || FAIL=1
288-
fail_codegen_target_num "Two IDs both annotated" 6 || FAIL=1
289-
fail_codegen_target_num "Two IDs none annotated" 7 || FAIL=1
290-
fail_codegen_target_num "Empty Entity" 8 || FAIL=1
291-
test_target_num "ID and 2 strings entity" 9 || FAIL=1
292-
fail_codegen_target_num "NameInDb collision with other property" 10 || FAIL=1
293-
fail_codegen_target_num "Entity with string but no ID" 11 || FAIL=1
294-
test_target_num "Remove A Property" 12 || FAIL=1
295-
test_target_num "Remove A Property and add one at same time" 13 || FAIL=1
296-
test_target_num "Add a Property after having removed one" 14 || FAIL=1
297-
test_target_num "Remove an index from a property" 15 || FAIL=1
298-
test_target_num "Add and remove an index in one go" 16 || FAIL=1
299-
test_target_num "Add an index after having removed one" 17 || FAIL=1
300-
test_target_num "Rename an entity" 18 || FAIL=1
301-
fail_codegen_target_num "Entity UID printing" 19 || FAIL=1
302-
fail_codegen_target_num "New Entity with empty UID" 20 || FAIL=1
303-
test_target_num "Rename a property" 21 || FAIL=1
304-
fail_codegen_target_num "Property UID printing" 22 || FAIL=1
305-
fail_codegen_target_num "New Property with empty UID" 23 || FAIL=1
306-
fail_codegen_target_num "New Property with UID" 24 || FAIL=1
307-
test_target_num "Read/write all our data types" 25 || FAIL=1
308-
test_target_num "Ensure running codegen on unchanged file changes nothing" 26 || FAIL=1
309-
test_target_num "Ensure assigning a previously proposed UID works [Change/Reset]" 27 || FAIL=1
310-
test_target_num "Ensure moving properties changes nothing" 28 || FAIL=1
311-
test_target_num "Ensure moving entities changes nothing" 29 || FAIL=1
312-
test_target_num "Unique Entity Exception Test" 30 || FAIL=1
313-
test_target_num "Struct Entity Test" 31 || FAIL=1
314-
test_target_num "UInt64 as ID Test" 32 || FAIL=1
315-
test_target_num "Data and [UInt8] Test" 33 || FAIL=1
316-
317-
test_target_num "Converter Test" 34 || FAIL=1
318-
test_target_num "Enum Test" 35 || FAIL=1
319-
test_target_num "Standalone Relations" 36 || FAIL=1
320-
test_target_num "Standalone Backlinks" 37 || FAIL=1
321-
test_target_num "Edit ToOne Backlinks" 38 || FAIL=1
322-
test_target_num "Edit ToOne Backlinks Structs" 39 || FAIL=1
323-
test_target_num "Standalone Backlinks Structs" 40 || FAIL=1
324-
fail_codegen_target_num "ToOne Backlink annotation wrong" 41 || FAIL=1
325-
test_target_num "Standalone Relation Queries" 42 || FAIL=1
326-
test_target_num "ToOne Relation Queries" 43 || FAIL=1
327-
test_target_num "many-to-many reset" 44 || FAIL=1
328-
test_target_num "many-to-many backlink reset" 45 || FAIL=1
329-
test_target_num "Threaded ToOne backlink edit" 46 || FAIL=1
330-
test_target_num "Threaded Many-to-many edit" 47 || FAIL=1
331-
test_target_num "Threaded Many-to-many backlink edit" 48 || FAIL=1
332-
test_target_num "Untyped IDs and queries 1" 49 || FAIL=1
333-
test_target_num "Untyped IDs and queries 2" 50 || FAIL=1
334-
#fail_codegen_target_num "Typed IDs still enforce type?" 51 || FAIL=1
335-
336-
fail_codegen_target_num "Ensure we don't write JSON before ID errors" 52 || FAIL=1
337-
test_target_num "ToOne Backlink ensure applyToDb is needed" 53 || FAIL=1
338-
test_target_num "ToMany ensure applyToDb is needed" 54 || FAIL=1
339-
test_target_num "ToMany Backlink ensure applyToDb is needed" 55 || FAIL=1
340-
test_target_num "Swift Property Wrappers are treated as wrapped type" 56 || FAIL=1
341-
test_target_num "Optional Template Syntax recognized as optional" 57 || FAIL=1
342-
343-
echo "note: Finished tests..."
283+
test_target_num "Simple Model" 1 || ((FAIL++))
284+
test_target_num "Subclassed Model" 2 || ((FAIL++))
285+
test_target_num "Annotated minimal entity" 3 || ((FAIL++))
286+
test_target_num "Un-annotated minimal entity" 4 || ((FAIL++))
287+
test_target_num "Two IDs one annotated" 5 || ((FAIL++))
288+
fail_codegen_target_num "Two IDs both annotated" 6 || ((FAIL++))
289+
fail_codegen_target_num "Two IDs none annotated" 7 || ((FAIL++))
290+
fail_codegen_target_num "Empty Entity" 8 || ((FAIL++))
291+
test_target_num "ID and 2 strings entity" 9 || ((FAIL++))
292+
fail_codegen_target_num "NameInDb collision with other property" 10 || ((FAIL++))
293+
fail_codegen_target_num "Entity with string but no ID" 11 || ((FAIL++))
294+
test_target_num "Remove A Property" 12 || ((FAIL++))
295+
test_target_num "Remove A Property and add one at same time" 13 || ((FAIL++))
296+
test_target_num "Add a Property after having removed one" 14 || ((FAIL++))
297+
test_target_num "Remove an index from a property" 15 || ((FAIL++))
298+
test_target_num "Add and remove an index in one go" 16 || ((FAIL++))
299+
test_target_num "Add an index after having removed one" 17 || ((FAIL++))
300+
test_target_num "Rename an entity" 18 || ((FAIL++))
301+
fail_codegen_target_num "Entity UID printing" 19 || ((FAIL++))
302+
fail_codegen_target_num "New Entity with empty UID" 20 || ((FAIL++))
303+
test_target_num "Rename a property" 21 || ((FAIL++))
304+
fail_codegen_target_num "Property UID printing" 22 || ((FAIL++))
305+
fail_codegen_target_num "New Property with empty UID" 23 || ((FAIL++))
306+
fail_codegen_target_num "New Property with UID" 24 || ((FAIL++))
307+
test_target_num "Read/write all our data types" 25 || ((FAIL++))
308+
test_target_num "Ensure running codegen on unchanged file changes nothing" 26 || ((FAIL++))
309+
test_target_num "Ensure assigning a previously proposed UID works [Change/Reset]" 27 || ((FAIL++))
310+
test_target_num "Ensure moving properties changes nothing" 28 || ((FAIL++))
311+
test_target_num "Ensure moving entities changes nothing" 29 || ((FAIL++))
312+
test_target_num "Unique Entity Exception Test" 30 || ((FAIL++))
313+
test_target_num "Struct Entity Test" 31 || ((FAIL++))
314+
test_target_num "UInt64 as ID Test" 32 || ((FAIL++))
315+
test_target_num "Data and [UInt8] Test" 33 || ((FAIL++))
316+
317+
test_target_num "Converter Test" 34 || ((FAIL++))
318+
test_target_num "Enum Test" 35 || ((FAIL++))
319+
test_target_num "Standalone Relations" 36 || ((FAIL++))
320+
test_target_num "Standalone Backlinks" 37 || ((FAIL++))
321+
test_target_num "Edit ToOne Backlinks" 38 || ((FAIL++))
322+
test_target_num "Edit ToOne Backlinks Structs" 39 || ((FAIL++))
323+
test_target_num "Standalone Backlinks Structs" 40 || ((FAIL++))
324+
fail_codegen_target_num "ToOne Backlink annotation wrong" 41 || ((FAIL++))
325+
test_target_num "Standalone Relation Queries" 42 || ((FAIL++))
326+
test_target_num "ToOne Relation Queries" 43 || ((FAIL++))
327+
test_target_num "many-to-many reset" 44 || ((FAIL++))
328+
test_target_num "many-to-many backlink reset" 45 || ((FAIL++))
329+
test_target_num "Threaded ToOne backlink edit" 46 || ((FAIL++))
330+
test_target_num "Threaded Many-to-many edit" 47 || ((FAIL++))
331+
test_target_num "Threaded Many-to-many backlink edit" 48 || ((FAIL++))
332+
test_target_num "Untyped IDs and queries 1" 49 || ((FAIL++))
333+
test_target_num "Untyped IDs and queries 2" 50 || ((FAIL++))
334+
#fail_codegen_target_num "Typed IDs still enforce type?" 51 || ((FAIL++))
335+
336+
fail_codegen_target_num "Ensure we don't write JSON before ID errors" 52 || ((FAIL++))
337+
test_target_num "ToOne Backlink ensure applyToDb is needed" 53 || ((FAIL++))
338+
test_target_num "ToMany ensure applyToDb is needed" 54 || ((FAIL++))
339+
test_target_num "ToMany Backlink ensure applyToDb is needed" 55 || ((FAIL++))
340+
test_target_num "Swift Property Wrappers are treated as wrapped type" 56 || ((FAIL++))
341+
test_target_num "Optional Template Syntax recognized as optional" 57 || ((FAIL++))
342+
343+
echo "note: Finished tests with $FAIL failures"
344344

345345
exit $FAIL

Source/ios-framework/CommonSource/Internal/ObjectBox.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright © 2019 ObjectBox Ltd. All rights reserved.
2+
// Copyright © 2019-2021 ObjectBox Ltd. All rights reserved.
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");
55
// you may not use this file except in compliance with the License.
@@ -17,3 +17,4 @@
1717

1818
#import "obx_fbb.h"
1919
#import "objectbox-c.h"
20+
#import "objectbox-c-sync.h"

0 commit comments

Comments
 (0)