@@ -10,6 +10,8 @@ set -eo pipefail; [[ $DEBUG ]] && set -x
1010# COMMON BEGIN
1111# ######################################
1212
13+ XCODEBUILD_PATH=" xcodebuild"
14+
1315# ######################################
1416# Print out error messages along with other status information.
1517# Globals:
@@ -65,6 +67,11 @@ run() {
6567main () {
6668 rm -rf Release
6769
70+ if [ -n " $1 " ]; then
71+ XCODEBUILD_PATH=$1
72+ echo " Using xcodebuild path: $XCODEBUILD_PATH "
73+ fi
74+
6875 pod install
6976
7077 build_ios_dylib ' Leanplum' ' Release/dynamic/LeanplumSDK'
@@ -99,6 +106,8 @@ main() {
99106 # zip static iOS framework for Unreal Engine
100107 zip_unreal_engine
101108
109+ echo " Built with Xcode path: $XCODEBUILD_PATH and version: ` " $XCODEBUILD_PATH " -version` "
110+
102111 echo " ${GREEN} Done.${NORMAL} "
103112}
104113
@@ -120,7 +129,7 @@ create_dynamic_xcframework() {
120129
121130 if [[ " $framework " != * " Pods_" * ]]; then
122131 echo " Creating dynamic $xcframework ..."
123- xcodebuild -quiet -create-xcframework \
132+ " $XCODEBUILD_PATH " -quiet -create-xcframework \
124133 -framework $archivePath -iphonesimulator.xcarchive/Products/Library/Frameworks/$framework \
125134 -framework $archivePath -iphoneos.xcarchive/Products/Library/Frameworks/$framework \
126135 -output Release/dynamic/$xcframework
@@ -144,7 +153,7 @@ build_ios_dylib() {
144153 echo " Starting build for $scheme (iOS) dynamic framework"
145154
146155 echo " Building $scheme dynamic (simulator) target ..."
147- xcodebuild archive \
156+ " $XCODEBUILD_PATH " archive \
148157 -quiet \
149158 -scheme $scheme \
150159 -archivePath $archivePath -iphonesimulator.xcarchive \
@@ -153,7 +162,7 @@ build_ios_dylib() {
153162 SKIP_INSTALL=NO
154163
155164 echo " Building $scheme dynamic (device) target ..."
156- xcodebuild archive \
165+ " $XCODEBUILD_PATH " archive \
157166 -quiet \
158167 -scheme $scheme \
159168 -archivePath $archivePath -iphoneos.xcarchive \
@@ -216,7 +225,7 @@ build_ios_static() {
216225 echo " Starting build for $scheme static framework"
217226
218227 echo " Building $scheme static (simulator) target ..."
219- xcodebuild archive \
228+ " $XCODEBUILD_PATH " archive \
220229 -quiet \
221230 -scheme $scheme \
222231 -archivePath $archivePath -iphonesimulator.xcarchive \
@@ -225,7 +234,7 @@ build_ios_static() {
225234 SKIP_INSTALL=NO
226235
227236 echo " Building $scheme static (device) target ..."
228- xcodebuild archive \
237+ " $XCODEBUILD_PATH " archive \
229238 -quiet \
230239 -scheme $scheme \
231240 -archivePath $archivePath -iphoneos.xcarchive \
@@ -234,7 +243,7 @@ build_ios_static() {
234243 SKIP_INSTALL=NO
235244
236245 echo " Creating $scheme static xcframework ..."
237- xcodebuild -quiet -create-xcframework \
246+ " $XCODEBUILD_PATH " -quiet -create-xcframework \
238247 -framework $archivePath -iphonesimulator.xcarchive/Products/Library/Frameworks/$productName .framework \
239248 -framework $archivePath -iphoneos.xcarchive/Products/Library/Frameworks/$productName .framework \
240249 -output Release/static/$productName .xcframework
@@ -334,4 +343,5 @@ zip_unreal_engine() {
334343}
335344
336345export -f create_dynamic_xcframework
346+ export XCODEBUILD_PATH
337347main " $@ "
0 commit comments