some small fixes for download-core script

This commit is contained in:
Ari Lazier 2016-11-09 15:01:42 -08:00
parent f8eba17c48
commit 4fc874f35c
2 changed files with 15 additions and 10 deletions

View File

@ -15,24 +15,29 @@ 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=""
CORE_DOWNLOAD_FILE="realm-core-$PLATFORM_TAG$REALM_CORE_VERSION.tar.xz"
fi
SYNC_DIR='sync' SYNC_DIR='sync'
SYNC_PLATFORM_TAG="node-cocoa-" 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_DOWNLOAD_FILE="realm-sync-$SYNC_PLATFORM_TAG$REALM_SYNC_VERSION.zip" SYNC_EXTRACT="tar -xvf"
EXTRACTED_DIR="core"
fi
# 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

View File

@ -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": {