-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathrun_ci_tasks.sh
executable file
·64 lines (51 loc) · 1.47 KB
/
run_ci_tasks.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
#####################################################
# This script is used for Continuous Integration
#
# Run locally to verify before committing your code.
#
# Options:
# -a to run Android CI tasks.
# -i to run iOS CI tasks.
#####################################################
set -o pipefail
set -e
set -x
REPO_PATH=`dirname "${0}"`/../
# get platforms
ANDROID=false
IOS=false
# Parse arguments
OPTS=`getopt hai $*`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
eval set -- "$OPTS"
while true; do
case "$1" in
-h ) echo -ne "-a to run Android CI tasks.\n-i to run iOS CI tasks.\n Defaults to both. \n"; exit 0;;
-a ) ANDROID=true;;
-i ) IOS=true;;
* ) break ;;
esac
shift
done
cd $REPO_PATH
# Android
if $ANDROID ; then
cd example/android
# Build
./gradlew app:assembleDebug
cd -
fi
# iOS
if $IOS; then
cd example/ios
pod install
# build iOS
PROJECT_PLATFORM_PATH="$(pwd)"
DERIVED_DATA=$(mktemp -d /tmp/ci-derived-data-XXXXX)
TARGET_SDK='iphonesimulator'
TEST_DESTINATION='platform=iOS Simulator,OS=18.1,name=iPhone 16 Pro Max'
# Use Debug configurations and a simulator SDK so the build process doesn't attempt to sign the output
xcrun xcodebuild -workspace "${PROJECT_PLATFORM_PATH}/AirshipExample.xcworkspace" -derivedDataPath "${DERIVED_DATA}" -scheme "AirshipExample" -configuration Debug -sdk $TARGET_SDK -destination "${TEST_DESTINATION}"
cd -
fi