element-ios/buildipa.sh

37 lines
849 B
Bash
Raw Normal View History

#!/bin/sh
set -e
builddir="build"
outdir="out"
sdk="iphoneos"
2015-08-10 12:57:35 +00:00
basecmd="xcodebuild -scheme Vector -workspace Vector.xcworkspace -configuration Release -sdk $sdk -derivedDataPath $builddir"
vars=""
if [ -n "$GIT_BRANCH" ]
then
2015-02-04 18:35:56 +00:00
vars="$vars GIT_BRANCH=`echo $GIT_BRANCH | sed -e 's#origin\/##'`"
fi
if [ -n "$BUILD_NUMBER" ]
then
vars="$vars BUILD_NUMBER=$BUILD_NUMBER"
fi
2015-02-26 11:30:35 +00:00
if [ "$1" == 'clean' ]
then
2015-08-10 12:57:35 +00:00
if [ -d "Vector.xcworkspace" ]
then
$basecmd clean
fi
rm -r "$builddir" "$outdir" || true
2015-02-26 11:30:35 +00:00
else
2015-08-10 12:57:35 +00:00
if [ ! -d "Vector.xcworkspace" ]
then
echo "Please run pod install first"
exit 1
fi
2015-08-10 12:57:35 +00:00
$basecmd -archivePath "out/Vector.xcarchive" archive GCC_PREPROCESSOR_DEFINITIONS="\$(GCC_PREPROCESSOR_DEFINITIONS) $vars" "$@"
xcrun -sdk $sdk PackageApplication -v $outdir/Vector.xcarchive/Products/Applications/Vector.app -o `pwd`/out/Vector.ipa
fi