Skip to content

Commit

Permalink
- structure changes
Browse files Browse the repository at this point in the history
- renaming
- fixing `Could not find module for architecture` error
- fixing Dr.Prebid real device
- build script was improved
  • Loading branch information
yoalex5 committed Sep 10, 2019
1 parent 669adce commit 86e57af
Show file tree
Hide file tree
Showing 17 changed files with 676 additions and 302 deletions.
202 changes: 142 additions & 60 deletions Example/PrebidDemo/PrebidDemo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FA12E4D5231EB49000CAA05B"
BuildableName = "PrebidDemoSwiftTests.xctest"
BlueprintName = "PrebidDemoSwiftTests"
BlueprintIdentifier = "FA12E4E5231EB52D00CAA05B"
BuildableName = "PrebidDemoTests.xctest"
BlueprintName = "PrebidDemoTests"
ReferencedContainer = "container:PrebidDemo.xcodeproj">
</BuildableReference>
</TestableReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FA12E4D5231EB49000CAA05B"
BuildableName = "PrebidDemoSwiftTests.xctest"
BlueprintName = "PrebidDemoSwiftTests"
BlueprintIdentifier = "FA12E4E5231EB52D00CAA05B"
BuildableName = "PrebidDemoTests.xctest"
BlueprintName = "PrebidDemoTests"
ReferencedContainer = "container:PrebidDemo.xcodeproj">
</BuildableReference>
</TestableReference>
Expand Down
10 changes: 9 additions & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
platform :ios, '9.0'

workspace 'PrebidMobile'

project 'PrebidMobile.xcodeproj'
project 'Example/PrebidDemo/PrebidDemo.xcodeproj'
project 'tools/PrebidValidator/Dr.Prebid.xcodeproj'
Expand All @@ -20,12 +21,19 @@ target 'PrebidMobile' do

end

target 'PrebidMobileCore' do
project 'PrebidMobile.xcodeproj'

use_frameworks!

end

target 'PrebidDemoSwift' do
project 'Example/PrebidDemo/PrebidDemo.xcodeproj'

prebid_demo_pods

target 'PrebidDemoSwiftTests' do
target 'PrebidDemoTests' do
inherit! :search_paths
end
end
Expand Down
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ SPEC CHECKSUMS:
mopub-ios-sdk: b63e15803e70b92d0b51c3e1c49bbcd78cd3d1d5
nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48

PODFILE CHECKSUM: c1faddac5c8c576b3969e3521fb4624984707663
PODFILE CHECKSUM: 5c4351d4e75f65cb1308b2f5c85e51a6f8849ab2

COCOAPODS: 1.8.0.beta.2
498 changes: 330 additions & 168 deletions PrebidMobile.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "60D792F1217E229A0080F428"
BlueprintIdentifier = "FAAA00BC2322733E009DC7D6"
BuildableName = "PrebidMobile.framework"
BlueprintName = "PrebidMobile"
ReferencedContainer = "container:PrebidMobile.xcodeproj">
Expand All @@ -28,21 +28,11 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "60D792FA217E229B0080F428"
BuildableName = "PrebidMobileTests.xctest"
BlueprintName = "PrebidMobileTests"
ReferencedContainer = "container:PrebidMobile.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "60D792F1217E229A0080F428"
BlueprintIdentifier = "FAAA00BC2322733E009DC7D6"
BuildableName = "PrebidMobile.framework"
BlueprintName = "PrebidMobile"
ReferencedContainer = "container:PrebidMobile.xcodeproj">
Expand All @@ -64,7 +54,7 @@
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "60D792F1217E229A0080F428"
BlueprintIdentifier = "FAAA00BC2322733E009DC7D6"
BuildableName = "PrebidMobile.framework"
BlueprintName = "PrebidMobile"
ReferencedContainer = "container:PrebidMobile.xcodeproj">
Expand All @@ -82,7 +72,7 @@
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "60D792F1217E229A0080F428"
BlueprintIdentifier = "FAAA00BC2322733E009DC7D6"
BuildableName = "PrebidMobile.framework"
BlueprintName = "PrebidMobile"
ReferencedContainer = "container:PrebidMobile.xcodeproj">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FA29A3D2232255DF00F13F61"
BuildableName = "PrebidMobile.framework"
BlueprintName = "PrebidMobileCore"
ReferencedContainer = "container:PrebidMobile.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FA29A3D2232255DF00F13F61"
BuildableName = "PrebidMobile.framework"
BlueprintName = "PrebidMobileCore"
ReferencedContainer = "container:PrebidMobile.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FA29A3D2232255DF00F13F61"
BuildableName = "PrebidMobile.framework"
BlueprintName = "PrebidMobileCore"
ReferencedContainer = "container:PrebidMobile.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@
BlueprintName = "PrebidMobileTests"
ReferencedContainer = "container:PrebidMobile.xcodeproj">
</BuildableReference>
<SkippedTests>
<Test
Identifier = "RequestBuilderTests/testPostDataWithShareLocationOff()">
</Test>
<Test
Identifier = "RequestBuilderTests/testPostDataWithShareLocationOn()">
</Test>
</SkippedTests>
</TestableReference>
</Testables>
<AdditionalOptions>
Expand Down
2 changes: 2 additions & 0 deletions Source/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
<key>PrebidMobileName</key>
<string>$(PREBID_MOBILE_NAME)</string>
</dict>
</plist>
9 changes: 0 additions & 9 deletions Source/Video/IMA/VideoImaView.swift

This file was deleted.

80 changes: 56 additions & 24 deletions scripts/buildPrebidSDK.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,75 @@ set -e

