Skip to content

Commit 01ca6b3

Browse files
authored
Add clarifying documentation for command-line builds (#7517)
1 parent 4d9b6aa commit 01ca6b3

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed

Firestore/Example/Podfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright 2017 Google LLC
12

23
require 'pathname'
34

@@ -22,6 +23,8 @@ install! 'cocoapods',
2223
# https://www.ralfebert.de/ios/blog/cocoapods-clean-input-output-files/
2324
:disable_input_output_paths => true
2425

26+
# Invoke sync_project.rb after installation to force all tests to be a part of
27+
# the project.
2528
post_install do |installer|
2629
sync = Pathname.new(__FILE__).dirname.join('../../scripts/sync_project.rb')
2730
system('ruby', sync.to_s)
@@ -38,6 +41,10 @@ end
3841

3942
# Adds a `pod name, :path => ../..` declaration to use local sources if the
4043
# Podfile has been configured to operate that way.
44+
#
45+
# This is a build optimization that allows most CI builds to run more quickly
46+
# by just using local sources but allows for nightly and other builds to
47+
# validate that Firestore remains compatible with existing published pods.
4148
def maybe_local_pod(name)
4249
if use_local_sources()
4350
pod name, :path => '../..'

Firestore/README.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
## Usage
22

3+
### Xcode
4+
35
* Install [prerequisite software](//github.com/firebase/firebase-ios-sdk#development)
4-
* Set up a workspace via CocoaPods
6+
* Set up a workspace via CocoaPods (this opens Xcode):
57
```
68
$ cd Firestore/Example
79
$ pod update
@@ -10,6 +12,42 @@
1012
* Select the Firestore_Tests_iOS scheme
1113
* ⌘-u to build and run the unit tests
1214
15+
### Command-line builds
16+
17+
You can also build from the command-line, though this requires a slightly
18+
different setup:
19+
20+
```
21+
PLATFORM=iOS pod update --project-directory=Firestore/Example
22+
scripts/build.sh Firestore iOS
23+
```
24+
25+
Note:
26+
* `PLATFORM` here is specifying an environment variable that's active for the
27+
`pod update` invocation.
28+
* You can also use `macOS` or `tvOS` in place of `iOS` above.
29+
* This will modify the Xcode project files; you'll need to revert these
30+
changes to create a PR.
31+
32+
The [issue](https://github.com/CocoaPods/CocoaPods/issues/8729) that requires
33+
this workaround is that Firestore's `Podfile` contains multiple platforms, and
34+
ever since Xcode 10.2, CocoaPods generates Xcode projects that are break by
35+
default when built by the `xcodebuild` command-line tool. There's a workaround
36+
possible that involves disabling Xcode's default mechanism of finding implicit
37+
dependencies, but this is something we'd have to disable Firebase-wide and
38+
there hasn't been an appetite to do this.
39+
40+
### Swift package manager
41+
42+
Firestore also supports building with Swift Package Manager. To build this way
43+
use:
44+
45+
```
46+
scripts/build.sh Firestore iOS spm
47+
```
48+
49+
This is rarely necessary for primary development and is done automatically by CI.
50+
1351
### Improving the debugger experience
1452
1553
You can install a set of type formatters to improve the presentation of
@@ -21,6 +59,8 @@ command script import ~/path/to/firebase-ios-sdk/scripts/lldb/firestore.py
2159
2260
(substitute the location of your checkout of the firebase-ios-sdk.)
2361
62+
## Testing
63+
2464
### Running Integration Tests
2565
2666
Prefer running the integration tests against the Firestore Emulator. This is
@@ -31,6 +71,9 @@ configure a Firestore-enabled project.
3171
* In Xcode select the `Firestore_IntegrationTests_iOS` scheme (or macOS or tvOS).
3272
* ⌘-u to build and run the integration tests.
3373
74+
The command-line build script runs integration tests by default and will start
75+
and stop an emulator for you.
76+
3477
### Running Integration Tests - against production
3578
3679
Occasionally it's useful to run integration tests against a production account.
@@ -48,6 +91,8 @@ If you want to switch back to running integration tests against the emulator:
4891
* Ensure that `GoogleServices-Info.plist` is in its default state (`git
4992
checkout Firestore/Example/App/GoogleServices-Info.plist`).
5093
94+
## Other tasks
95+
5196
### Building Protos
5297
5398
Typically you should not need to worrying about regenerating the C++ files from

0 commit comments

Comments
 (0)