You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clean up the README.md file to focus on 3rd party devs (#606)
* Extract SDK's technical details from the readme.md
* Add Features/Installation/Documentation sections to the README.md
* Replace groovy examples with Kotlin script syntax
Copy file name to clipboardExpand all lines: README.md
+23-189
Original file line number
Diff line number
Diff line change
@@ -15,212 +15,46 @@ If you're also looking to integrate Gravatar in your iOS app, check out our [Gra
15
15
<img src="docs/images/profile_light_demo.png" />
16
16
</p>
17
17
18
-
## Getting started
19
-
Hi there! If you're here because you want to integrate the Gravatar SDK into your Android application, please take a look at our [Get Started guide](/docs/get-started/get-started.md). You'll find a quick overview of how to get an API key and use the library in your projects.
18
+
## Features
20
19
21
-
## Architecture
20
+
- Ready-to-use asynchronous services for Gravatar REST API based on Kotlin Coroutines.
21
+
- Avatar URL calculator based on email and several query options.
22
+
- Display a profile view or an avatar through ready-to-use Jetpack Compose UI components.
23
+
- QuickEditor: This customizable sheet allows you to manage your avatar and Gravatar profile. You can select an existing avatar or upload a new one, and it provides a summary of your Gravatar profile.
22
24
23
-
This project contains the source code for the Gravatar SDK library and a demo app. The demo app aims to achieve two different goals. On the one hand, it demonstrates how to use the Gravatar SDK library. On the other hand it serves as a testbed for the library.
25
+
## Installation
24
26
25
-
### Gravatar SDK Architecture
26
-
27
-
The SDK is still in its early stages, but we can identify the following modules:
28
-
29
-
#### Gravatar (Core)
30
-
31
-
The core functionality of the Gravatar SDK library. It provides a set of classes and methods to interact with the Gravatar API.
32
-
33
-
-[**Gravatar API clients**](gravatar/src/main/java/com/gravatar/services): A set of classes and methods to interact with the Gravatar API. It's responsible for handling the network requests and parsing the responses.
34
-
-**Gravatar Utils**: A set of utility classes and methods to handle the Gravatar URLs, the Gravatar profile, etc.
35
-
36
-
#### Gravatar UI
37
-
38
-
A set of UI components to display the Gravatar images, profiles or information in general. Those components are implemented in Jetpack Compose and can contain logic to interact with the Gravatar API client.
39
-
40
-
-[**Gravatar UI components**](gravatar-ui/src/main/java/com/gravatar/ui): A set of UI components to display the Gravatar images, profiles or information in general. Those components are implemented in Jetpack Compose and can contain logic to interact with the Gravatar API client.
41
-
42
-
#### QuickEditor
43
-
44
-
The QuickEditor module contains tools and UI components to quickly edit the Gravatar profile.
45
-
46
-
### Dependency Injection
47
-
48
-
We decided to go with a manual injection basically for two main reasons:
49
-
50
-
- We avoid adding a new project dependency and possible conflicts while integrating the SDK.
51
-
- The expected size and complexity of the SDK allow manual injection without too much trouble.
52
-
53
-
If you need to inject classes, you can use the [GravatarSdkContainer](gravatar/src/main/java/com/gravatar/di/container/GravatarSdkContainer.kt) class as the entry point. This class is responsible for all the DI in the SDK.
54
-
55
-
## Tests
56
-
57
-
Run unit tests on your machine via the following command:
58
-
59
-
```sh
60
-
./gradlew test
61
-
```
62
-
63
-
## Screenshot Tests
64
-
65
-
We use [Roborazzi](https://github.com/takahirom/roborazzi) to take screenshots of the UI components. The screenshots are stored in the [`screenshotsTests` directory](gravatar-ui/screenshotTests/roborazzi/). To regenerate the screenshots, run the following command:
We use [OpenAPI Generator](https://openapi-generator.tech/) to generate the API code from the OpenAPI definitions.
137
-
138
-
The SDK project has integrated the OpenAPI Generator Gradle plugin to generate the API code from the OpenAPI definitions. The plugin is
139
-
configured in the `build.gradle.kts` file.
140
-
141
-
The OpenAPI definitions are located in the `openapi` directory. In the same directory, you can find the `templates` directory, which contains
142
-
the custom templates used by the OpenAPI Generator to generate the code that the Gravatar library needs. You can obtain the default templates by running the following command:
The [OpenAPI Generator documentation](https://openapi-generator.tech/docs/templating) provides more information about the templates.
149
-
150
-
The generator's output folder is the `build` directory. However, as we don't need all the generated files, the Gradle task has been modified to move only the desired code to the `gravatar` module. In addition, the
151
-
last step of the task is to format the generated code with [Ktlint](README.md#coding-style).
152
-
153
-
<spanstyle="color:red">**Important:**</span> Do not manually modify the `com.gravatar.api` folder. The OpenAPI Generator will overwrite it.
154
-
155
-
To regerate the code you can use the following gradlew task:
156
-
157
-
```sh
158
-
./gradlew :gravatar:openApiGenerate
159
-
```
160
-
161
-
## Publishing
162
-
163
-
All new versions are published in the Maven Central repository.
164
-
165
-
Older versions (<=2.3.1) were published to the Automattic's S3 instance via [`publish-to-s3`](https://github.com/Automattic/publish-to-s3-gradle-plugin) Gradle plugin.
166
-
167
-
The published version is calculated depending on the Git context, in this order:
168
-
- if there's a tag, version is `<tag name>`
169
-
- if there's a PR, version is `<pr number>-<commit hash>`
170
-
- else `<branch name>-<commit hash>`
171
-
172
-
To use the repository, it's needed to add the custom repository:
173
-
174
-
```groovy
175
-
repositories {
176
-
maven {
177
-
url "https://a8c-libs.s3.amazonaws.com/android"
178
-
}
179
-
}
27
+
To add the Gravatar SDK to your project, you can use the following Gradle dependency:
We're using [kdoc](https://kotlinlang.org/docs/kotlin-doc.html) to document the library's code. [Dokka](https://kotlinlang.org/docs/dokka-introduction.html) has been setup to generate html documentation from kdoc. To generate the HTML docs in `docs/dokka/`, run the following command:
39
+
Additionally, if you're using version 2.3.1 or older of the SDK, you need to add custom Gradle repository:
Here is the most recent release of the [Gravatar-SDK-Android API documentation generated by Dokka](https://automattic.github.io/Gravatar-SDK-Android/current/index.html).
199
-
200
-
201
-
## Translations
202
-
203
-
Gravatar Android SDK uses [GlotPress](https://translate.wordpress.com/projects/gravatar/gravatar-android-sdk/) to translate strings in the project.
204
-
This includes two modules with `strings.xml` files: `:gravatar-ui` and `:gravatar-quickeditor`.
For further details on how to integrate in your own app please take a look at our [Get Started guide](/docs/get-started/get-started.md). You'll find a quick overview of how to get an API key and use the library in your projects.
212
50
213
-
If `skip_commit`is set to `false` it will automatically create a new commit with the new translations.
214
-
If you wish to check the changes first set it to `true` and commit the changes yourself.
51
+
## Documentation
215
52
216
-
## Release process
53
+
You can find the full API documentation [here](https://automattic.github.io/Gravatar-SDK-Android/current/index.html).
217
54
218
-
We're following [Semantic Versioning](https://semver.org/) for the releases. Here is the process to create a new release:
55
+
## For Maintainers
219
56
220
-
1. Make sure the latest translations are commited the repository. See [Translations](#Translations)
221
-
2. Pull the `trunk` branch and tag the git commit with the version number: `git tag -a x.x.x -m "Release x.x.x"`
222
-
3. Push the new tag: `git push --tags`.
223
-
4. Go to the [GitHub releases page](https://github.com/Automattic/Gravatar-SDK-Android/releases) and create a new release with the tag name and the release notes.
57
+
If you're contributing to or maintaining this project, check out [SDK's technical details](/docs/sdk-technical-details/sdk-techincal-details.md).
0 commit comments