Giter Site home page Giter Site logo

unumdesign / realm-object-store Goto Github PK

View Code? Open in Web Editor NEW

This project forked from realm/realm-object-store

0.0 1.0 0.0 6.72 MB

Cross-platform abstractions used within Realm products

Home Page: https://realm.io

License: Other

C++ 97.56% Shell 0.28% CMake 2.03% Dockerfile 0.13%

realm-object-store's Introduction

Realm Object Store

The object store contains cross-platform abstractions used in Realm products. It is not intended to be used directly.

The object store consists of the following components:

  • object_store/schema/object_schema/property - contains the structures and logic used to setup and modify Realm files and their schema.
  • shared_realm - wraps the object_store APIs to provide transactions, notifications, Realm caching, migrations, and other higher level functionality.
  • object_accessor/results/list - accessor classes, object creation/update pipeline, and helpers for creating platform specific property getters and setters.

Each Realm product may use only a subset of the provided components depending on its needs.

Reporting Bugs

Please report bugs against the Realm product that you're using:

Supported Platforms

The object store's CMake build system currently only supports building for OS X, Linux, and Android.

The object store code supports being built for all Apple platforms, Linux and Android when used along with the relevant Realm product's build system.

Building

  1. Download dependencies:

    git submodule update --init
    
  2. Install CMake. You can download an installer for OS X from the CMake download page, or install via Homebrew:

    brew install cmake
    
  3. Generate build files:

    cmake .
    

    If building for Android, the path for the Android NDK must be specified. For example, if it was installed with homebrew:

    cmake -DREALM_PLATFORM=Android -DANDROID_NDK=/usr/local/Cellar/android-ndk-r10e/r10e/ .
    

    If you want to use XCode as your editor, you can generate a XCode project with:

    cmake -G Xcode .
    
  4. Build:

    make
    

Building With Sync Support

If you wish to build with sync enabled, invoke cmake like so:

cmake -DREALM_ENABLE_SYNC=1

Building Against a Local Version of Core

If you wish to build against a local version of core you can invoke cmake like so:

cmake -DREALM_CORE_PREFIX=/path/to/realm-core

The given core tree will be built as part of the object store build.

Building Against a Local Version of Sync

Specify the path to realm-core and realm-sync when invoking cmake:

cmake -DREALM_ENABLE_SYNC=1 -DREALM_CORE_PREFIX=/path/to/realm-core -DREALM_SYNC_PREFIX=/path/to/realm-sync

Prebuilt sync binaries are currently not supported.

Building with Sanitizers

The object store can be built using ASan, TSan and/or UBSan by specifying -DSANITIZE_ADDRESS=1, -DSANITIZE_THREAD=1, or -DSANITIZE_UNDEFINED=1 when invoking CMake. Building with ASan requires specifying a path to core with -DREALM_CORE_PREFIX as core needs to also be built with ASan enabled.

On OS X, the Xcode-provided copy of Clang only comes with ASan, and using TSan or UBSan requires a custom build of Clang. If you have installed Clang as an external Xcode toolchain (using the install-xcode-toolchain when building LLVM), note that you'll have to specify -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ when running cmake to stop cmake from being too clever.

Testing

make run-tests

Android

It requires a root device or an emulator:

make
adb push tests/tests /data/local/tmp
adb shell /data/local/tmp/tests

Using Docker

The Dockerfile included in this repo will provision a Docker image suitable for building and running tests for both the Linux and Android platforms.

# Build Docker image from Dockerfile
docker build -t "objectstore" .
# Run bash interactively from the built Docker image,
# mounting the current directory
docker run --rm -it -v $(pwd):/tmp -w /tmp objectstore bash
# Build the object store for Linux and run tests
> cmake .
> make
> make run-tests

Refer to the rest of this document for instructions to build/test in other configurations.

Visual Studio Code

The .vscode folder contains workspace configuration files for Visual Studio Code, which will be picked up by VSCode when it opens this folder. .vscode/extensions.json contains a list of recommended IDE extensions - namely C++, CMake, and Catch2 support. Make sure to accept installing the recommended extensions the first time you open this repo in VSCode.

Building

From the command palette execute CMake: Select Variant and choose one of the predefined build variants, such as Debug + Enable Sync + Download Core. Then, execute CMake: Configure and CMake: Build. Refer to the CMake Tools for Visual Studio Code guide for more details.

Testing

The Catch2 and Google Test Explorer extension enables exploring, running, and debugging individual test cases. Simply build the tests target and execute the Test: Focus on Test Explorer View VSCode command or manually switch to the Test Explorer view in the sidebar to get started.

License

Realm Object Store is published under the Apache 2.0 license. The underlying core is also published under the Apache 2.0 license.

This product is not being made available to any person located in Cuba, Iran, North Korea, Sudan, Syria or the Crimea region, or to any other person that is not eligible to receive the product under U.S. law.

analytics

realm-object-store's People

Contributors

tgoyne avatar bdash avatar alazier avatar jedelbo avatar austinzheng avatar jpsim avatar beeender avatar cmelchior avatar stel avatar fealebenpae avatar appden avatar alebsack avatar kneth avatar nhachicha avatar simonask avatar nirinchev avatar radu-tutueanu avatar ironage avatar kristiandupont avatar blagoev avatar jadengeller avatar segiddins avatar finnschiermer avatar morten-krogh avatar kishikawakatsumi avatar zaki50 avatar emanuelez avatar andydentfree avatar bmunkholm avatar kvap avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.