-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
71 lines (60 loc) · 1.39 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
69
70
71
import com.google.protobuf.gradle.generateProtoTasks
import com.google.protobuf.gradle.id
import com.google.protobuf.gradle.protobuf
import com.google.protobuf.gradle.protoc
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("com.google.protobuf") version "0.8.18"
kotlin("jvm") version "1.6.10"
application
idea
id("com.diffplug.spotless") version "6.3.0"
}
group = "com.stackhawk"
version = "1.0-SNAPSHOT"
dependencies {
implementation("com.google.protobuf:protobuf-kotlin:3.19.4")
implementation("com.google.protobuf:protobuf-java-util:3.19.4")
testImplementation(kotlin("test"))
}
tasks.test {
useJUnitPlatform()
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
}
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "11"
}
application {
mainClass.set("MainKt")
}
repositories {
mavenCentral()
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.19.4"
}
generateProtoTasks {
all().forEach {
it.builtins {
id("kotlin")
}
}
}
}
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
kotlin {
ktlint()
}
kotlinGradle {
ktlint()
}
}