forked from hyle-team/zano_native_lib_package_ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.sh
executable file
·45 lines (38 loc) · 1.49 KB
/
script.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
#!/bin/bash
# Accept build configuration (Debug or Release) as the first parameter, default to Release if not provided
BUILD_CONFIGURATION=${1:-Release}
# Set LIBRARY_FOR_DISTRIBUTION based on the build configuration
if [ "$BUILD_CONFIGURATION" == "Release" ]; then
LIBRARY_FOR_DISTRIBUTION=YES
else
LIBRARY_FOR_DISTRIBUTION=NO
fi
# Check if zano_ios.xcframework exists and remove it if necessary
if [ -d "./zano_ios.xcframework" ]; then
echo "Removing existing zano_ios.xcframework..."
rm -rf "./zano_ios.xcframework"
fi
# Clean the build directory
xcodebuild clean -project "zano-ios.xcodeproj" -scheme "zano-ios" -configuration $BUILD_CONFIGURATION
# Build for iOS Simulator
xcodebuild build \
-project "zano-ios.xcodeproj" \
-scheme "zano-ios" \
-destination "generic/platform=iOS Simulator" \
-configuration $BUILD_CONFIGURATION \
-derivedDataPath build \
Build_library_for_distribution=$LIBRARY_FOR_DISTRIBUTION
# Build for iOS Device
xcodebuild build \
-project "zano-ios.xcodeproj" \
-scheme "zano-ios" \
-destination "generic/platform=iOS" \
-configuration $BUILD_CONFIGURATION \
-derivedDataPath build \
Build_library_for_distribution=$LIBRARY_FOR_DISTRIBUTION
# Create XCFramework
xcodebuild \
-create-xcframework \
-framework "build/Build/Products/$BUILD_CONFIGURATION-iphoneos/zano_ios.framework" \
-framework "build/Build/Products/$BUILD_CONFIGURATION-iphonesimulator/zano_ios.framework" \
-output "./zano_ios.xcframework"