Skip to content

Commit 6c2f067

Browse files
authored
Modify SDK build Cocoapods inclusion to use frameworks instead of libraries (#905)
* Fix Cocoapod header inclusion path to work for framework-based pods. These don't specify a Pods/Header directory, so the header has to come directly from the Sources/Public directory. * Enable use_frameworks! on pods. * Fix include paths for framework cocoapods. Adds additional paths that are used by some dependency pods. * Fix for GTMSessionFetcher path. * Add use_frameworks! to all integration test podfiles as well. * Set linkage to static for integration tests. * Add git credentials to tvOS build (was mistakenly previously omitted).
1 parent 52d219b commit 6c2f067

File tree

19 files changed

+40
-19
lines changed

19 files changed

+40
-19
lines changed

.github/workflows/integration_tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,12 @@ jobs:
663663
with:
664664
ref: ${{needs.check_and_prepare.outputs.github_ref}}
665665
submodules: true
666+
- name: Store git credentials for all git commands
667+
# Forces all git commands to use authenticated https, to prevent throttling.
668+
shell: bash
669+
run: |
670+
git config --global credential.helper 'store --file /tmp/git-credentials'
671+
echo 'https://${{ github.token }}@github.com' > /tmp/git-credentials
666672
- name: Setup python
667673
uses: actions/setup-python@v2
668674
with:

admob/integration_test/Podfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
source 'https://github.com/CocoaPods/Specs.git'
22
platform :ios, '10.0'
33
# Firebase AdMob test application.
4+
use_frameworks! :linkage => :static
45

56
target 'integration_test' do
67
pod 'Firebase/Analytics', '8.15.0'

analytics/integration_test/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
21
source 'https://github.com/CocoaPods/Specs.git'
32
platform :ios, '10.0'
43
# Firebase Analytics test application.
4+
use_frameworks! :linkage => :static
55

66
target 'integration_test' do
77
platform :ios, '10.0'

app/integration_test/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
21
source 'https://github.com/CocoaPods/Specs.git'
32
platform :ios, '10.0'
43
# Firebase App test application.
4+
use_frameworks! :linkage => :static
55

66
target 'integration_test' do
77
pod 'Firebase/Analytics', '8.15.0'

auth/integration_test/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
21
source 'https://github.com/CocoaPods/Specs.git'
32
# Firebase Auth test application.
3+
use_frameworks! :linkage => :static
44

55
target 'integration_test' do
66
platform :ios, '10.0'

database/integration_test/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
21
source 'https://github.com/CocoaPods/Specs.git'
32
# Firebase Realtime Database test application.
3+
use_frameworks! :linkage => :static
44

55
target 'integration_test' do
66
platform :ios, '10.0'

dynamic_links/integration_test/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
21
source 'https://github.com/CocoaPods/Specs.git'
32
platform :ios, '10.0'
43
# Firebase Dynamic Links test application.
4+
use_frameworks! :linkage => :static
55

66
target 'integration_test' do
77
pod 'Firebase/DynamicLinks', '8.15.0'

firestore/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,8 @@ elseif(IOS)
392392
nanopb
393393
gRPC-C++
394394
gRPC-Core
395-
)
395+
FirebaseAuth/Interop/Auth/Public
396+
)
396397

