Skip to content

Commit 0aa02c7

Browse files
authored
[Infra] Sync agents.md and gemini.md (#7394)
The later was generated by gemini-cli `/init` command. By merging both we add any extra information gemini-cli could have detected when generating its own context file, and it's easy to keep just one file, `agents.md`, as the source of truth.
1 parent badab21 commit 0aa02c7

File tree

1 file changed

+91
-36
lines changed

1 file changed

+91
-36
lines changed

agents.md

Lines changed: 91 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
This guide provides essential information for working within the `firebase-android-sdk` repository.
44

5+
## Project Overview
6+
7+
This repository contains the source code for the Firebase Android SDKs. It is a large, multi-module
8+
Gradle project. The project is written in a mix of Java and Kotlin.
9+
10+
The project is structured as a collection of libraries, each representing a Firebase product or a
11+
shared component. These libraries are published as Maven artifacts to Google's Maven Repository.
12+
513
## Project Structure
614

715
The `subprojects.cfg` file lists all the subprojects in this repository. Each line in this file
@@ -58,31 +66,78 @@ tool for this purpose.
5866
would run `sdkmanager "ndk;21.4.7075529"`. Always refer to the project's `README.md` for the
5967
exact version required.
6068
61-
---
69+
## Building and Running
6270
63-
## Testing
71+
The project is built using Gradle. The `gradlew` script is provided in the root directory.
6472
65-
This repository uses two main types of tests:
73+
### Building
6674
67-
1. **Unit Tests**:
75+
To build the entire project, you can run the following command:
6876
69-
- These tests run on the local JVM.
70-
- To execute unit tests for a specific project, run:
71-
```bash
72-
./gradlew :<firebase-project>:check
73-
```
77+
```bash
78+
./gradlew build
79+
```
7480
75-
2. **Integration Tests**:
76-
- These tests run on a hardware device or emulator.
77-
- Ensure a `google-services.json` file is present in the repository root.
78-
- To execute integration tests for a specific project, run:
79-
```bash
80-
./gradlew :<firebase-project>:connectedCheck
81-
```
81+
To build a specific project, you can run:
82+
83+
```bash
84+
./gradlew :<firebase-project>:build
85+
```
86+
87+
### Running Tests
88+
89+
The project has three types of tests: unit tests, integration tests, and smoke tests.
90+
91+
#### Unit Tests
92+
93+
Unit tests run on the local JVM. They can be executed with the following command:
94+
95+
```bash
96+
./gradlew :<firebase-project>:check
97+
```
98+
99+
#### Integration Tests
100+
101+
Integration tests run on a hardware device or emulator. Before running integration tests, you need
102+
to add a `google-services.json` file to the root of the project.
103+
104+
To run integration tests on a local emulator, use the following command:
105+
106+
```bash
107+
./gradlew :<firebase-project>:connectedCheck
108+
```
109+
110+
To run integration tests on Firebase Test Lab, use the following command:
111+
112+
```bash
113+
./gradlew :<firebase-project>:deviceCheck
114+
```
115+
116+
### Publishing
117+
118+
To publish a project locally, you can use the following command:
119+
120+
```bash
121+
./gradlew -PprojectsToPublish="<firebase-project>" publishReleasingLibrariesToMavenLocal
122+
```
123+
124+
## Development Conventions
125+
126+
### Code Formatting
82127
83-
---
128+
The project uses Spotless for code formatting. To format the code, run the following command:
84129
85-
## API Surface
130+
```bash
131+
./gradlew spotlessApply
132+
```
133+
134+
To format a specific project, run:
135+
136+
```bash
137+
./gradlew :<firebase-project>:spotlessApply
138+
```
139+
140+
### API Surface
86141
87142
The public API of the Firebase SDKs is managed using a set of annotations:
88143
@@ -92,9 +147,7 @@ The public API of the Firebase SDKs is managed using a set of annotations:
92147
- `@Keep`: Marks APIs that need to be preserved at runtime, usually due to reflection. This
93148
annotation should be used sparingly as it prevents Proguard from removing or renaming the code.
94149
95-
---
96-
97-
## Common Patterns
150+
### Common Patterns
98151
99152
This repository uses a combination of dependency injection frameworks:
100153
@@ -107,7 +160,22 @@ This repository uses a combination of dependency injection frameworks:
107160
the `ComponentRegistrar` of an SDK, which allows for the injection of dependencies from
108161
`firebase-components` into the Dagger graph.
109162
110-
---
163+
### Proguarding
164+
165+
The project supports Proguarding. Proguard rules are defined in `proguard.txt` files within each
166+
project.
167+
168+
## External Dependencies
169+
170+
Do not add, under any circunstance, any new dependency to a SDK that does not already exists in the
171+
`gradle/libs.versions.toml`, and even then, only do it if cxexplicitly asked to do so. The Firebase
172+
SDKs are designed to be lightweight, and adding new dependencies can increase the size of the final
173+
artifacts.
174+
175+
## Contributing
176+
177+
Contributions are welcome. Please read the [contribution guidelines](/CONTRIBUTING.md) to get
178+
started.
111179
112180
## Iteration Loop
113181
@@ -123,20 +191,7 @@ After you make a change, here's the flow you should follow:
123191
```
124192
- If necessary, run integration tests based on the instructions above.
125193

126-
---
127-
128-
## External Dependencies
129-
130-
---
131-
132-
Do not add, under any circunstance, any new dependency to a SDK that does not already exists in the
133-
`gradle/libs.versions.toml`, and even then, only do it if cxexplicitly asked to do so. The Firebase
134-
SDKs are designed to be lightweight, and adding new dependencies can increase the size of the final
135-
artifacts.
136-
137-
---
138-
139194
## Updating this Guide
140195

141196
If new patterns or conventions are discovered, update this guide to ensure it remains a useful
142-
resource.
197+
resource.

0 commit comments

Comments
 (0)