Android Gradle Kotlin DSL Starter
provides a simple template for those who want to start a project with the Kotlin DSL.
Android Gradle Kotlin DSL Starter is a template that you can use when setting up your first android project. Also, this template is focused on delivering a project with static analysis and continuous integration already in place.
- 100% Kotlin-only template.
- 100% Gradle Kotlin DSL setup.
- Dependency versions managed via
buildSrc
. - Kotlin Static Analysis via
ktlint
anddetekt
. - Git Setup with Git-Hooks.
- Create a new repo starting from this template using button.
- Update APPLICATION_ID and BUILD_FILE_PREFIX according to your project.
- Update the package name and label of AndroidManifest to suit your project.
- Update package of the all source files
Some default settings are required to use the project.
- Create keystore folder in project root.
- Create keystore.properties and key files for debug and release in the created keystore folder.
# Signing Config
# release
release.signing.key.alias=<insert>
release.signing.key.password=<insert>
release.signing.store.file=<insert> (../keystore/xxxxxxx.jks or .keystore)
release.signing.store.password=<insert>
# debug
debug.signing.key.alias=<insert>
debug.signing.key.password=<insert>
debug.signing.store.file=<insert> (../keystore/xxxxxxx.jks or .keystore)
debug.signing.store.password=<insert>
To maintain the style and quality of the code, are used the bellow static analysis tools. All of them use properly configuration and you find them in the project root directory .{toolName}
.
Tools | Config file | Check command | Fix command |
---|---|---|---|
detekt | /.detekt | ./gradlew detekt |
- |
ktlint | - | ./gradlew ktlintCheck |
./gradlew ktlintFormat |
lint | /.lint | ./gradlew lint |
- |
All of the above tests can be run with ./gradlew check
, which is used through Git-Hooks below. If you need to modify your coding standards, please refer to .editorconfig
When the project build is complete, git hooks related copyGitHooks, deleteGitHooks, and installGitHooks tasks will be created. When you run the installGitHooks
task, pre-push hooks are installed, and from then on, push is performed only if there is no problem by performing ./gradlew check
before being pushed to git.
Android Gradle Kotlin DSL Starter is under MIT license. See the LICENSE for more info.