forked from square/wire
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
68 lines (60 loc) · 1.61 KB
/
build.gradle.kts
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
58
59
60
61
62
63
64
65
66
67
68
import com.diffplug.gradle.spotless.SpotlessExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
dependencies {
classpath(libs.pluginz.kotlin)
classpath(libs.pluginz.shadow)
classpath(libs.wire.gradlePlugin)
classpath(libs.pluginz.japicmp)
classpath(libs.animalSniffer.gradle)
classpath(libs.pluginz.android)
classpath(libs.protobuf.gradlePlugin)
classpath(libs.pluginz.spotless)
}
repositories {
mavenCentral()
gradlePluginPortal()
google()
}
}
allprojects {
repositories {
mavenCentral()
google()
}
// Prefer to get dependency versions from BOMs.
configurations.all {
val configuration = this
configuration.dependencies.all {
val bom = when (group) {
"com.squareup.okio" -> libs.okio.bom.get()
"com.squareup.okhttp3" -> libs.okhttp.bom.get()
else -> return@all
}
configuration.dependencies.add(project.dependencies.platform(bom))
}
}
}
subprojects {
apply(plugin = "com.diffplug.spotless")
configure<SpotlessExtension> {
setEnforceCheck(false)
kotlin {
target("**/*.kt")
ktlint(libs.versions.ktlint.get()).userData(kotlin.collections.mapOf("indent_size" to "2"))
trimTrailingWhitespace()
endWithNewline()
}
}
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
}
}
tasks.withType<JavaCompile> {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
options.encoding = Charsets.UTF_8.toString()
}
}
apply(from = "gen-tests.gradle.kts")