-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
119 lines (106 loc) · 3.24 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
107
108
109
110
111
112
113
114
115
116
117
118
119
plugins {
id "org.jetbrains.kotlin.jvm" version "$kotlinVersion" apply false
id "com.google.protobuf" version "0.8.15" apply false
id "com.diffplug.spotless" version "5.12.4" apply false
id "org.jetbrains.dokka" version "1.4.32" apply false
id "nebula.maven-publish" version "17.3.2" apply false
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}
allprojects {
group = "io.github.danielpeach.java-plugin"
}
subprojects {
apply plugin: "java"
apply plugin: "kotlin"
apply plugin: "com.google.protobuf"
apply plugin: "com.diffplug.spotless"
repositories {
mavenCentral()
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == "io.netty") {
details.useVersion "4.1.59.Final"
}
}
}
dependencies {
implementation 'javax.annotation:javax.annotation-api:1.3.2'
implementation "io.grpc:grpc-kotlin-stub:$grpcKotlinVersion"
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
implementation "io.grpc:grpc-netty:${grpcVersion}"
implementation "com.google.protobuf:protobuf-java-util:${protobufVersion}"
implementation "org.jetbrains.kotlin:kotlin-reflect"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.4.3"
}
protobuf {
protoc { artifact = "com.google.protobuf:protoc:${protocVersion}" }
plugins {
grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" }
grpckt { artifact = "io.grpc:protoc-gen-grpc-kotlin:${grpcKotlinVersion}:jdk7@jar" }
}
generateProtoTasks {
all()*.plugins {
grpc {}
grpckt {}
}
}
}
sourceSets {
main {
java {
srcDirs 'build/generated/source/proto/main/grpc'
srcDirs 'build/generated/source/proto/main/java'
}
kotlin {
srcDirs 'build/generated/source/proto/main/grpckt'
}
}
test {
java {
srcDirs 'build/generated/source/proto/test/grpc'
srcDirs 'build/generated/source/proto/test/java'
}
kotlin {
srcDirs 'build/generated/source/proto/test/grpckt'
}
}
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
freeCompilerArgs += [
"-Xjsr305=strict",
"-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlin.time.ExperimentalTime"
]
languageVersion = "1.4"
jvmTarget = JavaVersion.VERSION_1_8
}
}
tasks.withType(Test) {
useJUnitPlatform()
}
spotless {
kotlin {
ktlint("0.40.0").userData([
disabled_rules : "no-wildcard-imports",
indent_size : "2",
continuation_indent_size: "2",
])
}
}
}
nexusPublishing {
repositories {
nexus {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
stagingProfileId = "2123ebfbc7818b"
}
}
}