From 2ee219091d368cf8cc91365e3507b9506a683e90 Mon Sep 17 00:00:00 2001 From: ivan grachev Date: Thu, 23 Nov 2023 05:45:58 +0300 Subject: [PATCH] cleanup pre_xcodebuild --- ci_scripts/ci_pre_xcodebuild.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/ci_scripts/ci_pre_xcodebuild.sh b/ci_scripts/ci_pre_xcodebuild.sh index 2a8c72f2..c830f6d5 100644 --- a/ci_scripts/ci_pre_xcodebuild.sh +++ b/ci_scripts/ci_pre_xcodebuild.sh @@ -1,7 +1,22 @@ #!/bin/bash set -e +echo "CI_PRODUCT_PLATFORM: $CI_PRODUCT_PLATFORM" +echo "CI_XCODEBUILD_ACTION: $CI_XCODEBUILD_ACTION" +echo "CI_PRIMARY_REPOSITORY_PATH: $CI_PRIMARY_REPOSITORY_PATH" +echo "CI_XCODE_PROJECT: $CI_XCODE_PROJECT" + if [ "$CI_PRODUCT_PLATFORM" = 'macOS' ] && [ "$CI_XCODEBUILD_ACTION" = 'build-for-testing' ]; then - sed -i'~' 's/ENABLE_HARDENED_RUNTIME = YES;/ENABLE_HARDENED_RUNTIME = NO;/g' \ - "$CI_PRIMARY_REPOSITORY_PATH/$CI_XCODE_PROJECT/project.pbxproj" + filePath="$CI_PRIMARY_REPOSITORY_PATH/$CI_XCODE_PROJECT/project.pbxproj" + echo "File path: $filePath" + + if [ -f "$filePath" ]; then + echo "Modifying project.pbxproj" + sed -i'~' 's/ENABLE_HARDENED_RUNTIME = YES;/ENABLE_HARDENED_RUNTIME = NO;/g' "$filePath" + else + echo "Error: File not found" + exit 1 + fi +else + echo "Conditions not met for script execution" fi