|
1 |
| -# App |
2 |
| -Collection of UI components and utilities for Jetpack Compose |
3 |
| - |
4 |
| -## TODOS |
5 |
| -- [x] Project setup |
6 |
| -- [x] Convention Plugins |
7 |
| -- [ ] Sonarqube |
8 |
| -- [ ] CI/CD and PR validation, Spotless, Detekt, tests |
9 |
| -- [ ] Release management, Maven Publish, Changelog, Tags & Releases |
10 |
| -- [ ] Documentation setup |
| 1 | +# Android Library Template |
| 2 | + |
| 3 | +This is a template for creating Android Open Source libraries. This template features |
| 4 | + |
| 5 | +- :rocket: Basis Project structure that includes demo and library modules |
| 6 | +- :octocat: CI/CD with GitHub Actions for release and snapshot builds, documentation generation |
| 7 | +- :mag: Code Quality checks with Detekt, Spotless and Tests |
| 8 | +- :book: Documentation setup with Dokka and MkDocs |
| 9 | +- :package: Dependency management with Version Catalogue |
| 10 | +- :memo: CHANGELOG following a keepchangelog.com format |
| 11 | +- :wrench: Gradle Convention Plugins for consistent build configuration across modules |
| 12 | + |
| 13 | +## Table of Contents |
| 14 | + - [Usage](#usage) |
| 15 | + - [Branching Strategy](#branching-strategy) |
| 16 | + - [CI/CD](#cicd) |
| 17 | + - [Release Management](#release-management) |
| 18 | + - [Draft Releases \& Snapshots](#draft-releases--snapshots) |
| 19 | + - [Release](#release) |
| 20 | + - [Changelog](#changelog) |
| 21 | + - [Documentation](#documentation) |
| 22 | + - [Contributing](#contributing) |
| 23 | + - [Resources](#resources) |
| 24 | + |
| 25 | +## Usage |
| 26 | +1. Click on the `Use this template` button to create a new repository from this template. |
| 27 | +2. Update the `gradle.properties` files with the correct values for your library. |
| 28 | +3. Add following secrets to your repository to enable publishing to Maven Central (For more information about following properties, please refer to [Gradle Maven Publish Plugin](https://vanniktech.github.io/gradle-maven-publish-plugin/central/)) |
| 29 | + - `ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD` - Your Maven Central password |
| 30 | + - `ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME` - Your Maven Central username |
| 31 | + - `ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY` - Your GPG key |
| 32 | + - `ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD` - Your GPG key password |
| 33 | + - `ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYID` - Your GPG key ID |
| 34 | + |
| 35 | + |
| 36 | +## Branching Strategy |
| 37 | + |
| 38 | +This templates follows a trunk-based approach using its `main` branch as the single source of truth |
| 39 | +for all changes. |
| 40 | +Feature/Fixes and etc branches are created from `main` and are merged back using pull requests. |
| 41 | + |
| 42 | +## CI/CD |
| 43 | + |
| 44 | +This template uses GitHub Actions for CI/CD. The following workflows are set up: |
| 45 | + |
| 46 | +- **Verify Pull Request**: Checks code quality with Detekt and Spotless, and runs tests |
| 47 | +- **Publish Snapshot**: Publishes a snapshot version of the library to GitHub Packages |
| 48 | +- **Publish Release**: Publishes a release version of the library to GitHub Packages |
| 49 | +- **Generate Docs**: Generates documentation with Dokka and MkDocs |
| 50 | + |
| 51 | + |
| 52 | +## Release Management |
| 53 | + |
| 54 | +The release management is tied to the GitHub Releases. |
| 55 | + |
| 56 | +### Draft Releases & Snapshots |
| 57 | + |
| 58 | +Every push to the `main` triggers main workflow that will create a draft release. The draft release |
| 59 | +version is set to the current version located in `gradle.properties` and the release notes for it |
| 60 | +are taken from the `CHANGELOG.md`. |
| 61 | + |
| 62 | +> In case the Draft Release exists already, it will be deleted and replaced with new one, so that |
| 63 | +> there is only one draft release. |
| 64 | +
|
| 65 | +Together with Draft Releases the snapshot is published |
| 66 | +This is done by applying `-SNAPSHOT` suffix to the version and publishing it to the Maven Central. |
| 67 | + |
| 68 | +### Release |
| 69 | + |
| 70 | +By promoting a Draft Release, the release workflow is triggered. It will publish the library to the |
| 71 | +to the Maven Central. |
| 72 | + |
| 73 | +## Changelog |
| 74 | + |
| 75 | +This template follows the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format for |
| 76 | +changelog entries. The changelog is stored in the `CHANGELOG.md` file. |
| 77 | +When Draft Release is created, the script `get_changelog.sh` |
| 78 | +will be executed to update the release notes with the latest changes according |
| 79 | +to the latest version specified in the `gradle.properties` file. |
| 80 | + |
| 81 | +## Documentation |
| 82 | + |
| 83 | +This template uses Dokka for code documentation and MkDocs Material for project documentation. |
| 84 | +For more information on how to use MkDocs, please refer to |
| 85 | +the [MkDocs documentation](https://www.mkdocs.org/) and Mkdocs |
| 86 | +Material [documentation](https://squidfunk.github.io/mkdocs-material/). |
| 87 | + |
| 88 | +The Dokka plugin is applied to the library module and generates KDocks documentation for the |
| 89 | +library. The generated documentation is published together with the project documentation and can be |
| 90 | +accessed using github pages. |
| 91 | + |
| 92 | + |
| 93 | +## Contributing |
| 94 | +Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. |
| 95 | +Please make sure to update tests as appropriate. |
| 96 | + |
| 97 | + |
| 98 | +## Resources |
| 99 | +- [Gradle Maven Publish Plugin](https://vanniktech.github.io/gradle-maven-publish-plugin/central/) |
| 100 | +- [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) |
| 101 | +- [MkDocs](https://www.mkdocs.org/) |
| 102 | +- [Mkdocs Material](https://squidfunk.github.io/mkdocs-material/) |
| 103 | +- [Dokka](https://github.com/Kotlin/dokka) |
| 104 | +- [GitHub Actions](https://docs.github.com/en/actions) |
| 105 | +- [Detekt](https://detekt.github.io/detekt/) |
| 106 | +- [Spotless](https://github.com/diffplug/spotless) |
11 | 107 |
|
0 commit comments