forked from tritondigital/ios-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xcode_build.sh
48 lines (35 loc) · 1.65 KB
/
xcode_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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
PACKAGE_NAME="triton-ios-sdk"
VERSION_FILE="version.properties"
SDK_VERSION="$1"
if [ -z "$SDK_VERSION" ]; then
echo "error: You must supply a version number for the SDK."
exit 1
fi
echo "info: Building sdk version $SDK_VERSION"
#xcodebuild -scheme TritonPlayerSDKUniversal OTHER_CFLAGS="-fembed-bitcode" BITCODE_GENERATION_MODE="bitcode" SYMROOT="Framework" -configuration Release -UseModernBuildSystem=NO
xcodebuild -scheme TritonPlayerSDKUniversal SYMROOT="Framework" -configuration Release -UseModernBuildSystem=YES
echo "info: Generating doc"
xcodebuild -scheme Documentation SYMROOT="Framework" -configuration Release -UseModernBuildSystem=YES
echo "info: Generating SDK package"
echo "info: Copy Framework"
cp -R "Framework/TritonPlayerSDK.xcframework" "tritonplayer-sample-app"
echo "info: Copy Documentation"
cp -R "Framework/Documentation" "tritonplayer-sample-app/Documentation"
echo "info: Copy README"
cp "README.md" "tritonplayer-sample-app"
echo "info: creating version file $VERSION_FILE"
cat > "tritonplayer-sample-app/$VERSION_FILE" << EOF
version=$SDK_VERSION
commit=$(git rev-parse HEAD)
EOF
echo "info: Rename folder for packaging"
cp -R "tritonplayer-sample-app" "$PACKAGE_NAME-$SDK_VERSION"
echo "info: Delete dev version of the xcodeproj file"
rm -rf "$PACKAGE_NAME-$SDK_VERSION/tritonplayer-sample-app-dev.xcodeproj"
echo "info: Generated file: $PWD/$PACKAGE_NAME-$SDK_VERSION.zip"
zip -r -X "$PACKAGE_NAME-$SDK_VERSION.zip" "$PACKAGE_NAME-$SDK_VERSION"
echo "cleaning sample app"
rm -f "tritonplayer-sample-app/README.txt"
rm -f "tritonplayer-sample-app/version.properties"
rm -rf "tritonplayer-sample-app/TritonPlayerSDK.xcframework"