-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
106 lines (95 loc) · 3.28 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.3.71'
id 'com.google.protobuf' version '0.8.8'
id 'application'
id 'com.github.johnrengelman.shadow' version '5.2.0'
}
group 'com.nedellis'
version '1.0-SNAPSHOT'
repositories {
google()
jcenter()
mavenCentral()
mavenLocal()
}
def grpcVersion = '1.29.0' // CURRENT_GRPC_VERSION
def grpc_kotlin_version = '0.1.1' // CURRENT_GRPC_KOTLIN_VERSION
def kotest_version = '4.0.5'
def mockk_version = '1.10.0'
configurations {
ktlint
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.5'
implementation "io.grpc:grpc-kotlin-stub:${grpc_kotlin_version}"
implementation "io.grpc:grpc-netty-shaded:${grpcVersion}"
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
implementation 'com.google.protobuf:protobuf-gradle-plugin:0.8.11'
implementation "com.github.ajalt:clikt:2.6.0"
implementation 'org.slf4j:slf4j-simple:1.7.29'
implementation 'com.tinder.statemachine:statemachine:0.2.0'
testImplementation "io.kotest:kotest-runner-junit5-jvm:${kotest_version}" // for kotest framework
testImplementation "io.kotest:kotest-assertions-core-jvm:${kotest_version}" // for kotest core jvm assertions
testImplementation "io.kotest:kotest-property-jvm:${kotest_version}" // for kotest property test
testImplementation "io.mockk:mockk:${mockk_version}"
testCompile group: 'junit', name: 'junit', version: '4.12'
compileOnly "javax.annotation:javax.annotation-api:1.2"
ktlint "com.pinterest:ktlint:0.35.0"
}
task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
main = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "src/**/*.kt"
// to generate report in checkstyle format prepend following args:
// "--reporter=plain", "--reporter=checkstyle,output=${buildDir}/ktlint.xml"
// see https://github.com/pinterest/ktlint#usage for more
}
check.dependsOn ktlint
task ktlintFormat(type: JavaExec, group: "formatting") {
description = "Fix Kotlin code style deviations."
main = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "-F", "src/**/*.kt"
}
protobuf {
protoc { artifact = 'com.google.protobuf:protoc:3.11.0' }
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
// Specify protoc to generate using our grpc kotlin plugin
grpckt {
artifact = "io.grpc:protoc-gen-grpc-kotlin:${grpc_kotlin_version}"
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
grpckt {}
}
}
}
// Inform IDEs like IntelliJ IDEA, Eclipse or NetBeans about the generated code.
sourceSets {
main {
java {
srcDirs 'build/generated/source/proto/main'
}
}
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.freeCompilerArgs = ["-Xallow-result-return-type"]
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.freeCompilerArgs = ["-Xallow-result-return-type"]
}
test {
useJUnitPlatform()
}
mainClassName = 'com.nedellis.kotlinraft.MainKt'