some small fixes for download-core script
This commit is contained in:
parent
f8eba17c48
commit
4fc874f35c
|
@ -15,25 +15,30 @@ fi
|
||||||
# The 'node' argument will result in realm-node build being downloaded.
|
# The 'node' argument will result in realm-node build being downloaded.
|
||||||
if [ "$1" = 'node' ]; then
|
if [ "$1" = 'node' ]; then
|
||||||
CORE_DIR="core-node"
|
CORE_DIR="core-node"
|
||||||
|
SYNC_DIR='node-sync'
|
||||||
|
|
||||||
if [ "$(uname)" = 'Darwin' ]; then
|
if [ "$(uname)" = 'Darwin' ]; then
|
||||||
PLATFORM_TAG="node-osx-"
|
PLATFORM_TAG="node-osx-"
|
||||||
|
SYNC_PLATFORM_TAG="node-cocoa-"
|
||||||
CORE_DOWNLOAD_FILE="realm-core-node-osx-$REALM_CORE_VERSION.tar.gz"
|
CORE_DOWNLOAD_FILE="realm-core-node-osx-$REALM_CORE_VERSION.tar.gz"
|
||||||
else
|
else
|
||||||
PLATFORM_TAG="node-linux-"
|
PLATFORM_TAG="node-linux-"
|
||||||
|
SYNC_PLATFORM_TAG="node-cocoa-"
|
||||||
CORE_DOWNLOAD_FILE="realm-core-node-linux-$REALM_CORE_VERSION.tar.gz"
|
CORE_DOWNLOAD_FILE="realm-core-node-linux-$REALM_CORE_VERSION.tar.gz"
|
||||||
fi
|
fi
|
||||||
|
SYNC_DOWNLOAD_FILE="realm-sync-$SYNC_PLATFORM_TAG$REALM_SYNC_VERSION.zip"
|
||||||
|
SYNC_EXTRACT="unzip"
|
||||||
|
EXTRACTED_DIR="realm-sync-node-cocoa-$REALM_SYNC_VERSION"
|
||||||
else
|
else
|
||||||
CORE_DIR='core'
|
CORE_DIR='core'
|
||||||
PLATFORM_TAG=""
|
PLATFORM_TAG=""
|
||||||
|
SYNC_DIR='sync'
|
||||||
CORE_DOWNLOAD_FILE="realm-core-$PLATFORM_TAG$REALM_CORE_VERSION.tar.xz"
|
CORE_DOWNLOAD_FILE="realm-core-$PLATFORM_TAG$REALM_CORE_VERSION.tar.xz"
|
||||||
|
SYNC_DOWNLOAD_FILE="realm-sync-cocoa-$SYNC_PLATFORM_TAG$REALM_SYNC_VERSION.tar.xz"
|
||||||
|
SYNC_EXTRACT="tar -xvf"
|
||||||
|
EXTRACTED_DIR="core"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SYNC_DIR='sync'
|
|
||||||
SYNC_PLATFORM_TAG="node-cocoa-"
|
|
||||||
|
|
||||||
SYNC_DOWNLOAD_FILE="realm-sync-$SYNC_PLATFORM_TAG$REALM_SYNC_VERSION.zip"
|
|
||||||
|
|
||||||
# Start current working directory at the root of the project.
|
# Start current working directory at the root of the project.
|
||||||
cd "$(dirname "$0")/.."
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
|
@ -110,7 +115,7 @@ fi
|
||||||
|
|
||||||
|
|
||||||
if [ ! -e "vendor/$SYNC_DIR" ]; then
|
if [ ! -e "vendor/$SYNC_DIR" ]; then
|
||||||
download_core $SYNC_DIR $REALM_SYNC_VERSION $SYNC_DOWNLOAD_FILE sync "unzip" realm-sync-node-cocoa-$REALM_SYNC_VERSION
|
download_core $SYNC_DIR $REALM_SYNC_VERSION $SYNC_DOWNLOAD_FILE sync "$SYNC_EXTRACT" $EXTRACTED_DIR
|
||||||
elif [ -d "vendor/$SYNC_DIR" -a -d ../realm-sync -a ! -L "vendor/$SYNC_DIR" ]; then
|
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
|
# Allow newer versions than expected for local builds as testing
|
||||||
# with unreleased versions is one of the reasons to use a local build
|
# with unreleased versions is one of the reasons to use a local build
|
||||||
|
@ -122,12 +127,12 @@ elif [ -d "vendor/$SYNC_DIR" -a -d ../realm-sync -a ! -L "vendor/$SYNC_DIR" ]; t
|
||||||
elif [ ! -L "vendor/$SYNC_DIR" ]; then
|
elif [ ! -L "vendor/$SYNC_DIR" ]; then
|
||||||
echo "vendor/$SYNC_DIR is not a symlink. Deleting..."
|
echo "vendor/$SYNC_DIR is not a symlink. Deleting..."
|
||||||
rm -rf "vendor/$SYNC_DIR"
|
rm -rf "vendor/$SYNC_DIR"
|
||||||
download_core $SYNC_DIR $REALM_SYNC_VERSION $SYNC_DOWNLOAD_FILE sync "unzip" realm-sync-node-cocoa-$REALM_SYNC_VERSION
|
download_core $SYNC_DIR $REALM_SYNC_VERSION $SYNC_DOWNLOAD_FILE sync "$SYNC_EXTRACT" $EXTRACTED_DIR
|
||||||
# With a prebuilt version we only want to check the first non-empty
|
# With a prebuilt version we only want to check the first non-empty
|
||||||
# line so that checking out an older commit will download the
|
# line so that checking out an older commit will download the
|
||||||
# appropriate version of core if the already-present version is too new
|
# 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
|
elif ! grep -m 1 . "vendor/$SYNC_DIR/version.txt" | check_release_notes; then
|
||||||
download_core $SYNC_DIR $REALM_SYNC_VERSION $SYNC_DOWNLOAD_FILE sync "unzip" realm-sync-node-cocoa-$REALM_SYNC_VERSION
|
download_core $SYNC_DIR $REALM_SYNC_VERSION $SYNC_DOWNLOAD_FILE sync "$SYNC_EXTRACT" $EXTRACTED_DIR
|
||||||
else
|
else
|
||||||
echo "The sync library seems to be up to date."
|
echo "The sync library seems to be up to date."
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -93,8 +93,8 @@
|
||||||
"conditions": [
|
"conditions": [
|
||||||
["realm_enable_sync", {
|
["realm_enable_sync", {
|
||||||
"all_dependent_settings": {
|
"all_dependent_settings": {
|
||||||
"include_dirs": [ "<(module_root_dir)/vendor/sync/include" ],
|
"include_dirs": [ "<(module_root_dir)/vendor/node-sync/include" ],
|
||||||
"library_dirs": [ "<(module_root_dir)/vendor/sync/osx" ]
|
"library_dirs": [ "<(module_root_dir)/vendor/node-sync/osx" ]
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"all_dependent_settings": {
|
"all_dependent_settings": {
|
||||||
|
|
Loading…
Reference in New Issue