blob: b18907560eb919af0eccda5b775f36e4f2cfa8ac [file] [log] [blame]
James Kuszmaul8e62b022022-03-22 09:33:25 -07001plugins {
Austin Schuh2dd86a92022-09-14 21:19:23 -07002 id("com.diffplug.spotless") version "6.3.0"
James Kuszmaul8e62b022022-03-22 09:33:25 -07003}
4
5group = "com.google.flatbuffers"
6version = "2.0.0-SNAPSHOT"
7
Austin Schuh2dd86a92022-09-14 21:19:23 -07008buildscript {
James Kuszmaul8e62b022022-03-22 09:33:25 -07009 repositories {
Austin Schuh2dd86a92022-09-14 21:19:23 -070010 gradlePluginPortal()
11 google()
James Kuszmaul8e62b022022-03-22 09:33:25 -070012 mavenCentral()
13 }
Austin Schuh2dd86a92022-09-14 21:19:23 -070014 dependencies {
15 classpath(libs.bundles.plugins)
16 }
James Kuszmaul8e62b022022-03-22 09:33:25 -070017}
18
Austin Schuh2dd86a92022-09-14 21:19:23 -070019allprojects {
James Kuszmaul8e62b022022-03-22 09:33:25 -070020 repositories {
Austin Schuh2dd86a92022-09-14 21:19:23 -070021 google()
James Kuszmaul8e62b022022-03-22 09:33:25 -070022 mavenCentral()
23 }
24}
25
26// plugin used to enforce code style
27spotless {
28 val klintConfig = mapOf("indent_size" to "2", "continuation_indent_size" to "2")
29 kotlin {
30 target("**/*.kt")
31 ktlint("0.40.0").userData(klintConfig)
32 trimTrailingWhitespace()
33 indentWithSpaces()
34 endWithNewline()
35 licenseHeaderFile("$rootDir/spotless/spotless.kt").updateYearWithLatest(false)
36 targetExclude("**/spotless.kt", "**/build/**")
37 }
38 kotlinGradle {
39 target("*.gradle.kts")
40 ktlint().userData(klintConfig)
41 }
42}