blob: ddf0e9eae5dd122753c1726ca8fe64a15552237f (
plain)
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
|
plugins {
id "com.google.protobuf" version "0.9.2"
id "java"
//id "net.idlestate.gradle-duplicate-classes-check" version "1.2.0"
}
group 'com.gitlab.techschool'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
// https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java
implementation group: 'com.google.protobuf', name: 'protobuf-java', version: '3.22.0'
//implementation group: 'io.grpc', name: 'grpc-all', version: '1.53.0'
tasks.named("processResources").configure { dependsOn("generateProto") }
}
sourceSets {
main {
proto {
srcDir 'src/main/proto/messages'
include '**/*.proto'
}
java {
srcDirs 'src/main/java'
}
}
}
protobuf {
generatedFilesBaseDir = "src/main"
// deleteGeneratedFilesBeforeCompile = true
protoc {
artifact = 'com.google.protobuf:protoc:3.22.0'
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.53.0'
}
doc {
artifact = "io.github.pseudomuto:protoc-gen-doc:1.5.1"
}
}
generateProtoTasks {
processResources() {
duplicatesStrategy = 'EXCLUDE'
}
all().each { task ->
task.builtins {
java {}
cpp {}
}
task.plugins{
// grpc {}
doc {
//option 'html, index.html'
option 'markdown, v2c.md'
}
}
}
}
}
|