#!/bin/sh -e

#  download_dependencies.sh
#
#  Downloads all compiled framework flavors in from Artifactory.
#

# Create new aggregate builds

if [ -z $ARTIFACTORY_URL ]; then
    ARTIFACTORY_URL="https://oneartifactoryprod.verizon.com/artifactory"
fi

BUILD_DIR=$(xcodebuild -showBuildSettings -project ./MVMCoreUI.xcodeproj | grep -w -o 'BUILD_DIR = .*' | cut -d\  -f3-)
FRAMEWORKS_DIR=$BUILD_DIR/../../../Frameworks/MVMCoreUI

if [ ! -d $FRAMEWORKS_DIR ]; then
    mkdir -p $FRAMEWORKS_DIR
fi

./Scripts/download_framework.sh $ARTIFACTORY_URL "$FRAMEWORKS_DIR/MVMCore.framework" BPHV_MobileFirst_IOS/com/vzw/hss/myverizon/MVMCore/1.0/MVMCore-1.0-Debug-SNAPSHOT.zip

./Scripts/download_framework.sh $ARTIFACTORY_URL "$FRAMEWORKS_DIR/MVMAnimationFramework.framework" BPHV_MobileFirst_IOS/com/vzw/hss/myverizon/MVMAnimationFramework.framework/1.9/MVMAnimationFramework.framework-1.9.zip
