Selaa lähdekoodia

Docs update and directory structure proposal (#3224)

Paul Beusterien 6 vuotta sitten
vanhempi
sitoutus
589c53df8c
2 muutettua tiedostoa jossa 52 lisäystä ja 8 poistoa
  1. 46 0
      AddNewPod.md
  2. 6 8
      README.md

+ 46 - 0
AddNewPod.md

@@ -0,0 +1,46 @@
+# Adding a New Firebase CocoaPod
+
+## Introduction
+
+The Firebase build is driven by the contents of a podspec. It is helpful to
+use an existing podspec as a template when starting a new pod.
+
+## Podspec attributes
+
+See the [Podspec Syntax Reference](https://guides.cocoapods.org/syntax/podspec.html) for
+detailed instructions. Some Firebase specific guidance below:
+
+* `s.deployment_target` - Ideally should include ios, osx, and tvos. See
+[FirebaseCore.podspec](FirebaseCore.podspec) for the current Firebase minimum version settings.
+
+* `s.static_framework` - By default, Firebase pods should be static frameworks.
+
+* `s.dependency` - Dependencies on other Firebase pods should allow minor version updates -
+like `s.dependency 'FirebaseCore', '~> 6.0'`
+
+* `s.pod_target_xcconfig` - Add any specific build settings.
+  * For portability, any Firebase
+pod with other Firebase dependencies should build for c99 -
+`'GCC_C_LANGUAGE_STANDARD' => 'c99'`.
+  * The pod's version should be passed in as a #define
+for FIRComponent registration. See examples of setting `GCC_PREPROCESSOR_DEFINITIONS`.
+  * All imports (outside of Public headers) should be repo relative -
+    `'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}"'`.
+
+* `s.test_spec` should be used for defining all unit and integration test suites.
+
+
+## Directory Structure
+
+The Firebase library `Foo` should be defined in `FirebaseFoo.podspec`. All of its
+contents should be in the `FirebaseFoo` directory.
+
+* FirebaseFoo/Sources - All source. Directory structure is up to the library owner. Any code from a
+non-Google open source project should be nested under a `third_party` directory.
+* FirebaseFoo/Public - Public Headers.
+* FirebaseFoo/Private - Private Headers (headers not part of public API, but available for
+explicit import by other Firebase pods)
+* FirebaseFoo/Tests/Unit - Required (If the library only has unit tests, `Unit` can be omitted.)
+* FirebaseFoo/Tests/Integration - Encouraged
+* FirebaseFoo/Tests/Sample - Optional
+* FirebaseFoo/Tests/{Other} - Optional

+ 6 - 8
README.md

@@ -76,20 +76,18 @@ the following software:
   * Xcode 10.1 (or later)
   * CocoaPods 1.7.2 (or later)
 
-Follow the subsequent instructions to develop, debug, unit test, run integration
-tests, and try out reference samples:
+For the pod that you want to develop:
 
-```
-$ git clone git@github.com:firebase/firebase-ios-sdk.git
-$ cd firebase-ios-sdk/Example
-$ pod update
-$ open Firebase.xcworkspace
-```
+`pod gen Firebase{name here}.podspec --local-sources=./ --auto-open`
 
 Firestore and Functions have self contained Xcode projects. See
 [Firestore/README.md](Firestore/README.md) and
 [Functions/README.md](Functions/README.md).
 
+### Adding a New Firebase Pod
+
+See [AddNewPod.md](AddNewPod.md).
+
 ### Code Formatting
 
 To ensure that the code is formatted consistently, run the script