cd ../

# 2
# Setup some constants for use later on.
FRAMEWORK_NAME="PrebidMobile"
GENERATED_FOLDER_NAME="generated"

LOG_DIR="$GENERATED_FOLDER_NAME/log"
LOG_FILE="$LOG_DIR/prebid_mobile_build.log"
LOG_FILE_ABSOLUTE="$PWD/$LOG_FILE"

XCODE_BUILD_DIR="$GENERATED_FOLDER_NAME/xcodebuild"
XCODE_BUILD_IPHONE_FILE_ABSOLUTE="$PWD/$XCODE_BUILD_DIR/Build/Products/Release-iphoneos/$FRAMEWORK_NAME.framework"

RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color

# 3
PRODUCT_NAME="PrebidMobile"

GENERATED_DIR_NAME="generated"

LOG_DIR="$GENERATED_DIR_NAME/log"
LOG_FILE_FRAMEWORK="$LOG_DIR/prebid_mobile_build.log"
LOG_FILE_FRAMEWORK_ABSOLUTE="$PWD/$LOG_FILE_FRAMEWORK"

XCODE_BUILD_DIR="$GENERATED_DIR_NAME/xcodebuild"
XCODE_BUILD_IPHONE_FILE_ABSOLUTE="$PWD/$XCODE_BUILD_DIR/Build/Products/Release-iphoneos/$PRODUCT_NAME.framework"
XCODE_BUILD_SIMULATOR_FILE_ABSOLUTE="$PWD/$XCODE_BUILD_DIR/Build/Products/Release-iphonesimulator/$PRODUCT_NAME.framework"

OUTPUT_DIR="$GENERATED_DIR_NAME/output"
OUTPUT_DIR_ABSOLUTE="$PWD/$OUTPUT_DIR"

# If remnants from a previous build exist, delete them.
if [ -d "$GENERATED_FOLDER_NAME" ]; then
rm -rf "$GENERATED_FOLDER_NAME"
if [ -d "$GENERATED_DIR_NAME" ]; then
rm -rf "$GENERATED_DIR_NAME"
fi

mkdir -p "$LOG_DIR"
touch "$LOG_FILE"
touch "$LOG_FILE_FRAMEWORK"

echo $PWD
gem install cocoapods --user-install
pod install --repo-update

# 4
# Build the framework for device and for simulator (using
# all needed architectures).
echo -e "${GREEN}-Building the framework for device${NC}"
xcodebuild -workspace PrebidMobile.xcworkspace -scheme "PrebidMobile" -configuration Release -arch arm64 only_active_arch=no defines_module=yes -sdk "iphoneos" -derivedDataPath $XCODE_BUILD_DIR > "$LOG_FILE" 2>&1 || { echo -e "${RED}Error in build check log "$LOG_FILE_ABSOLUTE"${NC}"; exit 1;}
schemes=("PrebidMobile" "PrebidMobileCore")
outputPaths=("" "core/")
frameworkNames=("PrebidMobile" "PrebidMobile-core")

for(( n=0; n<=1; n++ ))
do

# Delete the most recent xcodebuild.
if [ -d "$XCODE_BUILD_DIR" ]; then
rm -rf "$XCODE_BUILD_DIR"
fi

mkdir -p "$OUTPUT_DIR_ABSOLUTE/${outputPaths[$n]}"
OUTPUT_FILE_FRAMEWORK_ABSOLUTE="$OUTPUT_DIR_ABSOLUTE/${outputPaths[$n]}${PRODUCT_NAME}.framework"

# 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;}

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;}

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

# Copy Swift modules (from iphonesimulator build)
cp -R "$XCODE_BUILD_SIMULATOR_FILE_ABSOLUTE/Modules/${PRODUCT_NAME}.swiftmodule/." "$OUTPUT_FILE_FRAMEWORK_ABSOLUTE/Modules/${PRODUCT_NAME}.swiftmodule"

# Merging the device and simulator
# frameworks' executables with lipo.
# echo -e "${GREEN} - Creating Universal $FRAMEWORK_NAME framework ${NC}"
echo -e "${GREEN} - Creating Universal ${frameworkNames[$n]} framework ${NC}"
lipo "$XCODE_BUILD_IPHONE_FILE_ABSOLUTE/${PRODUCT_NAME}" "$XCODE_BUILD_SIMULATOR_FILE_ABSOLUTE/${PRODUCT_NAME}" -create -output "$OUTPUT_FILE_FRAMEWORK_ABSOLUTE/${PRODUCT_NAME}"

echo -e "${GREEN}-Building the framework for simulator${NC}"
xcodebuild -workspace PrebidMobile.xcworkspace -scheme "PrebidMobile" -configuration Release -arch x86_64 only_active_arch=no defines_module=yes -sdk "iphonesimulator" -derivedDataPath $XCODE_BUILD_DIR > "$LOG_FILE" 2>&1 || { echo -e "${RED}Error in build check log "$LOG_FILE_ABSOLUTE"${NC}"; exit 1;}
done

echo -e "${GREEN}Done!${NC} \nPrebid Mobile framework for iPhone path is "$XCODE_BUILD_IPHONE_FILE_ABSOLUTE""
echo "Build logs path is "$LOG_FILE_ABSOLUTE""
echo -e "\n${GREEN}Done!${NC} \n"
echo -e "Universal frameworks are located: "$OUTPUT_DIR_ABSOLUTE" \n"
echo -e "Build logs path is: "$LOG_FILE_FRAMEWORK_ABSOLUTE" \n"
Loading

0 comments on commit 86e57af

Please sign in to comment.