-
Notifications
You must be signed in to change notification settings - Fork 93
/
build.gradle
57 lines (52 loc) · 1.45 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath libs.kotlin.gradlePlugin
classpath libs.gradleMavenPublishPlugin
}
}
plugins {
alias(libs.plugins.spotless)
}
allprojects {
repositories {
google()
mavenCentral()
}
}
subprojects {
apply plugin: "com.diffplug.spotless"
spotless {
kotlin {
target "**/*.kt"
ktlint(libs.versions.ktlint.get())
licenseHeaderFile rootProject.file('spotless/copyright.txt')
}
groovyGradle {
target "**/*.gradle"
greclipse().configFile(rootProject.file("spotless/greclipse.properties"))
licenseHeaderFile rootProject.file('spotless/copyright.txt'), '(buildscript|apply|import|plugins)'
}
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { compile ->
kotlinOptions {
// Treat all Kotlin warnings as errors
allWarningsAsErrors = true
// Set JVM target to 11
jvmTarget = JavaVersion.VERSION_11
// Allow use of @OptIn
freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
// Enable default methods in interfaces
freeCompilerArgs += "-Xjvm-default=all"
}
}
version = VERSION_NAME
}
tasks.register("printVersion") {
doLast {
println(project.property("VERSION_NAME"))
}
}