-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·26 lines (19 loc) · 987 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )
KOTLIN_DIR="$DIR"
IOS_DIR="$DIR/iosSample"
#Check CocoaPods version.
REQUIRED_POD_VERSION="1.6.1"
POD_VERSION=`pod --version`
EARLIER_VERSION=`echo "$POD_VERSION $REQUIRED_POD_VERSION" | tr " " "\n" | sort -V | head -1`
if [ "$EARLIER_VERSION" != "$REQUIRED_POD_VERSION" ]; then
echo "ERROR: This version of CocoaPods is unsupported. Current version is $POD_VERSION. Minimal required version is $REQUIRED_POD_VERSION."
echo "See update instructions at https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods"
exit 1
fi
# Prepare Kotlin/Native project to be consumed by CocoaPods.
"$KOTLIN_DIR/gradlew" -p "$KOTLIN_DIR" podspec
# Run CocoaPods to configure the Xcode project.
pod --project-directory="$IOS_DIR" install
# Run Xcode to build the app.
xcodebuild -sdk iphonesimulator -arch arm64 -configuration Release -workspace "$IOS_DIR/iosSample.xcworkspace" -scheme iosSample