Skip to content

Commit 9695c3f

Browse files
author
Hui-Wu
authored
Wuandy/readme.md (#453)
Add more instructions to firestore/README.md, including how to build/test/integration test Firestore, and how to build a local maven release with latest firestore (and also latest dependencies).
1 parent ccdf2da commit 9695c3f

File tree

1 file changed

+73
-1
lines changed

1 file changed

+73
-1
lines changed

firebase-firestore/README.md

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,84 @@ responsive apps that work regardless of network latency or Internet
1010
connectivity. Cloud Firestore also offers seamless integration with other
1111
Firebase and Google Cloud Platform products, including Cloud Functions.
1212

13+
## Building
14+
1315
All Gradle commands should be run from the source root (which is one level up
1416
from this folder). See the README.md in the source root for instructions on
1517
publishing/testing Cloud Firestore.
1618

17-
## Testing
19+
To build Cloud Firestore, from the source root run:
20+
```bash
21+
./gradlew :firebase-firestore:assembleRelease
22+
```
23+
24+
## Unit Testing
25+
26+
To run unit tests for Cloud Firestore, from the source root run:
27+
```bash
28+
./gradlew :firebase-firestore:check
29+
```
30+
31+
## Integration Testing
32+
33+
Running integration tests requires a Firebase project because they would try
34+
to connect to the Firestore backends.
35+
36+
See [here](../README.md#project-setup) for how to setup a project.
37+
38+
Once you setup the project, download `google-services.json` and place it in
39+
the source root.
40+
41+
Make sure you have created a Firestore instance for your project, before
42+
you proceed.
43+
44+
### Run on Local Emulator
45+
46+
Then simply run:
47+
```bash
48+
./gradlew :firebase-firestore:connectedCheck
49+
```
50+
51+
### Run on Firebase Test Lab
52+
53+
You can also test on Firebase Test Lab, which allow you to run the integration
54+
tests on devices hosted in Google data center.
55+
56+
See [here](../README.md#running-integration-tests-on-firebase-test-lab) for
57+
instructions of how to setup Firebase Test Lab for your project.
58+
59+
Run:
60+
```bash
61+
./gradlew :firebase-firestore:deviceCheck
62+
```
63+
64+
## Code Formatting
65+
66+
Run below to format Java code:
67+
```bash
68+
./gradlew :firebase-firestore:googleJavaFormat
69+
```
70+
71+
See [here](../README.md#code-formatting) if you want to be able to format code
72+
from within Android Studio.
73+
74+
## Build Local Jar of Firestore SDK
75+
76+
Run:
77+
```bash
78+
./gradlew publishAllToLocal
79+
```
80+
81+
This will publish firebase SDK at SNAPSHOT versions. All pom level dependencies
82+
within the published artifacts will also point to SNAPSHOT versions that are
83+
co-published. The results will be built into your local maven repo.
84+
85+
Developers may then take a dependency on these locally published versions by adding
86+
the `mavenLocal()` repository to your [repositories
87+
block](https://docs.gradle.org/current/userguide/declaring_repositories.html) in
88+
your app module's build.gradle.
1889

90+
## Misc
1991
After importing the project into Android Studio and building successfully
2092
for the first time, Android Studio will delete the run configuration xml files
2193
in `./idea/runConfigurations`. Undo these changes with the command:

0 commit comments

Comments
 (0)