Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query support #81

Merged
merged 97 commits into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
45649a8
Swig POC for jvm cinterops
rorbech Oct 7, 2020
168f786
Swig default wrapper
rorbech Oct 7, 2020
849be28
Move cinterop to its own module
rorbech Oct 14, 2020
48fc1e1
Fixing android interop
rorbech Oct 14, 2020
8ab4890
Add swig as prerequisite
rorbech Oct 14, 2020
e402d11
Add ios cinterop for new C API
rorbech Oct 14, 2020
bab7839
Add core submodule
rorbech Oct 14, 2020
0e1b3d4
Improved Swig wrapper and added cinterop test
rorbech Oct 16, 2020
aafd9ac
Minor build adjustments
rorbech Oct 16, 2020
6c0316c
Remove old C interop layer
rorbech Oct 16, 2020
8f58ed8
Use realm.h from core
rorbech Oct 19, 2020
152827d
Remove legazy import
rorbech Oct 19, 2020
60669b6
Minor clean up
rorbech Oct 19, 2020
48025fc
Native C API test [WIP]
rorbech Oct 19, 2020
060f0e7
fix Cinterop build & add test (still not passing but compiling)
nhachicha Oct 20, 2020
d0f32aa
Use http for git submodules
rorbech Oct 21, 2020
767a7de
Remove experimental jna library module
rorbech Oct 21, 2020
8fea77e
Move Android C API task to more appropriate place in task tree
rorbech Oct 21, 2020
f2b4159
Add updated cmake and swig to Android docker image
rorbech Oct 21, 2020
7d6b55f
Use environment's NDK for C API compilation
rorbech Oct 21, 2020
74eedcd
Fix syntax error
rorbech Oct 21, 2020
8613f7f
Fix syntax error
rorbech Oct 21, 2020
9473df7
Fixing ios test
nhachicha Oct 21, 2020
803485f
Merge branch 'cr/cinterop' of https://github.com/realm/realm-kotlin i…
nhachicha Oct 21, 2020
be8c24b
Use ndk 21.0.6113669
rorbech Oct 21, 2020
202fab8
Fix system image cherry-pick error referencing wrong architecture
rorbech Oct 21, 2020
2e2f3a8
Use Android Gradle Plugins infrastructure to set/get ANDROID_NDK
rorbech Oct 21, 2020
27e3193
Clean Swig-generated wrappers as part of gradle clean task
rorbech Oct 21, 2020
a7f47ae
Refactored cinterop test (ios)
nhachicha Oct 21, 2020
55ac42d
Merge branch 'cr/cinterop' of https://github.com/realm/realm-kotlin i…
nhachicha Oct 21, 2020
eab1567
Using common sourceset for Darwin targets
nhachicha Oct 21, 2020
9a09c1a
Extend JVM C interop wrapper and tests
rorbech Oct 22, 2020
7329557
Merge remote tracking branch 'origin/cr/interop' into cr/cinterop
rorbech Oct 22, 2020
cf4a071
JVM Platform wrapper for primitive Realm operations
rorbech Oct 25, 2020
bbf19df
Connecting Realm API with platform API
rorbech Oct 29, 2020
885b8f5
Merge branch 'master' into cr/platform-api
rorbech Oct 29, 2020
9091c96
Fix up build and tests after merge
rorbech Oct 30, 2020
af25533
Code style check updates
rorbech Oct 30, 2020
0301f0a
Unused import
rorbech Oct 30, 2020
bb644f5
Hooking up accessors with new platform implementation
rorbech Oct 30, 2020
3a0e772
Minor clean ups
rorbech Nov 2, 2020
0d87170
Remove function names from C API errors as they are already in the st…
rorbech Nov 2, 2020
10a0232
Missing import
rorbech Nov 2, 2020
ae180e9
Platform API implementation for darwin
rorbech Nov 6, 2020
7c72542
Removed main source set from tests
rorbech Nov 6, 2020
4d7538c
Another round for ktlint and detekt
rorbech Nov 6, 2020
1ab302c
Fix CI tests
rorbech Nov 6, 2020
0c32999
Update expected IR output
rorbech Nov 6, 2020
45b3f99
Updates according to code review
rorbech Nov 9, 2020
71cdc40
Add official kmm-sample project from git@github.com:Kotlin/kmm-sample…
rorbech Nov 11, 2020
fca784f
kmm-sample: Enabled realm-kotlin plugin
rorbech Nov 11, 2020
abcbfb0
kmm-sample: Add expression repository with history of calculations
rorbech Nov 11, 2020
56ffdff
Remove old example
rorbech Nov 11, 2020
f54318a
Minor updates
rorbech Nov 11, 2020
be8a130
Fix path issues on ios
rorbech Nov 11, 2020
e7e3fc3
Minor updates
rorbech Nov 12, 2020
738edb5
Bypass tests requiring cinterop-jvm JNI implementation
rorbech Nov 12, 2020
82489af
Yet another round for static checks
rorbech Nov 12, 2020
aaa8e7b
Merge branch 'cr/platform-api' into cr/kmm-sample
rorbech Nov 12, 2020
902020e
Add issue reference on a FIXME
rorbech Nov 13, 2020
70d3270
Enable linting for example project
rorbech Nov 15, 2020
5bb7f32
Move kmmsample to io.realm.example.kmmsample package
rorbech Nov 15, 2020
bb57d86
Updates from code review
rorbech Nov 16, 2020
445db84
Move kmmsample tests to io.realm.example.kmmsample package
rorbech Nov 16, 2020
05920cc
Merge branch 'master' into cr/kmm-sample
rorbech Nov 16, 2020
a6543c6
Fix test
rorbech Nov 17, 2020
1ba21fa
Remove return value of objectGetString
rorbech Nov 17, 2020
5d08623
Add end of file new lines
rorbech Nov 17, 2020
4118086
Add gradle wrapper jar for kmm-sample project
rorbech Nov 17, 2020
0320fad
Add buildSrc symbolic link for kmm-sample project
rorbech Nov 17, 2020
c9243dd
Debug statement to investigate CI issue
rorbech Nov 17, 2020
3a46a14
Fix lint config search path
rorbech Nov 17, 2020
affa9ad
Clarification of FIXMEs
rorbech Nov 18, 2020
c90d5aa
Work around issue with relative paths in cinterops' def files
rorbech Nov 19, 2020
4756d8d
Merge branch 'master' into cr/fixme-categorization
rorbech Nov 20, 2020
32bee6b
Another round for linting
rorbech Nov 20, 2020
e516c2b
Merge branch 'master' into cr/fixme-categorization
rorbech Nov 20, 2020
b38991d
Minor fixes
rorbech Nov 20, 2020
f4ce329
Fix cinterop library paths
rorbech Nov 23, 2020
9d46fc4
Initial query implementation (jvm-only)
rorbech Nov 25, 2020
fdb3c78
Another round for linting
rorbech Nov 25, 2020
967508c
Lazy evaluated queries
rorbech Nov 25, 2020
10704f9
Removed old RealmQuery
rorbech Nov 25, 2020
3320b37
Query support for Native
rorbech Nov 26, 2020
e4fb2bc
Build configuration to avoid unresolvable jni-swig-stub symbols
rorbech Nov 26, 2020
af85e85
Merge branch 'master' into cr/fixme-categorization
rorbech Nov 27, 2020
da0dc06
Updates after merge of master
rorbech Nov 27, 2020
effbcc4
Merge branch 'cr/fixme-categorization' into cr/queries
rorbech Nov 27, 2020
5dee7c7
Fixup after merge
rorbech Nov 27, 2020
0d2be1a
Add method to delete objects from a result
rorbech Nov 27, 2020
c560468
Fixup after merge
rorbech Nov 27, 2020
97a4bed
Updates acccording to review
rorbech Dec 7, 2020
c6d572d
Merge branch 'master' into cr/queries
rorbech Dec 8, 2020
99c1cc8
Fixes after merge
rorbech Dec 8, 2020
b88b034
Display history count in sample app
rorbech Dec 8, 2020
2bb2b88
Another round for linting
rorbech Dec 8, 2020
529041b
Brief reference for query string syntax
rorbech Dec 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Native C API test [WIP]
  • Loading branch information
