A simple Github template that lets you create an Android/Kotlin project and be up and running in a few seconds.
This template is focused on delivering a project with static analysis and continuous integration already in place.
Just click on button to create a new repo starting from this template.
Once created don't forget to update the:
- 100% Kotlin-only template.
- Husky git pre-hook. To enable run once
npm install
. - 3 Sample modules (Android app, Android library, Kotlin library).
- Sample Espresso, Instrumentation & JUnit tests.
- 100% Gradle Kotlin DSL setup.
- Dependency versions managed via
buildSrc
. - CI Setup with GitHub Actions.
- Kotlin Static Analysis via
ktlint
anddetekt
. - Publishing Ready.
- Issues Template (bug report + feature request)
- Pull Request Template.
- Libraries update detection
- To run units use
./gradlew test
- To run detekt and klint use
./gradlew check
- To run format simply run
./gradlew ktlintFormat
- To check for the dependencies updates use
./gradlew dependencyUpdates
. Good practice to do this at the start of every sprint.
Run npm install
once to enable git pre-hook functionality. Check package.json to modify.
This template is using Gradle Kotlin DSL as well as the Plugin DSL to setup the build.
Dependencies are centralized inside the Dependencies.kt file in the buildSrc
folder. This provides convenient auto-completion when writing your gradle files.
This template is using ktlint with the ktlint-gradle plugin to format your code. To reformat all the source code as well as the buildscript you can run the ktlintFormat
gradle task.
This template is also using detekt to analyze the source code, with the configuration that is stored in the detekt.yml file (the file has been generated with the detektGenerateConfig
task).
This template is using GitHub Actions as CI. You don't need to setup any external service and you should have a running CI once you start using this template.
There are currently the following workflows available:
- Validate Gradle Wrapper - Will check that the gradle wrapper has a valid checksum;
- Pre Merge Checks - Will run the
build
,check
andpublishToMavenLocal
tasks; - Publish Release to firebase
- Will build release on push to the
main
branch; - Sign build by the keys from github secrets;
- Prepare release notes upon commits starting from the last tag;
- Publish build to the Firebase Distribution;
- To use:
- Remove
if: false
line; - Configure Secrets for Signing Properties;
- Configure Secrets for Firebase distribution;
- Remove
- Will build release on push to the
- Publish Debug to firebase
- Will build debug on PR from the
release/*
branch; - Prepare release notes upon commits starting from the main branch;
- Publish build to the Firebase Distribution;
- To use:
- Remove
if: false
line; - Configure Secrets for Signing Properties;
- Configure Secrets for Firebase distribution;
- Remove
- Will build debug on PR from the
- Publish Debug to App Center
- Will build debug from main branch;
- Prepare release notes upon commits starting from the last tag;
- Publish build to the app center;
- To use:
- Remove
if: false
line; - Create project on the App Center and replace name stubs
- Create group on the App Center and replace group name stub
- Configure Secrets for Signing Properties;
- Configure Secrets for Appcenter distribution;
- Remove
- Publish Release to App Center
- Will build release from created tag;
- Publish build to the google play internal testing channel;
- To use:
- Remove
if: false
line; - Create project on the App Center and replace name stubs
- Configure Secrets for Signing Properties;
- Generate service key on google play (admin role required) Google Play service key;
- Configure Secrets for Google Play Distribution
- Configure Secrets Appcenter publish mapping file;
- Remove
The template is setup to be ready to publish a library/artifact on a Maven Repository. If you're using JitPack, you don't need any further configuration and you can just configure the repo on JitPack. If you're using another repository (MavenCentral/JCenter/etc.), you need to specify the publishing coordinates.
Feel free to open a issue or submit a pull request for any bugs/improvements.
- favor libs with KMP support
- favor language/platform de-facto standard, e.g.:
java.time