mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-25 22:10:10 +00:00
commit
049db589a8
19
binding.gyp
19
binding.gyp
@ -32,7 +32,7 @@
|
||||
},
|
||||
{
|
||||
"target_name": "object-store",
|
||||
"dependencies": [ "realm-core", "realm-sync" ],
|
||||
"dependencies": [ "realm-core" ],
|
||||
"type": "static_library",
|
||||
"include_dirs": [
|
||||
"src/object-store/src",
|
||||
@ -63,12 +63,6 @@
|
||||
"src/object-store/src/parser/query_builder.cpp",
|
||||
"src/object-store/src/util/format.cpp",
|
||||
"src/object-store/src/util/thread_id.cpp",
|
||||
"src/object-store/src/sync/sync_manager.cpp",
|
||||
"src/object-store/src/sync/sync_user.cpp",
|
||||
"src/object-store/src/sync/sync_session.cpp",
|
||||
"src/object-store/src/sync/impl/sync_file.cpp",
|
||||
"src/object-store/src/sync/impl/sync_metadata.cpp",
|
||||
"src/object-store/src/impl/apple/keychain_helper.cpp"
|
||||
],
|
||||
"conditions": [
|
||||
["OS=='linux'", {
|
||||
@ -80,6 +74,17 @@
|
||||
"sources": [
|
||||
"src/object-store/src/impl/apple/external_commit_helper.cpp"
|
||||
]
|
||||
}],
|
||||
["realm_enable_sync", {
|
||||
"dependencies": [ "realm-sync" ],
|
||||
"sources": [
|
||||
"src/object-store/src/sync/sync_manager.cpp",
|
||||
"src/object-store/src/sync/sync_user.cpp",
|
||||
"src/object-store/src/sync/sync_session.cpp",
|
||||
"src/object-store/src/sync/impl/sync_file.cpp",
|
||||
"src/object-store/src/sync/impl/sync_metadata.cpp",
|
||||
"src/object-store/src/impl/apple/keychain_helper.cpp"
|
||||
],
|
||||
}]
|
||||
],
|
||||
"all_dependent_settings": {
|
||||
|
@ -30,9 +30,9 @@ else
|
||||
fi
|
||||
|
||||
SYNC_DIR='sync'
|
||||
SYNC_PLATFORM_TAG="cocoa-"
|
||||
SYNC_PLATFORM_TAG="node-cocoa-"
|
||||
|
||||
SYNC_DOWNLOAD_FILE="realm-sync-$SYNC_PLATFORM_TAG$REALM_SYNC_VERSION.tar.xz"
|
||||
SYNC_DOWNLOAD_FILE="realm-sync-$SYNC_PLATFORM_TAG$REALM_SYNC_VERSION.zip"
|
||||
|
||||
# Start current working directory at the root of the project.
|
||||
cd "$(dirname "$0")/.."
|
||||
@ -47,6 +47,8 @@ download_core() {
|
||||
local VERSION=$2
|
||||
local DOWNLOAD_FILE=$3
|
||||
local SERVER_DIR=$4
|
||||
local UNTAR=$5
|
||||
local UNTARRED_DIR=$6
|
||||
echo "Downloading dependency: $DIR $VERSION"
|
||||
|
||||
local TMP_DIR="${TMPDIR:-/tmp}/$DIR"
|
||||
@ -67,8 +69,8 @@ download_core() {
|
||||
(
|
||||
cd "$TMP_DIR"
|
||||
rm -rf "$DIR"
|
||||
tar -xzf "$TAR"
|
||||
mv core "$DIR-$VERSION"
|
||||
eval "$UNTAR" "$TAR"
|
||||
mv "$UNTARRED_DIR" "$DIR-$VERSION"
|
||||
)
|
||||
|
||||
(
|
||||
@ -84,7 +86,7 @@ check_release_notes() {
|
||||
}
|
||||
|
||||
if [ ! -e "vendor/$CORE_DIR" ]; then
|
||||
download_core $CORE_DIR $REALM_CORE_VERSION $CORE_DOWNLOAD_FILE core
|
||||
download_core $CORE_DIR $REALM_CORE_VERSION $CORE_DOWNLOAD_FILE core "tar -xzf" core
|
||||
elif [ -d "vendor/$CORE_DIR" -a -d ../realm-core -a ! -L "vendor/$CORE_DIR" ]; then
|
||||
# Allow newer versions than expected for local builds as testing
|
||||
# with unreleased versions is one of the reasons to use a local build
|
||||
@ -96,19 +98,19 @@ elif [ -d "vendor/$CORE_DIR" -a -d ../realm-core -a ! -L "vendor/$CORE_DIR" ]; t
|
||||
elif [ ! -L "vendor/$CORE_DIR" ]; then
|
||||
echo "vendor/$CORE_DIR is not a symlink. Deleting..."
|
||||
rm -rf "vendor/$CORE_DIR"
|
||||
download_core $CORE_DIR $REALM_CORE_VERSION $CORE_DOWNLOAD_FILE core
|
||||
download_core $CORE_DIR $REALM_CORE_VERSION $CORE_DOWNLOAD_FILE core "tar -xzf" core
|
||||
# With a prebuilt version we only want to check the first non-empty
|
||||
# line so that checking out an older commit will download the
|
||||
# appropriate version of core if the already-present version is too new
|
||||
elif ! grep -m 1 . "vendor/$CORE_DIR/CHANGELOG.txt" | check_release_notes; then
|
||||
download_core $CORE_DIR $REALM_CORE_VERSION $CORE_DOWNLOAD_FILE core
|
||||
download_core $CORE_DIR $REALM_CORE_VERSION $CORE_DOWNLOAD_FILE core "tar -xzf" core
|
||||
else
|
||||
echo "The core library seems to be up to date."
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -e "vendor/$SYNC_DIR" ]; then
|
||||
download_core $SYNC_DIR $REALM_SYNC_VERSION $SYNC_DOWNLOAD_FILE sync
|
||||
download_core $SYNC_DIR $REALM_SYNC_VERSION $SYNC_DOWNLOAD_FILE sync "unzip" realm-sync-node-cocoa-$REALM_SYNC_VERSION
|
||||
elif [ -d "vendor/$SYNC_DIR" -a -d ../realm-sync -a ! -L "vendor/$SYNC_DIR" ]; then
|
||||
# Allow newer versions than expected for local builds as testing
|
||||
# with unreleased versions is one of the reasons to use a local build
|
||||
@ -120,12 +122,12 @@ elif [ -d "vendor/$SYNC_DIR" -a -d ../realm-sync -a ! -L "vendor/$SYNC_DIR" ]; t
|
||||
elif [ ! -L "vendor/$SYNC_DIR" ]; then
|
||||
echo "vendor/$SYNC_DIR is not a symlink. Deleting..."
|
||||
rm -rf "vendor/$SYNC_DIR"
|
||||
download_core $SYNC_DIR $REALM_SYNC_VERSION $SYNC_DOWNLOAD_FILE sync
|
||||
download_core $SYNC_DIR $REALM_SYNC_VERSION $SYNC_DOWNLOAD_FILE sync "unzip" realm-sync-node-cocoa-$REALM_SYNC_VERSION
|
||||
# With a prebuilt version we only want to check the first non-empty
|
||||
# line so that checking out an older commit will download the
|
||||
# appropriate version of core if the already-present version is too new
|
||||
elif ! grep -m 1 . "vendor/$SYNC_DIR/version.txt" | check_release_notes; then
|
||||
download_core $SYNC_DIR $REALM_SYNC_VERSION $SYNC_DOWNLOAD_FILE sync
|
||||
download_core $SYNC_DIR $REALM_SYNC_VERSION $SYNC_DOWNLOAD_FILE sync "unzip" realm-sync-node-cocoa-$REALM_SYNC_VERSION
|
||||
else
|
||||
echo "The sync library seems to be up to date."
|
||||
fi
|
||||
|
@ -453,12 +453,15 @@ void RealmClass<T>::schema_version(ContextType ctx, ObjectType this_object, size
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
void RealmClass<T>::clear_test_state(ContextType ctx, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &return_value) {
|
||||
validate_argument_count(argc, 0);
|
||||
#if REALM_ENABLE_SYNC
|
||||
for(auto &user : SyncManager::shared().all_users()) {
|
||||
user->log_out();
|
||||
}
|
||||
#endif
|
||||
delete_all_realms();
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,18 @@
|
||||
{
|
||||
"variables": {
|
||||
"use_realm_debug": "<!(echo $REALMJS_USE_DEBUG_CORE)",
|
||||
"realm_enable_sync%": "0"
|
||||
"use_realm_debug": "<!(echo $REALMJS_USE_DEBUG_CORE)"
|
||||
},
|
||||
"conditions": [
|
||||
["OS=='mac'", {
|
||||
"variables": {
|
||||
"realm_enable_sync%": "1"
|
||||
}
|
||||
}, {
|
||||
"variables": {
|
||||
"realm_enable_sync%": "0"
|
||||
}
|
||||
}]
|
||||
],
|
||||
"targets": [
|
||||
{
|
||||
"target_name": "realm-core",
|
||||
@ -18,7 +28,7 @@
|
||||
]
|
||||
},
|
||||
"all_dependent_settings": {
|
||||
"defines": [ "REALM_HAVE_CONFIG", "REALM_PLATFORM_NODE=1", "REALM_ENABLE_SYNC=1" ]
|
||||
"defines": [ "REALM_HAVE_CONFIG", "REALM_PLATFORM_NODE=1", "REALM_ENABLE_SYNC=<(realm_enable_sync)" ]
|
||||
},
|
||||
"variables": {
|
||||
"prefix": "<!(echo $REALM_CORE_PREFIX)"
|
||||
@ -72,25 +82,26 @@
|
||||
},
|
||||
"target_name": "vendored-realm",
|
||||
"type": "none",
|
||||
"actions": [
|
||||
{
|
||||
"action_name": "download-realm",
|
||||
"inputs": [ ],
|
||||
"outputs": [ "<(module_root_dir)/vendor/core-node" ],
|
||||
"action": [ "<(module_root_dir)/scripts/download-core.sh", "node" ]
|
||||
}
|
||||
],
|
||||
"conditions": [
|
||||
["realm_enable_sync", {
|
||||
"all_dependent_settings": {
|
||||
"include_dirs": [ "<(module_root_dir)/vendor/realm-sync/include" ],
|
||||
"library_dirs": [ "<(module_root_dir)/vendor/realm-sync/osx" ]
|
||||
"include_dirs": [ "<(module_root_dir)/vendor/sync/include" ],
|
||||
"library_dirs": [ "<(module_root_dir)/vendor/sync/osx" ]
|
||||
}
|
||||
}, {
|
||||
"all_dependent_settings": {
|
||||
"include_dirs": [ "<(module_root_dir)/vendor/core-node/include" ],
|
||||
"library_dirs": [ "<(module_root_dir)/vendor/core-node" ]
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"action_name": "download-realm",
|
||||
"inputs": [ ],
|
||||
"outputs": [ "<(module_root_dir)/vendor/core-node" ],
|
||||
"action": [ "<(module_root_dir)/scripts/download-core.sh", "node" ]
|
||||
}
|
||||
]
|
||||
|
||||
}]
|
||||
]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user