-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
127 lines (106 loc) · 3.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
116
117
118
119
120
121
122
123
124
125
126
127
apply plugin: 'java'
apply plugin: 'com.google.protobuf'
// Provide convenience executables for trying out the examples.
apply plugin: 'application'
// Inform IntelliJ projects about the generated code.
apply plugin: 'idea'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.8'
}
}
repositories {
mavenCentral()
mavenLocal()
}
// IMPORTANT: You probably want the non-SNAPSHOT version of gRPC. Make sure you
// are looking at a tagged version of the example and not "master"!
// Feel free to delete the comment at the next line. It is just for safely
// updating the version in our release process.
def grpcVersion = '1.16.1' // CURRENT_GRPC_VERSION
dependencies {
compile "io.grpc:grpc-core:${grpcVersion}"
compile "io.grpc:grpc-netty:${grpcVersion}"
compile "io.grpc:grpc-protobuf:${grpcVersion}"
compile "io.grpc:grpc-stub:${grpcVersion}"
compile "io.fabric8:kubernetes-client:2.0.5"
compile 'javax.annotation:javax.annotation-api:1.3.2'
// compile project(':esri-geometry-api')
compile files('/usr/local/lib/proj.jar')
compile files('../geometry-api-java/build/libs/jackson-core-2.6.2.jar')
compile files('../geometry-api-java/build/libs/epl-geometry-api-2.0.0.jar')
compile files('../geometry-api-java/build/libs/json-20170516.jar')
// compile files('/Users/davidraleigh/code/google/grpc-java/grpclb/build/libs/grpc-grpclb-1.2.0.jar')
// compile 'com.esri.geometry:esri-geometry-api:1.2.1'
testCompile "junit:junit:4.11"
testCompile "org.mockito:mockito-core:1.9.5"
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.7.1"
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.20.0'
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
}
}
idea {
module {
// Not using generatedSourceDirs because of
// https://discuss.gradle.org/t/support-for-intellij-2016/15294/8
sourceDirs += file("${projectDir}/build/generated/source/proto/main/java");
sourceDirs += file("${projectDir}/build/generated/source/proto/main/protobuf");
}
}
startScripts.enabled = false
// help with defaultJvmOpts
//https://docs.gradle.org/current/dsl/org.gradle.jvm.application.tasks.CreateStartScripts.html
task geometryOperatorsServer(type: CreateStartScripts) {
mainClassName = 'com.epl.protobuf.GeometryServer'
applicationName = 'geometry-operators-server'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
defaultJvmOpts = ['-Djava.library.path=/usr/local/lib/']
}
task geometryOperatorsClient(type: CreateStartScripts) {
mainClassName = 'com.epl.protobuf.GeometryServiceClient'
applicationName = 'geometry-operators-client'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
applicationDistribution.into('bin') {
from(geometryOperatorsServer)
from(geometryOperatorsClient)
fileMode = 0755
}
tasks.withType(Test) {
systemProperty "java.library.path", "/usr/local/lib/"
}
//task localAPICheck(type:Exec) {
// workingDir './'
//
// //on windows:
// commandLine 'cmd', '/c', 'stop.bat'
//
// //on linux
// commandLine './local_api_check.sh'
//
// //store the output instead of printing to the console:
// standardOutput = new ByteArrayOutputStream()
//
// //extension method stopTomcat.output() can be used to obtain the output:
// ext.output = {
// return standardOutput.toString()
// }
//}
//
//test.finalizedBy(localAPICheck)