rorbech committed Oct 19, 2020
commit 48025fc9467db72186e97e8768e5e02590ba5a33
40 changes: 40 additions & 0 deletions packages/cinterop/src/iosTest/kotlin/io/realm/CinteropTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package io.realm

import kotlinx.cinterop.*
import realm_wrapper.*
import kotlin.test.Test

class CinteropTest {

// FIXME Testing basic C API wrapper interaction (like in AndroidTest's CinteropTest)
@Test
fun cinterop_cinterop() {

println(realm_get_library_version()!!.toKString())

// FIXME Seems to miss some symbols when included ... maybe are more of the libraries realm.def or get Simon to supply full consumables
val config = realm_config_new()

// FIXME Haven't figured out how initilialize full schema yet...
// relevant links
// - https://kotlinlang.org/docs/reference/native/c_interop.html#passing-and-receiving-structs-by-value
// - https://kotlinlang.org/docs/reference/native/c_interop.html#passing-pointers-to-bindings
// - https://kotlinlang.org/docs/reference/native/c_interop.html#scope-local-pointers
// memScoped { memScope
// val config = realm_config_new()
//
//// // Setting path
// val cpath: realm_string = alloc()
// val path = "testfile".cstr
// cpath.data = path.getPointer(memScope)
// cpath.size = path.size.toULong()
// realm_config_set_path(config, cpath.readValue())
//
// val class1: realm_class_info = alloc<realm_class_info>()
// val class1 = alloc.apply {
// name = "foo" // FIXME Needs to be realm_string_t
// primary_key = alloc<realm_string>().apply { data = "".cstr.getPointer(memScope) }
// }
// }
}
}
9 changes: 6 additions & 3 deletions packages/cinterop/src/nativeCommon/realm.def
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
headers = realm.h
headerFilter = realm.h
// FIXME Lacks objects store, but seems to trigger requirement for Sync and then ssl, crypto and z
staticLibraries = librealm-ffi-static-dbg.a librealm-dbg.a librealm-parser-dbg.a
//staticLibraries = librealm-ffi-static-dbg.a librealm-dbg.a librealm-parser-dbg.a librealm-object-store-dbg.a librealm-sync-dbg.a
// This is relative to project root
// FIXME Add -Debug
libraryPaths.macos_x64 = ../../external/core/build-macos_x64/src/realm/object-store/c_api ../../external/core/build-macos_x64/src/realm ../../external/core/build-macos_x64/src/realm/parser
libraryPaths.macos_x64 = ../../external/core/build-macos_x64/src/realm/object-store/c_api ../../external/core/build-macos_x64/src/realm ../../external/core/build-macos_x64/src/realm/parser ../../external/core/build-macos_x64/src/realm/object-store/ ../../external/core/build-macos_x64/src/realm/sync
// FIXME Prior to Xcode 12 we can just reuse macos libraries for ios simulator builds
libraryPaths.ios_x64 = ../../external/core/build-macos_x64/src/realm/object-store/c_api ../../external/core/build-macos_x64/src/realm ../../external/core/build-macos_x64/src/realm/parser

libraryPaths.ios_x64 = ../../external/core/build-macos_x64/src/realm/object-store/c_api ../../external/core/build-macos_x64/src/realm ../../external/core/build-macos_x64/src/realm/parser ../../external/core/build-macos_x64/src/realm/object-store/ ../../external/core/build-macos_x64/src/realm/sync
linkerOpts = -lz -framework Foundation -framework CoreFoundation -framework Security
# asdfasdf
// Possible options
// linkerOpts = -framework Foundation -framework CoreFoundation -framework Security
// compilerOpts
Expand Down