diff --git a/build_xcframework_with_xcode_environment_variable.sh b/build_xcframework_with_xcode_environment_variable.sh index ad1a78475..fca05e9d3 100755 --- a/build_xcframework_with_xcode_environment_variable.sh +++ b/build_xcframework_with_xcode_environment_variable.sh @@ -6,8 +6,9 @@ if [ -z "$SDK_NAME" ] || [ -z "$ARCHS" ]; then exit 1 fi -# Initialize the target architecture +# Initialize the target architecture and configuration (debug vs. release) target_arch="" +target_configuration="" # Determine the target architecture based on SDK_NAME and ARCHS if [[ "$SDK_NAME" == *"simulator"* ]]; then @@ -20,6 +21,12 @@ elif [[ "$SDK_NAME" == *"iphoneos"* ]] && [[ "$ARCHS" == *"arm64"* ]]; then target_arch="arm64" fi +if [[ "$CONFIGURATION" == *"Debug"** ]]; then + target_configuration="Debug" +elif [[ "$CONFIGURATION" == *"Release"** ]]; then + target_configuration="Release" +fi + # Check if a valid target architecture was determined if [ -z "$target_arch" ]; then echo "Error: Unable to determine target architecture from SDK_NAME=$SDK_NAME and ARCHS=$ARCHS" @@ -28,6 +35,6 @@ fi # Execute Gradle command with the determined architecture echo "Building for architecture: $target_arch" -./gradlew assembleSharedXCFramework --no-configuration-cache -Papp.ios.shared.arch=$target_arch +./gradlew assembleShared${target_configuration}XCFramework --no-configuration-cache -Papp.ios.shared.arch=$target_arch echo "Build completed for $target_arch"