• Stars
    star
    1,675
  • Rank 26,832 (Top 0.6 %)
  • Language
    Kotlin
  • License
    MIT License
  • Created about 4 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Android + Kotlin + Github Actions + ktlint + Detekt + Gradle Kotlin DSL + buildSrc = ❤️

kotlin-android-template 🤖

Use this template Pre Merge Checks License Language

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.

How to use 👣

Just click on Use this template button to create a new repo starting from this template.

Once created don't forget to update the:

Features 🎨

  • 100% Kotlin-only template.
  • 4 Sample modules (Android app, Android library, Kotlin library, Jetpack Compose Activity).
  • Jetpack Compose setup ready to use.
  • Sample Espresso, Instrumentation & JUnit tests.
  • 100% Gradle Kotlin DSL setup.
  • CI Setup with GitHub Actions.
  • Publish to Maven Central with Github Actions.
  • Dependency versions managed via buildSrc.
  • Kotlin Static Analysis via detekt and ktlint.
  • Issues Template (bug report + feature request).
  • Pull Request Template.

Gradle Setup 🐘

This template is using Gradle Kotlin DSL as well as the Plugin DSL to setup the build.

Dependencies are centralized inside the Gradle Version Catalog in the libs.versions.toml file in the gradle folder.

Static Analysis 🔍

This template is 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). It also uses the detekt-formatting plugin which includes the ktlint rules (see https://detekt.dev/docs/rules/formatting/).

CI ⚙️

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, just make sure that you turn on the "Read and Write permissions" on the Action Settings of your repository.

There are currently the following workflows available:

Publishing 🚀

The template is setup to be ready to publish a library/artifact on a Maven Repository.

For every module you want to publish you simply have to add the publish plugin:

plugins {
    publish
}

To Maven Central

In order to use this template to publish on Maven Central, you need to configure some secrets on your repository:

Secret name Value
ORG_GRADLE_PROJECT_NEXUS_USERNAME The username you use to access Sonatype's services (such as Nexus and Jira)
ORG_GRADLE_PROJECT_NEXUS_PASSWORD The password you use to access Sonatype's services (such as Nexus and Jira)
ORG_GRADLE_PROJECT_SIGNING_KEY The GPG Private key to sign your artifacts. You can obtain it with gpg --armor --export-secret-keys <[email protected]> or you can create one key online on pgpkeygen.com. The key starts with a -----BEGIN PGP PRIVATE KEY BLOCK-----.
ORG_GRADLE_PROJECT_SIGNING_PWD The passphrase to unlock your private key (you picked it when creating the key).

The template already sets up Dokka for project documentation and attaches -sources.jar to your publications, via the new AGP publishing DSL.

Once set up, the following workflows will take care of publishing:

  • Publish Snapshot - To publish -SNAPSHOT versions to Sonatype. The workflow is setup to run either manually (with workflow_dispatch) or on every merge.
  • Publish Release - Will publish a new release version of the libraries to Maven Central on tag pushes. You can trigger the workflow also manually if needed.

To Jitpack

If you're using JitPack, you don't need any further configuration and you can just configure the repo on JitPack.

You probably want to disable the [Publish Snapshot] and Publish Release workflows (delete the files), as Jitpack will take care of that for you.

Project Structure

The project includes three sub-projects, each in their own subdirectories:

  • app: The source for the final Android application.
  • library-android: The source for an Android library including UI.
  • library-kotlin: The source for a UI-less Kotlin library.
  • library-compose: The source for a UI library with Jetpack Compose library.

The following additional top-level directories configure & support building the app & projects:

Finally, the following hidden top-level directories provide functionality for specific development systems:

Contributing 🤝

Feel free to open a issue or submit a pull request for any bugs/improvements.

More Repositories

1

slidetoact

A simple 'Slide to Unlock' Material widget for Android, written in Kotlin 📱🎨🦄
Kotlin
1,150
star
2

kotlin-gradle-plugin-template

🐘 A template to let you started with custom Gradle Plugins + Kotlin in a few seconds
Kotlin
440
star
3

ktfmt-gradle

A Gradle plugin to apply ktfmt to your builds, and reformat you Kotlin source code like a glimpse 🧹🐘
Kotlin
130
star
4

kscript-template

📜 Get started with kscript in a few seconds... with colored logs, github actions and more!
Kotlin
34
star
5

myonnaise

🍯 A RxJava library to access Raw EMG data from your Myo 📈 (plus an Android companion App 📱)
Kotlin
29
star
6

tech-conferences-italy

A community-curated list of conferences around Italy 🇮🇹
HTML
26
star
7

rules4android

A collection of JUnit 4 Rules for Android Developers 🔬
Kotlin
25
star
8

thebakery

Website for The Developers' Bakery Podcast 👨‍🍳
HTML
22
star
9

alfred-looks

╰(◕ヮ◕)つ¤=[]——— A collection of Alfred 4 snippets from looks.wtf (⌐■_■)
Kotlin
9
star
10

telebot

A Telegram Bot skeleton written in Go (a.k.a. your bot in 20 lines)
Go
7
star
11

cortinico.github.io

Just my personal website ✈️
JavaScript
6
star
12

mno-notes

Public repository of MNO students' notes (University of Pisa)
TeX
5
star
13

space-unlimited-space

📦 Unleash the power of Github Container Registry to store artifacts and consume them auth-free.
5
star
14

docker-redex

Docker file for Facebook ReDex container (zip your apks inside a container)
M4
4
star
15

adventofcode-2020

🎅 Marry XMas 🎄 Kotlin solutions for my Advent of Code 2020 🤶
Kotlin
4
star
16

gulp-letsencrypt

Slides of letsencrypt seminar - 2016 GULP (Pisa Linux User Group)
TeX
4
star
17

adventofcode-2021

🎅 Marry XMas 🎄 Kotlin solutions for my Advent of Code 2021 🤶
Kotlin
4
star
18

docker-java8-32bit

Dockerfile for creating a 32bit containter and Java8 JRE
3
star
19

reproducer-grammarly-textinput

Reproducer for ANR on Samsung devices with Grammarly integration
Kotlin
3
star
20

p2p-gossipico

A simulation of Gossipico with Peersim - Final assignment of P2P course (unipi)
TeX
3
star
21

p2p-pingpong

A simulation of Gnutella Ping Pong protocol - 1st assignment of P2P course (unipi)
Java
2
star
22

cortinico

2
star
23

sol-cars

A simple system for car sharing - Final project of operting system course SOL (unipi)
C
2
star
24

android-beginners-material

A list of material for wannabe Android developers
2
star
25

telebotgae

A Telegram Bot skeleton written in Go with App Engine super powers (deploy in several seconds!)
Go
2
star
26

repro-36296

Reproducer for https://github.com/facebook/react-native/issues/36296
Java
2
star
27

RnReproducer32595

Java
1
star
28

reproducer-rnscreens-bridgeless

Kotlin
1
star
29

gulp-raspi

Slides del seminario del Linux Day 2014 Pisa su Raspberry Pi
TeX
1
star
30

reproducer-strictmodeviolation

Reproducer for https://issuetracker.google.com/issues/270704908
Kotlin
1
star
31

adventofcode-2022

🎅 Marry XMas 🎄 Kotlin solutions for my Advent of Code 2022 🤶
Kotlin
1
star
32

ae-drisc

A DRISC intrepreter written in OCaml - Course of System Architecture AE (unipi)
OCaml
1
star
33

adventofcode-2023

🎅 Marry XMas 🎄 Kotlin solutions for my Advent of Code 2023 🤶
Kotlin
1
star