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.
|
||||
if [ "$1" = 'node' ]; then
|
||||
CORE_DIR="core-node"
|
||||
SYNC_DIR='node-sync'
|
||||
|
||||
if [ "$(uname)" = 'Darwin' ]; then
|
||||
PLATFORM_TAG="node-osx-"
|
||||
SYNC_PLATFORM_TAG="node-cocoa-"
|
||||
CORE_DOWNLOAD_FILE="realm-core-node-osx-$REALM_CORE_VERSION.tar.gz"
|
||||
else
|
||||
PLATFORM_TAG="node-linux-"
|
||||
SYNC_PLATFORM_TAG="node-cocoa-"
|
||||
CORE_DOWNLOAD_FILE="realm-core-node-linux-$REALM_CORE_VERSION.tar.gz"
|
||||
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
|
||||
CORE_DIR='core'
|
||||
PLATFORM_TAG=""
|
||||
SYNC_DIR='sync'
|
||||
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
|
||||
|
||||
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.
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
|
@ -110,7 +115,7 @@ fi
|
|||
|
||||
|
||||
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
|
||||
# Allow newer versions than expected for local builds as testing
|
||||
# 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
|
||||
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 "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
|
||||
# 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 "unzip" realm-sync-node-cocoa-$REALM_SYNC_VERSION
|
||||
download_core $SYNC_DIR $REALM_SYNC_VERSION $SYNC_DOWNLOAD_FILE sync "$SYNC_EXTRACT" $EXTRACTED_DIR
|
||||
else
|
||||
echo "The sync library seems to be up to date."
|
||||
fi
|
||||
|
|
|
@ -93,8 +93,8 @@
|
|||
"conditions": [
|
||||
["realm_enable_sync", {
|
||||
"all_dependent_settings": {
|
||||
"include_dirs": [ "<(module_root_dir)/vendor/sync/include" ],
|
||||
"library_dirs": [ "<(module_root_dir)/vendor/sync/osx" ]
|
||||
"include_dirs": [ "<(module_root_dir)/vendor/node-sync/include" ],
|
||||
"library_dirs": [ "<(module_root_dir)/vendor/node-sync/osx" ]
|
||||
}
|
||||
}, {
|
||||
"all_dependent_settings": {
|
||||
|
|
Loading…
Reference in New Issue