Skip to content

Modify SDK build Cocoapods inclusion to use frameworks instead of libraries #905

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

Merged
merged 10 commits into from
Apr 23, 2022
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
6 changes: 6 additions & 0 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,12 @@ jobs:
with:
ref: ${{needs.check_and_prepare.outputs.github_ref}}
submodules: true
- name: Store git credentials for all git commands
# Forces all git commands to use authenticated https, to prevent throttling.
shell: bash
run: |
git config --global credential.helper 'store --file /tmp/git-credentials'
echo 'https://${{ github.token }}@github.com' > /tmp/git-credentials
- name: Setup python
uses: actions/setup-python@v2
with:
Expand Down
1 change: 1 addition & 0 deletions admob/integration_test/Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
# Firebase AdMob test application.
use_frameworks! :linkage => :static

target 'integration_test' do
pod 'Firebase/Analytics', '8.15.0'
Expand Down
2 changes: 1 addition & 1 deletion analytics/integration_test/Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
# Firebase Analytics test application.
use_frameworks! :linkage => :static

target 'integration_test' do
platform :ios, '10.0'
Expand Down
2 changes: 1 addition & 1 deletion app/integration_test/Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
# Firebase App test application.
use_frameworks! :linkage => :static

target 'integration_test' do
pod 'Firebase/Analytics', '8.15.0'
Expand Down
2 changes: 1 addition & 1 deletion auth/integration_test/Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

source 'https://github.com/CocoaPods/Specs.git'
# Firebase Auth test application.
use_frameworks! :linkage => :static

target 'integration_test' do
platform :ios, '10.0'
Expand Down
2 changes: 1 addition & 1 deletion database/integration_test/Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

source 'https://github.com/CocoaPods/Specs.git'
# Firebase Realtime Database test application.
use_frameworks! :linkage => :static

target 'integration_test' do
platform :ios, '10.0'
Expand Down
2 changes: 1 addition & 1 deletion dynamic_links/integration_test/Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
# Firebase Dynamic Links test application.
use_frameworks! :linkage => :static

target 'integration_test' do
pod 'Firebase/DynamicLinks', '8.15.0'
Expand Down
3 changes: 2 additions & 1 deletion firestore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,8 @@ elseif(IOS)
nanopb
gRPC-C++
gRPC-Core
)
FirebaseAuth/Interop/Auth/Public
)

if (FIREBASE_XCODE_TARGET_FORMAT STREQUAL "frameworks")
set_target_properties(firebase_firestore PROPERTIES
Expand Down
2 changes: 1 addition & 1 deletion firestore/integration_test/Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

source 'https://github.com/CocoaPods/Specs.git'
# Firebase Realtime Firestore test application.
use_frameworks! :linkage => :static

target 'integration_test' do
platform :ios, '10.0'
Expand Down
2 changes: 1 addition & 1 deletion functions/integration_test/Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

source 'https://github.com/CocoaPods/Specs.git'
# Cloud Functions for Firebase test application.
use_frameworks! :linkage => :static

target 'integration_test' do
platform :ios, '10.0'
Expand Down
2 changes: 1 addition & 1 deletion installations/integration_test/Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
# Firebase Installations test application.
use_frameworks! :linkage => :static

target 'integration_test' do
pod 'Firebase/Analytics', '8.15.0'
Expand Down
13 changes: 12 additions & 1 deletion ios_pod/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,30 @@ function(setup_pod_headers target_name)
target_include_directories(${target_name}
# Link the Pods publicly, so that dependent libraries can access the necessary header files as well.
# Same for the below workaround.
# Also link from the Sources/Public directories, for framework pods.
PUBLIC
${FIREBASE_POD_HEADER_DIR}/${pod}
${FIREBASE_POD_HEADER_DIR}/${pod}/${pod}
)
${FIREBASE_POD_DIR}/Pods/${pod}/${pod}/Sources/Public
${FIREBASE_POD_DIR}/Pods/${pod}/${pod}/Sources/Public/${pod}
${FIREBASE_POD_DIR}/Pods/${pod}/${pod}/Source/Library/Public
${FIREBASE_POD_DIR}/Pods/${pod}/${pod}/Source/Library/Public/${pod}
)
if("${SETUP_POD_HEADERS_INCLUDE_PRIVATE_HEADERS}")
# Workaround: Private/FirebaseCore/*.h headers include other FirebaseCore headers via the subdirectory, so
# we need to include the top-level Private directory as a header path. This only affects Firestore at the moment, as
# no other C++ library includes a private Pod header.
# Also link from the Sources/Private directory, for framework pods.
target_include_directories(${target_name}
PUBLIC
${FIREBASE_POD_PRIVATE_HEADER_DIR}/
${FIREBASE_POD_PRIVATE_HEADER_DIR}/${pod}
${FIREBASE_POD_PRIVATE_HEADER_DIR}/${pod}/${pod}
${FIREBASE_POD_DIR}/Pods/${pod}
${FIREBASE_POD_DIR}/Pods/${pod}/include
${FIREBASE_POD_DIR}/Pods/${pod}/${pod}/Sources/Private
${FIREBASE_POD_DIR}/Pods/${pod}/${pod}/Sources
${FIREBASE_POD_DIR}/Pods/${pod}/Source
)
endif()

