Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove bitcode support from build script #816

Merged
merged 1 commit into from
Apr 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- checkout
- run:
name: Build Frameworks
command: scripts/buildPrebidMobile.sh -b no
command: scripts/buildPrebidMobile.sh

unit-test:
macos:
Expand Down
48 changes: 1 addition & 47 deletions scripts/buildPrebidMobile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,6 @@ if [ -d "scripts" ]; then
cd scripts/
fi

# Flags:
# -b: runs build with BITCODE.
# Options:
# "y": build with BITCODE
# any other: build without BITCODE
# It is needed for CircleCI builds.

bitcode_script_flag=''

while getopts 'b:' flag; do
case "${flag}" in
b) bitcode_script_flag="${OPTARG}" ;;
esac
done

# 1
# Set bash script to exit immediately if any commands fail.
set -e
Expand Down Expand Up @@ -46,7 +31,6 @@ GENERATED_DIR_NAME="generated"
OUTPUT_DIR="$GENERATED_DIR_NAME/output"
OUTPUT_DIR_ABSOLUTE="$PWD/$OUTPUT_DIR"

BITCODE_FLAG=NO

# If remnants from a previous build exist, delete them.
if [ -d "$GENERATED_DIR_NAME" ]; then
Expand All @@ -56,23 +40,6 @@ fi
mkdir -p "$LOG_DIR"
touch "$LOG_FILE_FRAMEWORK"

if [ -z "$bitcode_script_flag" ]
then
echo -n "Embed bitcode (y/n)?"
read bitcodeAnswer
if [ "$bitcodeAnswer" != "${bitcodeAnswer#[Yy]}" ] ;then
BITCODE_FLAG=YES
fi
else
if [ "$bitcode_script_flag" != "${bitcode_script_flag#[Yy]}" ] ;then
BITCODE_FLAG=YES
fi
fi


printf "\nBITCODE_FLAG: $BITCODE_FLAG\n"


echo -e "\n\n${GREEN}INSTALL PODS${NC}\n\n"

gem install cocoapods --user-install
Expand All @@ -91,7 +58,6 @@ do
xcodebuild archive \
only_active_arch=NO \
defines_module=YES \
ENABLE_BITCODE=$BITCODE_FLAG \
SKIP_INSTALL=NO \
-workspace PrebidMobile.xcworkspace \
-scheme "${schemes[$n]}" \
Expand Down Expand Up @@ -119,24 +85,12 @@ do

echo -e "${GREEN} - Creating ${schemes[$n]} XCFramework${NC}"
# Create XCFramework

# find all .bcsymbolmap and concatinate -debug-symbols
debugSymbolsBcsymbolmap=""

while read bcsymbolmapsFileName
do
# echo "BCSymbolMap: '$bcsymbolmapsFileName'"
debugSymbolsBcsymbolmap="$debugSymbolsBcsymbolmap -debug-symbols \"$bcsymbolmapsFileName\""
done < <(find "$XCODE_ARCHIVE_DIR_ABSOLUTE/${schemes[$n]}.xcarchive/BCSymbolMaps" -name "*.bcsymbolmap")

# echo "debugSymbolsBcsymbolmap: '$debugSymbolsBcsymbolmap'"


# eval
eval "
xcodebuild -create-xcframework \
-framework "$XCODE_ARCHIVE_DIR/${schemes[$n]}.xcarchive/Products/Library/Frameworks/${schemes[$n]}.framework" \
-debug-symbols "$XCODE_ARCHIVE_DIR_ABSOLUTE/${schemes[$n]}.xcarchive/dSYMs/${schemes[$n]}.framework.dSYM" \
$debugSymbolsBcsymbolmap \
-framework "$XCODE_ARCHIVE_DIR/${schemes[$n]}$POSTFIX_SIMULATOR.xcarchive/Products/Library/Frameworks/${schemes[$n]}.framework" \
-debug-symbols "$XCODE_ARCHIVE_DIR_ABSOLUTE/${schemes[$n]}$POSTFIX_SIMULATOR.xcarchive/dSYMs/${schemes[$n]}.framework.dSYM" \
-output "$OUTPUT_DIR/XC${schemes[$n]}.xcframework"
Expand Down