-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
76 lines (63 loc) · 2.11 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
apply plugin: 'java-library'
apply plugin: 'com.google.protobuf'
apply plugin: 'idea'
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.8'
}
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
jcenter()
}
dependencies {
implementation 'org.mongodb:mongo-java-driver:3.12.6'
// Mock MongoDB instance for tests
testImplementation 'de.bwaldvogel:mongo-java-server:1.34.0'
// Utilities for interacting with google common protos. TODO(josh): Remove this dep
implementation 'com.google.api:gax:1.44.0', 'com.google.api:gax-grpc:1.44.0'
testImplementation 'junit:junit:4.12'
testImplementation 'com.google.guava:guava:28.0-jre'
// Protobuf libraries
api 'com.google.api.grpc:proto-google-common-protos:1.18.0'
api 'com.google.protobuf:protobuf-java:3.0.0'
if (JavaVersion.current().isJava9Compatible()) {
// Workaround for @javax.annotation.Generated
// see: https://github.com/grpc/grpc-java/issues/3633
implementation 'javax.annotation:javax.annotation-api:1.3.1'
}
}
protobuf {
protoc {
// The artifact spec for the Protobuf Compiler
artifact = 'com.google.protobuf:protoc:3.0.0'
}
plugins {
// Optional: an artifact spec for a protoc plugin, with "grpc" as
// the identifier, which can be referred to in the "plugins"
// container of the "generateProtoTasks" closure.
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.0.0-pre2'
}
}
generateProtoTasks {
ofSourceSet('main')*.plugins {
// Apply the "grpc" plugin whose spec is defined above, without
// options. Note the braces cannot be omitted, otherwise the
// plugin will not be added. This is because of the implicit way
// NamedDomainObjectContainer binds the methods.
grpc {}
}
}
}
test {
useJUnit()
maxHeapSize = '1G'
}