Expand Down
1 change: 1 addition & 0 deletions ios_pod/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target 'GetPods' do
pod 'Firebase/Core', '8.15.0'
Expand Down
2 changes: 1 addition & 1 deletion messaging/integration_test/Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

source 'https://github.com/CocoaPods/Specs.git'
# Firebase Cloud Messaging test application.
use_frameworks! :linkage => :static

target 'integration_test' do
platform :ios, '10.0'
Expand Down
2 changes: 1 addition & 1 deletion remote_config/integration_test/Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

source 'https://github.com/CocoaPods/Specs.git'
# Firebase Remote Config test application.
use_frameworks! :linkage => :static

target 'integration_test' do
platform :ios, '10.0'
Expand Down
5 changes: 3 additions & 2 deletions storage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,12 @@ elseif(IOS)
target_link_libraries(firebase_storage
PUBLIC "-fembed-bitcode")

# Empty entry to point to the GTMSessionFetcher folder '.'
# Include GTMSessionFetcher which uses the private directory.
setup_pod_headers(
firebase_storage
INCLUDE_PRIVATE_HEADERS
POD_NAMES
.
GTMSessionFetcher
FirebaseCore
FirebaseStorage
)
Expand Down
2 changes: 1 addition & 1 deletion storage/integration_test/Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

source 'https://github.com/CocoaPods/Specs.git'
# Cloud Storage for Firebase test application.
use_frameworks! :linkage => :static

target 'integration_test' do
platform :ios, '10.0'
Expand Down
4 changes: 2 additions & 2 deletions storage/src/ios/storage_ios.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

#ifdef __OBJC__
#import "FIRStorage.h"
#import "GTMSessionFetcher/GTMSessionFetcher.h"
#import "GTMSessionFetcher/GTMSessionFetcherService.h"
#import "GTMSessionFetcher.h"
#import "GTMSessionFetcherService.h"

// GTMSessionFetcherService implementation that yields a
// FIRCPPGTMSessionFetcher class rather than the default implementation.
Expand Down
4 changes: 2 additions & 2 deletions storage/src/ios/storage_ios.mm
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#include "storage/src/ios/storage_reference_ios.h"

#import "FIRStorageReference.h"
#import "GTMSessionFetcher/GTMSessionFetcher.h"
#import "GTMSessionFetcher/GTMSessionFetcherService.h"
#import "GTMSessionFetcher.h"
#import "GTMSessionFetcherService.h"

// WARNING: Private methods in FIRStorage.
@interface FIRStorage ()
Expand Down