rspec/rules/S6631/kotlin/rule.adoc

37 lines
1.0 KiB
Plaintext

== Why is this an issue?
`settings.gradle.kts` or `settings.gradle` are used to define general project properties; see the following sample file:
[source,kotlin]
----
rootProject.name = "myProject"
include("foo", "bar")
----
In general it is not mandatory to define the `settings.gradle.kts` or `settings.gradle`, however it is hingly recommended because:
* it improves performance, since Gradle won't navigate up the filesystem directory tree looking for the settings file
* it is a good practice to define project properties, like the `rootProject.name`
== How to fix it
Simply add a `settings.gradle.kts` or `settings.gradle` file. For example with such content:
[source,kotlin]
----
rootProject.name = "myProject"
include("module1", "module2")
----
== Resources
=== Documentation
* https://docs.gradle.org/current/dsl/org.gradle.api.initialization.Settings.html[Settings - Gradle DSL]
=== Standards
* https://youtu.be/hKtO1yGEWvY?list=PL0UJI1nZ56yAHv9H9kZA6vat4N1kSRGis&t=154[Always specify Gradle settings]