-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
131 lines (111 loc) · 3.96 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
125
126
127
128
129
130
131
plugins {
// id 'java'
id 'application'
// For protobuf-based codegen integrated with the Gradle build
// system, you can use protobuf-gradle-plugin
id 'com.google.protobuf' version '0.8.8'
}
repositories {
maven { // The google mirror is less flaky than mavenCentral()
url "https://maven-central.storage-download.googleapis.com/repos/central/data/" }
mavenCentral()
mavenLocal()
jcenter() // mockito
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
// safely updating the version
def grpcVersion = '1.28.0' // CURRENT_GRPC_VERSION
def protobufVersion = '3.11.0'
def protocVersion = protobufVersion
dependencies {
// JARS for Gradle with non-Android
// gRPC-Java - An RPC library and framework
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
compileOnly "javax.annotation:javax.annotation-api:1.2"
// examples/advanced need this for JsonFormat; yo no lo necesito ¿?
implementation "com.google.protobuf:protobuf-java-util:${protobufVersion}"
runtimeOnly "io.grpc:grpc-netty-shaded:${grpcVersion}"
testImplementation "io.grpc:grpc-testing:${grpcVersion}"
testImplementation "junit:junit:4.12"
//compile 'com.google.protobuf:protobuf-java:3.10.0'
testCompile "org.mockito:mockito-core:2.+"
}
protobuf {
protoc { artifact = "com.google.protobuf:protoc:${protocVersion}" }
plugins {
grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" }
}
generateProtoTasks {
all()*.plugins { grpc {} }
}
}
// Inform IDEs like IntelliJ IDEA, Eclipse or NetBeans about the generated code.
sourceSets {
main {
java {
srcDirs 'build/generated/source/proto/main/grpc'
srcDirs 'build/generated/source/proto/main/java'
}
}
}
// application {
// mainClassName = 'ricksy.business.RicksyBusiness'
//}
// Si comento applicarion mainClassName:
// A problem was found with the configuration of task ':startScripts' (type 'CreateStartScripts').
// No value has been specified for property 'mainClassName'.
startScripts.enabled = false
task UfosParkServer(type: CreateStartScripts) {
mainClassName = 'org.elsmancs.grpc.ufos.UfosParkServer'
applicationName = 'ufos-park-server'
outputDir = new File(project.buildDir, 'tmp')
classpath = startScripts.classpath
}
task UfosParkClient(type: CreateStartScripts) {
mainClassName = 'org.elsmancs.grpc.ufos.UfosParkClient'
applicationName = 'ufos-park-client'
outputDir = new File(project.buildDir, 'tmp')
classpath = startScripts.classpath
}
task PaymentServer(type: CreateStartScripts) {
mainClassName = 'org.elsmancs.grpc.payment.PaymentServer'
applicationName = 'payment-server'
outputDir = new File(project.buildDir, 'tmp')
classpath = startScripts.classpath
}
task PaymentClient(type: CreateStartScripts) {
mainClassName = 'org.elsmancs.grpc.payment.PaymentClient'
applicationName = 'payment-client'
outputDir = new File(project.buildDir, 'tmp')
classpath = startScripts.classpath
}
task CrystalServer(type: CreateStartScripts) {
mainClassName = 'org.elsmancs.grpc.crystal.CrystalServer'
applicationName = 'crystal-dispenser-server'
outputDir = new File(project.buildDir, 'tmp')
classpath = startScripts.classpath
}
task CrystalClient(type: CreateStartScripts) {
mainClassName = 'org.elsmancs.grpc.crystal.CrystalClient'
applicationName = 'crystal-dispenser-client'
outputDir = new File(project.buildDir, 'tmp')
classpath = startScripts.classpath
}
task App(type: CreateStartScripts) {
mainClassName = 'org.elsmancs.grpc.App'
applicationName = 'app'
outputDir = new File(project.buildDir, 'tmp')
classpath = startScripts.classpath
}
applicationDistribution.into('bin') {
from(UfosParkServer)
from(UfosParkClient)
from(PaymentServer)
from(PaymentClient)
from(CrystalServer)
from(CrystalClient)
from(App)
fileMode = 0755
}