Skip to content

Commit 9f597a5

Browse files
committed
[Infra] Enable simple formatter for md (#7308)
Using the `prettier` formatter supported in spotless to limit markdown to 100 lines or less. NO_RELEASE_CHANGE
1 parent b60734a commit 9f597a5

File tree

103 files changed

+5181
-4875
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+5181
-4875
lines changed

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,35 @@ name: ⚠️ Report a Bug
33
about: Think you found a bug in the SDK? Report it here.
44
---
55

6-
<!-- DO NOT DELETE
6+
<!-- DO NOT DELETE
77
validate_template=true
88
template_path=.github/ISSUE_TEMPLATE/bug.md
99
-->
1010

1111
### [READ] Step 1: Are you in the right place?
1212

13-
Issues filed here should be about bugs in __the code in this repository__.
14-
If you have a general question, need help debugging, or fall into some
15-
other category use one of these other channels:
13+
Issues filed here should be about bugs in **the code in this repository**. If you have a general
14+
question, need help debugging, or fall into some other category use one of these other channels:
1615

17-
* For general technical questions, post a question on [StackOverflow](http://stackoverflow.com/)
18-
with the firebase tag.
19-
* For general Firebase discussion, use the [firebase-talk](https://groups.google.com/forum/#!forum/firebase-talk)
20-
google group.
21-
* For help troubleshooting your application that does not fall under one
22-
of the above categories, reach out to the personalized
23-
[Firebase support channel](https://firebase.google.com/support/).
16+
- For general technical questions, post a question on [StackOverflow](http://stackoverflow.com/)
17+
with the firebase tag.
18+
- For general Firebase discussion, use the
19+
[firebase-talk](https://groups.google.com/forum/#!forum/firebase-talk) google group.
20+
- For help troubleshooting your application that does not fall under one of the above categories,
21+
reach out to the personalized [Firebase support channel](https://firebase.google.com/support/).
2422

2523
### [REQUIRED] Step 2: Describe your environment
2624

27-
* Android Studio version: _____
28-
* Firebase Component: _____ (Database, Firestore, Storage, Functions, etc)
29-
* Component version: _____
25+
- Android Studio version: **\_**
26+
- Firebase Component: **\_** (Database, Firestore, Storage, Functions, etc)
27+
- Component version: **\_**
3028

3129
### [REQUIRED] Step 3: Describe the problem
3230

3331
#### Steps to reproduce:
3432

35-
What happened? How can we make the problem occur?
36-
This could be a description, log/console output, etc.
33+
What happened? How can we make the problem occur? This could be a description, log/console output,
34+
etc.
3735

3836
#### Relevant Code:
3937

.github/ISSUE_TEMPLATE/fr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: 💡 Feature Request
33
about: Have a feature you'd like to see in the Android SDK? Request it here.
44
---
55

6-
<!-- DO NOT DELETE
6+
<!-- DO NOT DELETE
77
validate_template=false
88
template_path=.github/ISSUE_TEMPLATE/fr.md
99
-->

CONTRIBUTING.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
# How to Contribute
22

3-
We'd love to accept your patches and contributions to this project. There are
4-
just a few small guidelines you need to follow.
3+
We'd love to accept your patches and contributions to this project. There are just a few small
4+
guidelines you need to follow.
55

66
## Contributor License Agreement
77

8-
Contributions to this project must be accompanied by a Contributor License
9-
Agreement. You (or your employer) retain the copyright to your contribution;
10-
this simply gives us permission to use and redistribute your contributions as
11-
part of the project. Head over to <https://cla.developers.google.com/> to see
12-
your current agreements on file or to sign a new one.
8+
Contributions to this project must be accompanied by a Contributor License Agreement. You (or your
9+
employer) retain the copyright to your contribution; this simply gives us permission to use and
10+
redistribute your contributions as part of the project. Head over to
11+
<https://cla.developers.google.com/> to see your current agreements on file or to sign a new one.
1312

14-
You generally only need to submit a CLA once, so if you've already submitted one
15-
(even if it was for a different project), you probably don't need to do it
16-
again.
13+
You generally only need to submit a CLA once, so if you've already submitted one (even if it was for
14+
a different project), you probably don't need to do it again.
1715

1816
## Code reviews
1917

20-
All submissions, including submissions by project members, require review. We
21-
use GitHub pull requests for this purpose. Consult
22-
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
23-
information on using pull requests.
18+
All submissions, including submissions by project members, require review. We use GitHub pull
19+
requests for this purpose. Consult
20+
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more information on using
21+
pull requests.
2422

2523
## Community Guidelines
2624

@@ -29,5 +27,6 @@ This project follows
2927

3028
## Contributor Documentation
3129

32-
To know more about how to setup your environment, how Firebase internals work, and
33-
best practices, take a look at our detailed [contributor documentation](https://firebase.github.io/firebase-android-sdk/).
30+
To know more about how to setup your environment, how Firebase internals work, and best practices,
31+
take a look at our detailed
32+
[contributor documentation](https://firebase.github.io/firebase-android-sdk/).

README.md

Lines changed: 75 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# Firebase Android Open Source Development
22

3-
This repository contains the source code for all Android Firebase SDKs except
4-
Analytics and Auth.
3+
This repository contains the source code for all Android Firebase SDKs except Analytics and Auth.
54

6-
Firebase is an app development platform with tools to help you build, grow and
7-
monetize your app. More information about Firebase can be found at
8-
https://firebase.google.com.
5+
Firebase is an app development platform with tools to help you build, grow and monetize your app.
6+
More information about Firebase can be found at https://firebase.google.com.
97

108
## Table of contents
119

@@ -15,10 +13,8 @@ https://firebase.google.com.
1513
1. [Integration Testing](#integration-testing)
1614
1. [Proguarding](#proguarding)
1715
1. [APIs used via reflection](#APIs-used-via-reflection)
18-
1. [APIs intended for developer
19-
consumption](#APIs-intended-for-developer-consumption)
20-
1. [APIs intended for other Firebase
21-
SDKs](#APIs-intended-for-other-firebase-sdks)
16+
1. [APIs intended for developer consumption](#APIs-intended-for-developer-consumption)
17+
1. [APIs intended for other Firebase SDKs](#APIs-intended-for-other-firebase-sdks)
2218
1. [Publishing](#publishing)
2319
1. [Dependencies](#dependencies)
2420
1. [Commands](#commands)
@@ -27,23 +23,22 @@ https://firebase.google.com.
2723

2824
## Getting Started
2925

30-
* Install the latest Android Studio (should be Meerkat | 2024.3.1 or later)
31-
* Clone the repo (`git clone --recurse-submodules [email protected]:firebase/firebase-android-sdk.git`)
32-
* When cloning the repo, it is important to get the submodules as well. If
33-
you have already cloned the repo without the submodules, you can update the
34-
submodules by running `git submodule update --init --recursive`.
35-
* Import the firebase-android-sdk gradle project into Android Studio using the
36-
**Import project(Gradle, Eclipse ADT, etc.)** option.
37-
* `firebase-crashlytics-ndk` must be built with NDK 21. See
38-
[firebase-crashlytics-ndk](firebase-crashlytics-ndk/README.md) for more
39-
details.
26+
- Install the latest Android Studio (should be Meerkat | 2024.3.1 or later)
27+
- Clone the repo (`git clone --recurse-submodules [email protected]:firebase/firebase-android-sdk.git`)
28+
- When cloning the repo, it is important to get the submodules as well. If you have already cloned
29+
the repo without the submodules, you can update the submodules by running
30+
`git submodule update --init --recursive`.
31+
- Import the firebase-android-sdk gradle project into Android Studio using the **Import
32+
project(Gradle, Eclipse ADT, etc.)** option.
33+
- `firebase-crashlytics-ndk` must be built with NDK 21. See
34+
[firebase-crashlytics-ndk](firebase-crashlytics-ndk/README.md) for more details.
4035

4136
## Testing
4237

4338
Firebase Android libraries exercise all three types of tests recommended by the
4439
[Android Testing Pyramid](https://developer.android.com/training/testing/fundamentals#testing-pyramid).
45-
Depending on the requirements of the specific project, some or all of these
46-
tests may be used to support changes.
40+
Depending on the requirements of the specific project, some or all of these tests may be used to
41+
support changes.
4742

4843
> :warning: **Running tests with errorprone**
4944
>
@@ -53,48 +48,46 @@ tests may be used to support changes.
5348
5449
### Unit Testing
5550

56-
These are tests that run on your machine's local Java Virtual Machine (JVM). At
57-
runtime, these tests are executed against a modified version of android.jar
58-
where all final modifiers have been stripped off. This lets us sandbox behaviors
59-
at desired places and use popular mocking libraries.
51+
These are tests that run on your machine's local Java Virtual Machine (JVM). At runtime, these tests
52+
are executed against a modified version of android.jar where all final modifiers have been stripped
53+
off. This lets us sandbox behaviors at desired places and use popular mocking libraries.
6054

6155
Unit tests can be executed on the command line by running
56+
6257
```bash
6358
./gradlew :<firebase-project>:check
6459
```
6560

6661
### Integration Testing
6762

68-
These are tests that run on a hardware device or emulator. These tests have
69-
access to Instrumentation APIs, give you access to information such as the
70-
[Android Context](https://developer.android.com/reference/android/content/Context).
71-
In Firebase, instrumentation tests are used at different capacities by different
72-
projects. Some tests may exercise device capabilities, while stubbing any calls
73-
to the backend, while some others may call out to nightly backend builds to
74-
ensure distributed API compatibility.
63+
These are tests that run on a hardware device or emulator. These tests have access to
64+
Instrumentation APIs, give you access to information such as the
65+
[Android Context](https://developer.android.com/reference/android/content/Context). In Firebase,
66+
instrumentation tests are used at different capacities by different projects. Some tests may
67+
exercise device capabilities, while stubbing any calls to the backend, while some others may call
68+
out to nightly backend builds to ensure distributed API compatibility.
7569

76-
Along with Espresso, they are also used to test projects that have UI
77-
components.
70+
Along with Espresso, they are also used to test projects that have UI components.
7871

7972
#### Project Setup
8073

81-
Before you can run integration tests, you need to add a `google-services.json`
82-
file to the root of your checkout. You can use the `google-services.json` from
83-
any project that includes an Android App, though you'll likely want one that's
84-
separate from any production data you have because our tests write random data.
74+
Before you can run integration tests, you need to add a `google-services.json` file to the root of
75+
your checkout. You can use the `google-services.json` from any project that includes an Android App,
76+
though you'll likely want one that's separate from any production data you have because our tests
77+
write random data.
8578

8679
If you don't have a suitable testing project already:
8780

88-
* Open the [Firebase console](https://console.firebase.google.com/)
89-
* If you don't yet have a project you want to use for testing, create one.
90-
* Add an Android app to the project
91-
* Give the app any package name you like.
92-
* Download the resulting `google-services.json` file and put it in the root of
93-
your checkout.
81+
- Open the [Firebase console](https://console.firebase.google.com/)
82+
- If you don't yet have a project you want to use for testing, create one.
83+
- Add an Android app to the project
84+
- Give the app any package name you like.
85+
- Download the resulting `google-services.json` file and put it in the root of your checkout.
9486

9587
#### Running Integration Tests on Local Emulator
9688

9789
Integration tests can be executed on the command line by running
90+
9891
```bash
9992
./gradlew :<firebase-project>:connectedCheck
10093
```
@@ -103,11 +96,12 @@ Integration tests can be executed on the command line by running
10396

10497
> You need additional setup for this to work:
10598
>
106-
> * `gcloud` needs to be [installed](https://cloud.google.com/sdk/install) on local machine
107-
> * `gcloud` needs to be configured with a project that has billing enabled
108-
> * `gcloud` needs to be authenticated with credentials that have 'Firebase Test Lab Admin' role
99+
> - `gcloud` needs to be [installed](https://cloud.google.com/sdk/install) on local machine
100+
> - `gcloud` needs to be configured with a project that has billing enabled
101+
> - `gcloud` needs to be authenticated with credentials that have 'Firebase Test Lab Admin' role
109102
110103
Integration tests can be executed on the command line by running
104+
111105
```bash
112106
./gradlew :<firebase-project>:deviceCheck
113107
```
@@ -134,92 +128,84 @@ Firebase SDKs use some special annotations for tooling purposes.
134128
### @Keep
135129

136130
APIs that need to be preserved up until the app's runtime can be annotated with
137-
[@Keep](https://developer.android.com/reference/android/support/annotation/Keep).
138-
The
139-
[@Keep](https://developer.android.com/reference/android/support/annotation/Keep)
140-
annotation is *blessed* to be honored by android's [default proguard
141-
configuration](https://developer.android.com/studio/write/annotations#keep). A common use for
142-
this annotation is because of reflection. These APIs should be generally **discouraged**, because
143-
they can't be proguarded.
131+
[@Keep](https://developer.android.com/reference/android/support/annotation/Keep). The
132+
[@Keep](https://developer.android.com/reference/android/support/annotation/Keep) annotation is
133+
_blessed_ to be honored by android's
134+
[default proguard configuration](https://developer.android.com/studio/write/annotations#keep). A
135+
common use for this annotation is because of reflection. These APIs should be generally
136+
**discouraged**, because they can't be proguarded.
144137

145138
### @KeepForSdk
146139

147-
APIs that are intended to be used by Firebase SDKs should be annotated with
148-
`@KeepForSdk`. The key benefit here is that the annotation is *blessed* to throw
149-
linter errors on Android Studio if used by the developer from a non firebase
150-
package, thereby providing a valuable guard rail.
151-
140+
APIs that are intended to be used by Firebase SDKs should be annotated with `@KeepForSdk`. The key
141+
benefit here is that the annotation is _blessed_ to throw linter errors on Android Studio if used by
142+
the developer from a non firebase package, thereby providing a valuable guard rail.
152143

153144
### @PublicApi
154145

155146
We annotate APIs that meant to be used by developers with
156-
[@PublicAPI](firebase-common/src/main/java/com/google/firebase/annotations/PublicApi.java). This
147+
[@PublicAPI](firebase-common/src/main/java/com/google/firebase/annotations/PublicApi.java). This
157148
annotation will be used by tooling to help inform the version bump (major, minor, patch) that is
158149
required for the next release.
159150

160151
## Proguarding
161152

162-
Firebase SDKs do not proguard themselves, but support proguarding. Firebase SDKs themselves are
153+
Firebase SDKs do not proguard themselves, but support proguarding. Firebase SDKs themselves are
163154
proguard friendly, but the dependencies of Firebase SDKs may not be.
164155

165156
### Proguard config
166157

167-
In addition to preguard.txt, projects declare an additional set of proguard
168-
rules in a proguard.txt that are honored by the developer's app while building
169-
the app's proguarded apk. This file typically contains the keep rules that need
170-
to be honored during the app' s proguarding phase.
158+
In addition to preguard.txt, projects declare an additional set of proguard rules in a proguard.txt
159+
that are honored by the developer's app while building the app's proguarded apk. This file typically
160+
contains the keep rules that need to be honored during the app' s proguarding phase.
171161

172-
As a best practice, these explicit rules should be scoped to only libraries
173-
whose source code is outside the firebase-android-sdk codebase making annotation
174-
based approaches insufficient.The combination of keep rules resulting from the
175-
annotations, the preguard.txt and the proguard.txt collectively determine the
176-
APIs that are preserved at **runtime**.
162+
As a best practice, these explicit rules should be scoped to only libraries whose source code is
163+
outside the firebase-android-sdk codebase making annotation based approaches insufficient.The
164+
combination of keep rules resulting from the annotations, the preguard.txt and the proguard.txt
165+
collectively determine the APIs that are preserved at **runtime**.
177166

178167
## Publishing
179168

180-
Firebase is published as a collection of libraries each of which either
181-
represents a top level product, or contains shared functionality used by one or
182-
more projects. The projects are published as managed maven artifacts available
183-
at [Google's Maven Repository](https://maven.google.com). This section helps
184-
reason about how developers may make changes to firebase projects and have their
185-
apps depend on the modified versions of Firebase.
169+
Firebase is published as a collection of libraries each of which either represents a top level
170+
product, or contains shared functionality used by one or more projects. The projects are published
171+
as managed maven artifacts available at [Google's Maven Repository](https://maven.google.com). This
172+
section helps reason about how developers may make changes to firebase projects and have their apps
173+
depend on the modified versions of Firebase.
186174

187175
### Dependencies
188176

189177
Any dependencies, within the projects, or outside of Firebase are encoded as
190178
[maven dependencies](https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html)
191-
into the `pom` file that accompanies the published artifact. This allows the
192-
developer's build system (typically Gradle) to build a dependency graph and
193-
select the dependencies using its own [resolution
194-
strategy](https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.ResolutionStrategy.html)
179+
into the `pom` file that accompanies the published artifact. This allows the developer's build
180+
system (typically Gradle) to build a dependency graph and select the dependencies using its own
181+
[resolution strategy](https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.ResolutionStrategy.html)
195182

196183
### Commands
197184

198-
For more advanced use cases where developers wish to make changes to a project,
199-
but have transitive dependencies point to publicly released versions, individual
200-
projects may be published as follows.
185+
For more advanced use cases where developers wish to make changes to a project, but have transitive
186+
dependencies point to publicly released versions, individual projects may be published as follows.
201187

202188
```bash
203189
# e.g. to publish Firestore and Functions
204190
./gradlew -PprojectsToPublish="firebase-firestore,firebase-functions" \
205191
publishReleasingLibrariesToMavenLocal
206192
```
207193

208-
Developers may take a dependency on these locally published versions by adding
209-
the `mavenLocal()` repository to your [repositories
210-
block](https://docs.gradle.org/current/userguide/declaring_repositories.html) in
211-
your app module's build.gradle.
194+
Developers may take a dependency on these locally published versions by adding the `mavenLocal()`
195+
repository to your
196+
[repositories block](https://docs.gradle.org/current/userguide/declaring_repositories.html) in your
197+
app module's build.gradle.
212198

213199
### Code Formatting
214200

215201
Java and Kotlin are both formatted using `spotless`.
216202

217203
To run formatting on a project, run
204+
218205
```bash
219206
./gradlew :<firebase-project>:spotlessApply
220207
```
221208

222209
### Contributing
223210

224-
We love contributions! Please read our
225-
[contribution guidelines](/CONTRIBUTING.md) to get started.
211+
We love contributions! Please read our [contribution guidelines](/CONTRIBUTING.md) to get started.

0 commit comments

Comments
 (0)