-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.gradle
115 lines (95 loc) · 2.63 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
buildscript {
ext {
springBootVersion = '1.5.6.RELEASE'
protobufGradlePluginVersion = '0.8.3'
}
repositories {
jcenter()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("com.google.protobuf:protobuf-gradle-plugin:${protobufGradlePluginVersion}")
}
}
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'com.google.protobuf'
sourceCompatibility = 1.8
targetCompatibility = 1.8
version = '0.0.1-SNAPSHOT'
repositories {
jcenter()
}
ext {
protocVersion = '3.3.0'
grpcVersion = '1.6.1'
grpcSpringBootVersion = '2.1.0'
assertjVersion = '3.8.0'
applicationName = 'grpc-spring-security-demo'
applicationDefaultJvmArgs = [
'-Xmx2g',
'-Xms1g',
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9080"
]
}
jar {
baseName = applicationName
}
sourceSets {
main {
java {
srcDir 'src/main/protoGen'
}
}
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-actuator')
compile('org.springframework.boot:spring-boot-starter-security')
compile('org.springframework.security.oauth:spring-security-oauth2')
compile('org.springframework.security:spring-security-jwt')
compile("io.grpc:grpc-protobuf:${grpcVersion}")
compile("io.grpc:grpc-stub:${grpcVersion}")
compile("io.grpc:grpc-netty:${grpcVersion}")
compile("org.lognet:grpc-spring-boot-starter:${grpcSpringBootVersion}")
compileOnly('org.projectlombok:lombok')
testCompile('org.springframework.boot:spring-boot-starter-test')
testCompile("org.assertj:assertj-core:${assertjVersion}")
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:${protocVersion}"
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
ofSourceSet('main').each { task ->
task.builtins {
java{
outputSubDir = 'protoGen'
}
}
task.plugins {
grpc {
outputSubDir = 'protoGen'
}
}
}
}
generatedFilesBaseDir = "${projectDir}/src/"
}
bootRun { task ->
systemProperty 'debug', true
if (project.hasProperty('args')) {
args project.args.split('\\s+')
}
}
task cleanProtoGen{
doFirst{
delete("${projectDir}/src/main/protoGen")
}
}
clean.dependsOn cleanProtoGen