123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- #!/bin/sh
- # Copyright (C) Pierre d'Herbemont, 2010
- # Copyright (C) Felix Paul Kühne, 2012-2014
- set -e
- PLATFORM=iphoneos
- SDK=`xcrun --sdk iphoneos --show-sdk-version`
- SDK_MIN=6.1
- VERBOSE=no
- CONFIGURATION="Release"
- NONETWORK=no
- SKIPLIBVLCCOMPILATION=no
- TESTEDVLCKITHASH=0218063957
- TESTEDMEDIALIBRARYKITHASH=2d98d90aa
- usage()
- {
- cat << EOF
- usage: $0 [-s] [-v] [-k sdk] [-d] [-n] [-l] [-u]
- OPTIONS
- -k Specify which sdk to use (see 'xcodebuild -showsdks', current: ${SDK})
- -v Be more verbose
- -s Build for simulator
- -d Enable Debug
- -n Skip script steps requiring network interaction
- -l Skip libvlc compilation
- EOF
- }
- spushd()
- {
- pushd "$1" 2>&1> /dev/null
- }
- spopd()
- {
- popd 2>&1> /dev/null
- }
- info()
- {
- local green="\033[1;32m"
- local normal="\033[0m"
- echo "[${green}info${normal}] $1"
- }
- buildxcodeproj()
- {
- local target="$2"
- if [ "x$target" = "x" ]; then
- target="$1"
- fi
- info "Building $1 ($target, ${CONFIGURATION})"
- local extra=""
- if [ "$PLATFORM" = "Simulator" ]; then
- extra="ARCHS=i386"
- fi
- xcodebuild -project "$1.xcodeproj" \
- -target "$target" \
- -sdk $PLATFORM$SDK \
- -configuration ${CONFIGURATION} ${extra} \
- IPHONEOS_DEPLOYMENT_TARGET=${SDK_MIN} > ${out}
- }
- buildxcworkspace()
- {
- local target="$2"
- if [ "x$target" = "x" ]; then
- target="$1"
- fi
- info "Building the workspace $1 ($target, ${CONFIGURATION})"
- local extra=""
- if [ "$PLATFORM" = "Simulator" ]; then
- extra="ARCHS=i386"
- fi
- xcodebuild -workspace "$1.xcworkspace" \
- -scheme "Pods-vlc-ios" \
- -sdk $PLATFORM$SDK \
- -configuration ${CONFIGURATION} ${extra} \
- IPHONEOS_DEPLOYMENT_TARGET=${SDK_MIN} > ${out}
- }
- while getopts "hvsdnluk:" OPTION
- do
- case $OPTION in
- h)
- usage
- exit 1
- ;;
- v)
- VERBOSE=yes
- ;;
- s)
- PLATFORM=iphonesimulator
- ;;
- d) CONFIGURATION="Debug"
- ;;
- n)
- NONETWORK=yes
- ;;
- l)
- SKIPLIBVLCCOMPILATION=yes
- ;;
- k)
- SDK=$OPTARG
- ;;
- ?)
- usage
- exit 1
- ;;
- esac
- done
- shift $(($OPTIND - 1))
- out="/dev/null"
- if [ "$VERBOSE" = "yes" ]; then
- out="/dev/stdout"
- fi
- if [ "x$1" != "x" ]; then
- usage
- exit 1
- fi
- # Get root dir
- spushd .
- aspen_root_dir=`pwd`
- spopd
- info "Preparing build dirs"
- mkdir -p ImportedSources
- rm -rf External
- mkdir -p External
- spushd ImportedSources
- if [ "$NONETWORK" != "yes" ]; then
- if ! [ -e MediaLibraryKit ]; then
- git clone git://git.videolan.org/MediaLibraryKit.git
- cd MediaLibraryKit
- git checkout -B localAspenBranch ${TESTEDMEDIALIBRARYKITHASH}
- git branch --set-upstream-to=origin/master localAspenBranch
- cd ..
- else
- cd MediaLibraryKit
- git reset --hard ${TESTEDMEDIALIBRARYKITHASH}
- cd ..
- fi
- if ! [ -e VLCKit ]; then
- git clone git://git.videolan.org/vlc-bindings/VLCKit.git
- cd VLCKit
- git reset --hard ${TESTEDVLCKITHASH}
- cd ..
- else
- cd VLCKit
- git reset --hard ${TESTEDVLCKITHASH}
- cd ..
- fi
- if ! [ -e GDrive ]; then
- svn checkout http://google-api-objectivec-client.googlecode.com/svn/trunk/Source GDrive
- cd GDrive && patch -p0 < ../../patches/gdrive/upgrade-default-target.patch && cd ..
- else
- cd GDrive && svn up && cd ..
- fi
- if ! [ -e LXReorderableCollectionViewFlowLayout ]; then
- git clone git://github.com/fkuehne/LXReorderableCollectionViewFlowLayout.git
- else
- cd LXReorderableCollectionViewFlowLayout && git pull --rebase && cd ..
- fi
- if ! [ -e WhiteRaccoon ]; then
- git clone git://github.com/fkuehne/WhiteRaccoon.git
- else
- cd WhiteRaccoon && git pull --rebase && cd ..
- fi
- if ! [ -e CocoaHTTPServer ]; then
- git clone git://github.com/fkuehne/CocoaHTTPServer.git
- else
- cd CocoaHTTPServer && git pull --rebase && cd ..
- fi
- fi
- info "Setup 'External' folders"
- if [ "$PLATFORM" = "iphonesimulator" ]; then
- xcbuilddir="build/${CONFIGURATION}-iphonesimulator"
- else
- xcbuilddir="build/${CONFIGURATION}-iphoneos"
- fi
- framework_build="${aspen_root_dir}/ImportedSources/VLCKit/${xcbuilddir}"
- mlkit_build="${aspen_root_dir}/ImportedSources/MediaLibraryKit/${xcbuilddir}"
- gtl_build="${aspen_root_dir}/ImportedSources/GDrive/${xcbuilddir}"
- spopd #ImportedSources
- ln -sf ${framework_build} External/MobileVLCKit
- ln -sf ${mlkit_build} External/MediaLibraryKit
- ln -sf ${gtl_build} External/gtl
- #
- # Build time
- #
- info "Building"
- spushd ImportedSources
- spushd VLCKit
- echo `pwd`
- args=""
- if [ "$VERBOSE" = "yes" ]; then
- args="${args} -v"
- fi
- if [ "$PLATFORM" = "iphonesimulator" ]; then
- args="${args} -s"
- fi
- if [ "$NONETWORK" = "yes" ]; then
- args="${args} -n"
- fi
- if [ "$SKIPLIBVLCCOMPILATION" = "yes" ]; then
- args="${args} -l"
- fi
- ./buildMobileVLCKit.sh ${args} -k "${SDK}"
- buildxcodeproj MobileVLCKit "Aggregate static plugins"
- buildxcodeproj MobileVLCKit "MobileVLCKit"
- spopd
- spushd MediaLibraryKit
- rm -f External/MobileVLCKit
- ln -sf ${framework_build} External/MobileVLCKit
- buildxcodeproj MediaLibraryKit
- spopd
- spushd GDrive
- buildxcodeproj GTL "GTLTouchStaticLib"
- spopd
- spopd # ImportedSources
- #install pods
- info "installing pods"
- pod install
- # Build the Aspen Project now
- buildxcworkspace "VLC for iOS" "VLC for iOS"
- info "Build completed"
|