diff options
author | Gil <mcg@google.com> | 2018-05-03 13:34:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-03 13:34:13 -0700 |
commit | a1339483b42dc921527f7df5e49e2162761dc400 (patch) | |
tree | 171275858053b8a8bfee81d118133605172b71c4 /Firestore/Example/Podfile | |
parent | ac04c3e6cf33b0b305836eb6d9e2545c81559f59 (diff) |
Prepare Firestore for use as a static library (#1210)
* Remove spurious dependencies on other project targets in the integration tests
* Integration tests don't depend on OCMock
... and shouldn't
* Integration tests don't directly depend upon leveldb either
* Flatten Firestore example Podfile
Make the targets independent in Firestore/Example/Podfile and add a
workaround to deduplicate dependencies.
* Project file output from running pod update
Diffstat (limited to 'Firestore/Example/Podfile')
-rw-r--r-- | Firestore/Example/Podfile | 57 |
1 files changed, 44 insertions, 13 deletions
diff --git a/Firestore/Example/Podfile b/Firestore/Example/Podfile index 92b199a..eb811e8 100644 --- a/Firestore/Example/Podfile +++ b/Firestore/Example/Podfile @@ -12,25 +12,56 @@ pod 'FirebaseFirestore', :path => '../../' target 'Firestore_Example_iOS' do platform :ios, '8.0' - target 'Firestore_Tests_iOS' do - inherit! :search_paths + # Test targets are below to avoid problems with duplicate symbols when + # building as a static library (see comments below). +end - pod 'leveldb-library' - pod 'OCMock' - pod 'GoogleTest', :podspec => 'Tests/GoogleTest/GoogleTest.podspec' - end +target 'Firestore_Tests_iOS' do + platform :ios, '8.0' - target 'Firestore_IntegrationTests_iOS' do - inherit! :search_paths + pod 'leveldb-library' + pod 'OCMock' + pod 'GoogleTest', :podspec => 'Tests/GoogleTest/GoogleTest.podspec' +end - pod 'OCMock' - end +target 'Firestore_IntegrationTests_iOS' do + platform :ios, '8.0' +end - target 'Firestore_SwiftTests_iOS' do - pod 'FirebaseFirestoreSwift', :path => '../../' - end +target 'Firestore_SwiftTests_iOS' do + platform :ios, '8.0' + pod 'FirebaseFirestoreSwift', :path => '../../' end target 'SwiftBuildTest' do platform :ios, '8.0' end + +# Firestore includes both Objective-C and C++ code, and the Firestore tests +# consist of both XCTest-based tests in Objective-C and GoogleTest-based tests +# in C++. The C++ tests must resolve the classes under test at link time, so +# CocoaPods usual strategy linking Frameworks to the app and then resolving +# those classes through run-time loading does not work in all cases. +# +# If use_frameworks! is disabled above, the project will encounter a ton of +# duplicate Objective-C class warnings during test runs. Some of the tests will +# fail too because duplicate classes also get duplicate static data and this +# violates the expectations of code we depend upon. +# +# The workaround is to strip duplicate dependencies out of the example app, +# which does not need them since it doesn't do anything other than act as a +# host to the tests. This is based on the workaround posted here: +# +# https://github.com/CocoaPods/CocoaPods/issues/7155 +# +# TODO(wilhuff): Reevaluate if this is needed once we require CocoaPods 1.5.1 +# which may address this. +pre_install do |installer| + test_target = installer.aggregate_targets.find do |target| + target.name == 'Pods-Firestore_Tests_iOS' + end + app_target = installer.aggregate_targets.find do |target| + target.name == 'Pods-Firestore_Example_iOS' + end + app_target.pod_targets = app_target.pod_targets - test_target.pod_targets +end |