blob: 455ee0d70670b90bd3e62df1e5ede434cda61415 [file] [log] [blame]
James Kuszmaul8e62b022022-03-22 09:33:25 -07001plugins {
2 id("com.diffplug.spotless") version "5.8.2"
3}
4
5group = "com.google.flatbuffers"
6version = "2.0.0-SNAPSHOT"
7
8subprojects {
9
10 repositories {
11 maven { setUrl("https://plugins.gradle.org/m2/") }
12 mavenCentral()
13 }
14}
15
16buildscript {
17 repositories {
18 maven { setUrl("https://plugins.gradle.org/m2/") }
19 gradlePluginPortal()
20 mavenCentral()
21 }
22}
23
24// plugin used to enforce code style
25spotless {
26 val klintConfig = mapOf("indent_size" to "2", "continuation_indent_size" to "2")
27 kotlin {
28 target("**/*.kt")
29 ktlint("0.40.0").userData(klintConfig)
30 trimTrailingWhitespace()
31 indentWithSpaces()
32 endWithNewline()
33 licenseHeaderFile("$rootDir/spotless/spotless.kt").updateYearWithLatest(false)
34 targetExclude("**/spotless.kt", "**/build/**")
35 }
36 kotlinGradle {
37 target("*.gradle.kts")
38 ktlint().userData(klintConfig)
39 }
40}