Skip to content

Commit fd1add6

Browse files
authored
Update instructions for manual Package manifests. (#6496)
* Update instructions for manual Package manifests. This is for developers not integrating with Xcode. Fixes #6357 * Whitespace removal. * Review feedback
1 parent 26f9271 commit fd1add6

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

SwiftPackageManager.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Package Manager](https://swift.org/package-manager/) in Beta status.
1818

1919
If you've previously used CocoaPods, remove them from the project with `pod deintegrate`.
2020

21+
### In Xcode
22+
2123
Install Firebase via Swift Package Manager:
2224

2325
<img src="docs/resources/SPMAddPackage.png">
@@ -44,6 +46,35 @@ in the `Build Settings` tab.
4446

4547
<img src="docs/resources/SPMObjC.png">
4648

49+
### Alternatively, add Firebase to a `Package.swift` manifest
50+
51+
To integrate via a `Package.swift` manifest instead of Xcode, you can add
52+
Firebase to your dependencies array of your package with:
53+
54+
```
55+
dependencies: [
56+
// Substitute X.Y with the version of Firebase you want.
57+
.package(name: "Firebase",
58+
url: "https://github.com/firebase/firebase-ios-sdk.git",
59+
.branch("X.Y-spm-beta")),
60+
61+
// Any other dependencies you have...
62+
],
63+
```
64+
65+
Then in any target that depends on a Firebase product, add it to the `dependencies`
66+
array of that target:
67+
68+
```
69+
.target(
70+
name: "MyTargetName",
71+
dependencies: [
72+
// The product name you need. In this example, FirebaseAuth.
73+
.product(name: "FirebaseAuth", package: "Firebase"),
74+
]
75+
),
76+
```
77+
4778
## Questions and Issues
4879

4980
Please provide any feedback via a [GitHub

0 commit comments

Comments
 (0)