Skip to content

Commit

Permalink
- BITCODE_GENERATION_MODE used-defined setting was added for Prebid…
Browse files Browse the repository at this point in the history
…Mobile and core modules

- `buildPrebidMobile` script was improved for asking about bitcode
  • Loading branch information
yoalex5 committed Apr 4, 2021
1 parent a8c331d commit 6dfc56a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 3ac6b72b8e32e6b50d5524e6bbdc3864ec850fb0

COCOAPODS: 1.10.0
COCOAPODS: 1.10.1
12 changes: 12 additions & 0 deletions PrebidMobile.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,7 @@
FA29A3F0232255DF00F13F61 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BITCODE_GENERATION_MODE = marker;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
Expand All @@ -1036,6 +1037,7 @@
FA29A3F1232255DF00F13F61 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BITCODE_GENERATION_MODE = marker;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
Expand All @@ -1060,13 +1062,18 @@
FAAA00C32322733E009DC7D6 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BITCODE_GENERATION_MODE = marker;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
);
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -1084,13 +1091,18 @@
FAAA00C42322733E009DC7D6 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BITCODE_GENERATION_MODE = marker;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
);
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down
12 changes: 10 additions & 2 deletions scripts/buildPrebidMobile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ XCODE_BUILD_SIMULATOR_FILE_ABSOLUTE="$PWD/$XCODE_BUILD_DIR/Build/Products/Releas
OUTPUT_DIR="$GENERATED_DIR_NAME/output"
OUTPUT_DIR_ABSOLUTE="$PWD/$OUTPUT_DIR"

BITCODE_FLAG="marker"

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

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

echo $PWD
gem install cocoapods --user-install
pod install --repo-update
Expand All @@ -60,10 +68,10 @@ do
# Build the framework for device and for simulator (using
# all needed architectures).
echo -e "\n${GREEN} - Building ${frameworkNames[$n]} for device${NC}"
xcodebuild -workspace PrebidMobile.xcworkspace -scheme "${schemes[$n]}" -configuration Release -arch arm64 only_active_arch=no defines_module=yes -sdk "iphoneos" -derivedDataPath $XCODE_BUILD_DIR > "$LOG_FILE_FRAMEWORK" 2>&1 || { echo -e "${RED}Error in build check log "$LOG_FILE_FRAMEWORK_ABSOLUTE"${NC}"; exit 1;}
xcodebuild -workspace PrebidMobile.xcworkspace -scheme "${schemes[$n]}" -configuration Release -arch arm64 only_active_arch=no defines_module=yes -sdk "iphoneos" -derivedDataPath $XCODE_BUILD_DIR BITCODE_GENERATION_MODE="$BITCODE_FLAG" > "$LOG_FILE_FRAMEWORK" 2>&1 || { echo -e "${RED}Error in build check log "$LOG_FILE_FRAMEWORK_ABSOLUTE"${NC}"; exit 1;}

echo -e "${GREEN} - Building ${frameworkNames[$n]} for simulator${NC}"
xcodebuild -workspace PrebidMobile.xcworkspace -scheme "${schemes[$n]}" -configuration Release -arch x86_64 only_active_arch=no defines_module=yes -sdk "iphonesimulator" -derivedDataPath $XCODE_BUILD_DIR > "$LOG_FILE_FRAMEWORK" 2>&1 || { echo -e "${RED}Error in build check log "$LOG_FILE_FRAMEWORK_ABSOLUTE"${NC}"; exit 1;}
xcodebuild -workspace PrebidMobile.xcworkspace -scheme "${schemes[$n]}" -configuration Release -arch x86_64 only_active_arch=no defines_module=yes -sdk "iphonesimulator" -derivedDataPath $XCODE_BUILD_DIR BITCODE_GENERATION_MODE="$BITCODE_FLAG" > "$LOG_FILE_FRAMEWORK" 2>&1 || { echo -e "${RED}Error in build check log "$LOG_FILE_FRAMEWORK_ABSOLUTE"${NC}"; exit 1;}

# Copy the device version of framework.
cp -r "$XCODE_BUILD_IPHONE_FILE_ABSOLUTE" "$OUTPUT_FILE_FRAMEWORK_ABSOLUTE"
Expand Down

0 comments on commit 6dfc56a

Please sign in to comment.