|
| 1 | +# Adding a New Firebase CocoaPod |
| 2 | + |
| 3 | +## Introduction |
| 4 | + |
| 5 | +The Firebase build is driven by the contents of a podspec. It is helpful to |
| 6 | +use an existing podspec as a template when starting a new pod. |
| 7 | + |
| 8 | +## Podspec attributes |
| 9 | + |
| 10 | +See the [Podspec Syntax Reference](https://guides.cocoapods.org/syntax/podspec.html) for |
| 11 | +detailed instructions. Some Firebase specific guidance below: |
| 12 | + |
| 13 | +* `s.deployment_target` - Ideally should include ios, osx, and tvos. See |
| 14 | +[FirebaseCore.podspec](FirebaseCore.podspec) for the current Firebase minimum version settings. |
| 15 | + |
| 16 | +* `s.static_framework` - By default, Firebase pods should be static frameworks. |
| 17 | + |
| 18 | +* `s.dependency` - Dependencies on other Firebase pods should allow minor version updates - |
| 19 | +like `s.dependency 'FirebaseCore', '~> 6.0'` |
| 20 | + |
| 21 | +* `s.pod_target_xcconfig` - Add any specific build settings. |
| 22 | + * For portability, any Firebase |
| 23 | +pod with other Firebase dependencies should build for c99 - |
| 24 | +`'GCC_C_LANGUAGE_STANDARD' => 'c99'`. |
| 25 | + * The pod's version should be passed in as a #define |
| 26 | +for FIRComponent registration. See examples of setting `GCC_PREPROCESSOR_DEFINITIONS`. |
| 27 | + * All imports (outside of Public headers) should be repo relative - |
| 28 | + `'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}"'`. |
| 29 | + |
| 30 | +* `s.test_spec` should be used for defining all unit and integration test suites. |
| 31 | + |
| 32 | + |
| 33 | +## Directory Structure |
| 34 | + |
| 35 | +The Firebase library `Foo` should be defined in `FirebaseFoo.podspec`. All of its |
| 36 | +contents should be in the `FirebaseFoo` directory. |
| 37 | + |
| 38 | +* FirebaseFoo/Sources - All source. Directory structure is up to the library owner. Any code from a |
| 39 | +non-Google open source project should be nested under a `third_party` directory. |
| 40 | +* FirebaseFoo/Public - Public Headers. |
| 41 | +* FirebaseFoo/Private - Private Headers (headers not part of public API, but available for |
| 42 | +explicit import by other Firebase pods) |
| 43 | +* FirebaseFoo/Tests/Unit - Required (If the library only has unit tests, `Unit` can be omitted.) |
| 44 | +* FirebaseFoo/Tests/Integration - Encouraged |
| 45 | +* FirebaseFoo/Tests/Sample - Optional |
| 46 | +* FirebaseFoo/Tests/{Other} - Optional |
0 commit comments