-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
124 lines (108 loc) · 3.5 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
120
121
122
123
124
import org.gradle.plugins.ide.eclipse.model.SourceFolder
buildscript {
ext {
protobufVersion = '3.23.4'
protobufPluginVersion = '0.8.18'
grpcVersion = '1.63.0'
springBootVersion = '3.3.1'
springBootGrpcVersion = '3.1.0.RELEASE'
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
}
}
plugins {
id 'idea'
id 'eclipse'
id 'java-library'
id 'org.springframework.boot' version "${springBootVersion}"
id 'com.google.protobuf' version "${protobufPluginVersion}"
id 'io.spring.dependency-management' version '1.1.5'
id 'org.jetbrains.kotlin.jvm' version '1.9.24'
id 'org.jetbrains.kotlin.plugin.spring' version '1.9.24'
}
group = 'com.store'
version = '0.0.1-SNAPSHOT'
repositories {
mavenCentral()
maven {
url uri('lib')
}
}
dependencies {
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-aop'
implementation "net.devh:grpc-server-spring-boot-starter:${springBootGrpcVersion}"
implementation "build.buf:protovalidate:0.2.1"
compileOnly 'jakarta.annotation:jakarta.annotation-api:1.3.5' // Java 9+ compatibility - Do NOT update to 2.0.0
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.specmatic:specmatic-grpc:0.0.12-TRIAL'
}
sourceSets {
main {
proto {
srcDir 'specmatic-order-contracts/io/specmatic/examples/store/grpc/order_api'
}
}
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:${protobufVersion}"
}
generatedFilesBaseDir = "$projectDir/src/generated"
clean {
delete generatedFilesBaseDir
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
}
}
kotlin {
compilerOptions {
freeCompilerArgs.addAll '-Xjsr305=strict'
}
}
eclipse {
classpath {
file.beforeMerged { cp ->
def generatedGrpcFolder = new SourceFolder('src/generated/main/grpc', null)
generatedGrpcFolder.entryAttributes['ignore_optional_problems'] = 'true'
cp.entries.add(generatedGrpcFolder)
def generatedJavaFolder = new SourceFolder('src/generated/main/java', null)
generatedJavaFolder.entryAttributes['ignore_optional_problems'] = 'true'
cp.entries.add(generatedJavaFolder)
}
}
}
idea {
module {
sourceDirs += file("src/generated/main/java")
sourceDirs += file("src/generated/main/grpc")
generatedSourceDirs += file("src/generated/main/java")
generatedSourceDirs += file("src/generated/main/grpc")
}
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
showStandardStreams = true
exceptionFormat = 'full'
}
afterSuite { desc, result ->
if (!desc.parent) {
println "-----------------------------------------------------"
println "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
println "-----------------------------------------------------"
}
}
}