397398
if (FIREBASE_XCODE_TARGET_FORMAT STREQUAL "frameworks")
398399
set_target_properties(firebase_firestore PROPERTIES

firestore/integration_test/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
21
source 'https://github.com/CocoaPods/Specs.git'
32
# Firebase Realtime Firestore test application.
3+
use_frameworks! :linkage => :static
44

55
target 'integration_test' do
66
platform :ios, '10.0'

functions/integration_test/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
21
source 'https://github.com/CocoaPods/Specs.git'
32
# Cloud Functions for Firebase test application.
3+
use_frameworks! :linkage => :static
44

55
target 'integration_test' do
66
platform :ios, '10.0'

installations/integration_test/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
21
source 'https://github.com/CocoaPods/Specs.git'
32
platform :ios, '10.0'
43
# Firebase Installations test application.
4+
use_frameworks! :linkage => :static
55

66
target 'integration_test' do
77
pod 'Firebase/Analytics', '8.15.0'

ios_pod/CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,30 @@ function(setup_pod_headers target_name)
8383
target_include_directories(${target_name}
8484
# Link the Pods publicly, so that dependent libraries can access the necessary header files as well.
8585
# Same for the below workaround.
86+
# Also link from the Sources/Public directories, for framework pods.
8687
PUBLIC
8788
${FIREBASE_POD_HEADER_DIR}/${pod}
8889
${FIREBASE_POD_HEADER_DIR}/${pod}/${pod}
89-
)
90+
${FIREBASE_POD_DIR}/Pods/${pod}/${pod}/Sources/Public
91+
${FIREBASE_POD_DIR}/Pods/${pod}/${pod}/Sources/Public/${pod}
92+
${FIREBASE_POD_DIR}/Pods/${pod}/${pod}/Source/Library/Public
93+
${FIREBASE_POD_DIR}/Pods/${pod}/${pod}/Source/Library/Public/${pod}
94+
)
9095
if("${SETUP_POD_HEADERS_INCLUDE_PRIVATE_HEADERS}")
9196
# Workaround: Private/FirebaseCore/*.h headers include other FirebaseCore headers via the subdirectory, so
9297
# we need to include the top-level Private directory as a header path. This only affects Firestore at the moment, as
9398
# no other C++ library includes a private Pod header.
99+
# Also link from the Sources/Private directory, for framework pods.
94100
target_include_directories(${target_name}
95101
PUBLIC
96102
${FIREBASE_POD_PRIVATE_HEADER_DIR}/
97103
${FIREBASE_POD_PRIVATE_HEADER_DIR}/${pod}
98104
${FIREBASE_POD_PRIVATE_HEADER_DIR}/${pod}/${pod}
105+
${FIREBASE_POD_DIR}/Pods/${pod}
106+
${FIREBASE_POD_DIR}/Pods/${pod}/include
107+
${FIREBASE_POD_DIR}/Pods/${pod}/${pod}/Sources/Private
108+
${FIREBASE_POD_DIR}/Pods/${pod}/${pod}/Sources
109+
${FIREBASE_POD_DIR}/Pods/${pod}/Source
99110
)
100111
endif()
101112

ios_pod/Podfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
source 'https://github.com/CocoaPods/Specs.git'
22
platform :ios, '10.0'
3+
use_frameworks!
34

45
target 'GetPods' do
56
pod 'Firebase/Core', '8.15.0'

messaging/integration_test/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
21
source 'https://github.com/CocoaPods/Specs.git'
32
# Firebase Cloud Messaging test application.
3+
use_frameworks! :linkage => :static
44

55
target 'integration_test' do
66
platform :ios, '10.0'

remote_config/integration_test/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
21
source 'https://github.com/CocoaPods/Specs.git'
32
# Firebase Remote Config test application.
3+
use_frameworks! :linkage => :static
44

55
target 'integration_test' do
66
platform :ios, '10.0'

storage/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,12 @@ elseif(IOS)
124124
target_link_libraries(firebase_storage
125125
PUBLIC "-fembed-bitcode")
126126

127-
# Empty entry to point to the GTMSessionFetcher folder '.'
127+
# Include GTMSessionFetcher which uses the private directory.
128128
setup_pod_headers(
129129
firebase_storage
130+
INCLUDE_PRIVATE_HEADERS
130131
POD_NAMES
131-
.
132+
GTMSessionFetcher
132133
FirebaseCore
133134
FirebaseStorage
134135
)

storage/integration_test/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
21
source 'https://github.com/CocoaPods/Specs.git'
32
# Cloud Storage for Firebase test application.
3+
use_frameworks! :linkage => :static
44

55
target 'integration_test' do
66
platform :ios, '10.0'

storage/src/ios/storage_ios.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030

3131
#ifdef __OBJC__
3232
#import "FIRStorage.h"
33-
#import "GTMSessionFetcher/GTMSessionFetcher.h"
34-
#import "GTMSessionFetcher/GTMSessionFetcherService.h"
33+
#import "GTMSessionFetcher.h"
34+
#import "GTMSessionFetcherService.h"
3535

3636
// GTMSessionFetcherService implementation that yields a
3737
// FIRCPPGTMSessionFetcher class rather than the default implementation.

storage/src/ios/storage_ios.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
#include "storage/src/ios/storage_reference_ios.h"
2323

2424
#import "FIRStorageReference.h"
25-
#import "GTMSessionFetcher/GTMSessionFetcher.h"
26-
#import "GTMSessionFetcher/GTMSessionFetcherService.h"
25+
#import "GTMSessionFetcher.h"
26+
#import "GTMSessionFetcherService.h"
2727

2828
// WARNING: Private methods in FIRStorage.
2929
@interface FIRStorage ()

0 commit comments

Comments
 (0)