KotlinLearn
This is a gradle project for the sole basis of exploring and learning Kotlin language, tools and frameworks. The root project wil encapsulate various modules which will be covering different topics.
Prerequisites
Code Analysis
The root project contains the codeAnalysis script which when ran, will run linting and formatting tasks using KtLint, Detekt and Spotless.
For the first time, you must guarantee some running permissions:
chmod +x codeAnalysis.sh
After that, you just need to run:
./codeAnalysis
Dependency Management
All dependencies need to be defined in the buildSrc
module inside the Dependencies.kt
file. From there, each project can implement their required dependencies that have been defined in the buildSrc
.
Adding modules
To add a module to the project do the following:
- Add the module folder in the root of the project.
- Add the module gradle file inside module folder.
- Open the
settings.gradle.kts
file in the project root. - Add an include function call with the module folder name as its parameter at EOF i.e
include("module-folder")
- Sync the project, and you are good to go
🚀
Gradle
Gradle is used for build automation and dependency management in this multi-modular project.
- Gradle Kotlin DSL - Kotlin DSl is used for Kotlin syntax and better IDE support. Trying to expand kotlin knowledge here
😃 - Plugins
- Ktlint - Creates convenient tasks in a Gradle project that run linting and auto-formatting.
- Detekt - A static code analysis tool for the Kotlin programming language.
- Spotless - Versatile code formatter and adds license headers.
- Dokka - A documentation engine for Kotlin, performing the same function as javadoc for Java.
- jacoco - A Code Coverage Library
- Kotlin - A modern programming language that makes developers happier.
Modules
-
Ktor App
This module explores Ktor which is a framework for building asynchronous servers and clients in connected systems using the powerful Kotlin programming language.
Tech stack
- Ktor - Asynchronous server framework.
- Netty - An asynchronous event-driven network application framework used as the engine for ktor.
- Logback Classic - A reliable, generic, fast and flexible logging framework.
- Ktor Serialization - Allows you to use content converters provided by the kotlinx.serialization
- Ktor Gson - A built-in Gson converter for handing JSON data in your application.
- Ktor Auth - Used to provide authentication for the server.
- Kotlinx DateTime - A multiplatform Kotlin library for working with date and time.