Skip to content

Commit 589c53d

Browse files
authored
Docs update and directory structure proposal (#3224)
1 parent 91ceae1 commit 589c53d

File tree

2 files changed

+52
-8
lines changed

2 files changed

+52
-8
lines changed

AddNewPod.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,18 @@ the following software:
7676
* Xcode 10.1 (or later)
7777
* CocoaPods 1.7.2 (or later)
7878

79-
Follow the subsequent instructions to develop, debug, unit test, run integration
80-
tests, and try out reference samples:
79+
For the pod that you want to develop:
8180

82-
```
83-
$ git clone [email protected]:firebase/firebase-ios-sdk.git
84-
$ cd firebase-ios-sdk/Example
85-
$ pod update
86-
$ open Firebase.xcworkspace
87-
```
81+
`pod gen Firebase{name here}.podspec --local-sources=./ --auto-open`
8882

8983
Firestore and Functions have self contained Xcode projects. See
9084
[Firestore/README.md](Firestore/README.md) and
9185
[Functions/README.md](Functions/README.md).
9286

87+
### Adding a New Firebase Pod
88+
89+
See [AddNewPod.md](AddNewPod.md).
90+
9391
### Code Formatting
9492

9593
To ensure that the code is formatted consistently, run the script

0 commit comments

Comments
 (0)