-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
78 lines (66 loc) · 1.84 KB
/
build.gradle
File metadata and controls
78 lines (66 loc) · 1.84 KB
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
/*
*
*/
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java'
id 'com.google.protobuf' version '0.8.13'
id 'com.google.cloud.tools.jib' version '2.5.0'
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
def artifactTag = '0.1.2'
def grpcVersion = '1.31.1'
def protobufVersion = '3.13.0'
def protocVersion = protobufVersion
dependencies {
// grpc dependencies
compile "io.grpc:grpc-protobuf:${grpcVersion}"
compile "io.grpc:grpc-stub:${grpcVersion}"
compile "io.grpc:grpc-services:${grpcVersion}"
compile "com.google.protobuf:protobuf-java-util:${protobufVersion}"
compile "io.grpc:grpc-netty-shaded:${grpcVersion}"
compileOnly "javax.annotation:javax.annotation-api:1.2"
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
}
jib {
from {
image = 'gcr.io/distroless/java:11'
}
to {
image = "gcr.io/cloud-native-madison/chat-svc"
tags = [artifactTag, 'latest']
}
// using docker-credential-gcr for auth @see https://cloud.google.com/container-registry/docs/advanced-authentication#standalone-helper
container {
mainClass = 'com.kurtspace.cncf.app.ChatAppServer'
ports = ['9000']
jvmFlags = [
'-XX:+UseContainerSupport',
'-XX:MinRAMPercentage=50',
'-XX:MaxRAMPercentage=85',
]
}
}
protobuf {
protoc { artifact = "com.google.protobuf:protoc:${protocVersion}" }
plugins {
grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" }
}
generateProtoTasks {
all().each { it.group = 'grpc' };
all()*.plugins { grpc {} };
}
generatedFilesBaseDir = "$projectDir/src/generated"
}
sourceSets {
main {
java {
srcDirs += ['src/generated/main/java', 'src/generated/main/grpc']
}
}
}