This repository serves as template for kotlin projects which use gradle as build tool.
Features are:
- Sample kotlin class file with simple output.
- Single module gradle project
- Static code analysis with Sonar -> Project Page
- Self-contained jar file creation
- Unit tests. Results, created by JaCoCo, are found on sonar project page.
- Sample license and readme file
- Git as version control system with .gitignore file to exclude automatically created files from repository.
Just run the following gradle task
build
The output can be found inside the build folder.
To generate a sonar report, the following gradle task has to be run
sonarqube
You need to set systemProp.sonar.login
inside your local gradle.properties file.
The sonar login token can be generated on the sonar account page (needs admin rights).
To run the self-contained jar file
java -jar build/libs/kotlin-gradle-single-module-1.0-SNAPSHOT.jar
Output should be:
Hello Jack. You're 22 years old, and your gender is male.