2021-05-27 19:06:29 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-04-18 06:14:03 +02:00
|
|
|
carthage --version
|
|
|
|
|
2021-05-27 19:06:29 +02:00
|
|
|
REPO="github \"$TRAVIS_REPO_SLUG\""
|
|
|
|
COMMIT=$TRAVIS_COMMIT
|
|
|
|
|
2022-04-18 06:14:03 +02:00
|
|
|
# Only necessary for workaround below
|
|
|
|
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
|
|
|
|
2021-05-27 19:06:29 +02:00
|
|
|
if [ -z ${TRAVIS+x} ]; then
|
|
|
|
REPO="git \"`pwd`\""
|
|
|
|
COMMIT=`git log -1 --oneline | cut -f1 -d' '`
|
|
|
|
echo "Not running in Travis. Setting REPO ($REPO) and COMMIT ($COMMIT)"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$TRAVIS" ] && [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
|
|
|
|
REPO="github \"$TRAVIS_PULL_REQUEST_SLUG\""
|
|
|
|
COMMIT=$TRAVIS_PULL_REQUEST_SHA
|
|
|
|
echo "Build is for a Pull Request. Overriding REPO ($REPO) and COMMIT ($COMMIT)"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d "CarthageValidation" ]; then
|
|
|
|
mkdir "CarthageValidation"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Validating commit '$COMMIT'"
|
|
|
|
|
|
|
|
pushd CarthageValidation > /dev/null
|
|
|
|
|
|
|
|
rm Cartfile
|
|
|
|
rm Cartfile.resolved
|
|
|
|
rm -rf Carthage
|
|
|
|
|
|
|
|
echo "$REPO \"$COMMIT\"" > Cartfile
|
|
|
|
|
2022-04-18 06:14:03 +02:00
|
|
|
|
|
|
|
# Employing a workaround until Xcode 12 builds are fixed
|
|
|
|
source "${SCRIPTPATH}"/carthage.sh bootstrap --configuration Debug --verbose
|
2021-05-27 19:06:29 +02:00
|
|
|
EXIT_CODE=$?
|
|
|
|
|
|
|
|
echo "Checking for build products..."
|
|
|
|
|
|
|
|
if [ ! -d "Carthage/Build/Mac/UnrarKit.framework" ]; then
|
|
|
|
echo "No Mac library built"
|
|
|
|
EXIT_CODE=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d "Carthage/Build/iOS/UnrarKit.framework" ]; then
|
|
|
|
echo "No iOS library built"
|
|
|
|
EXIT_CODE=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
popd > /dev/null
|
|
|
|
|
|
|
|
exit $EXIT_CODE
|