forked from GoogleCloudPlatform/grpc-gcp-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
165 lines (147 loc) · 5.25 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
plugins {
id 'java'
id 'maven'
id 'maven-publish'
id 'signing'
id 'com.google.protobuf' version '0.8.10'
id 'com.github.sherter.google-java-format' version '0.8'
id 'io.codearte.nexus-staging' version '0.8.0'
}
repositories {
maven { // The google mirror is less flaky than mavenCentral()
url "https://maven-central.storage-download.googleapis.com/maven2/" }
mavenCentral()
mavenLocal()
}
version = '1.4.0'
group = 'com.google.cloud'
description = 'GRPC-GCP-Extension Java'
sourceCompatibility = '1.8'
def title = 'gRPC extension library for Google Cloud Platform'
def grpcVersion = '1.36.3'
def protobufVersion = '3.20.3'
def protocVersion = '3.20.3'
def spannerVersion = '6.1.0'
def opencensusVersion = '0.28.3'
dependencies {
implementation "com.google.protobuf:protobuf-java:${protobufVersion}"
implementation "com.google.protobuf:protobuf-java-util:${protobufVersion}"
implementation "io.grpc:grpc-netty-shaded:${grpcVersion}"
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
implementation "io.opencensus:opencensus-api:${opencensusVersion}"
implementation "com.google.api:api-common:2.1.5"
compileOnly "org.apache.tomcat:annotations-api:6.0.53" // necessary for Java 9+
testImplementation "com.google.auth:google-auth-library-credentials:0.13.0"
testImplementation "com.google.cloud:google-cloud-spanner:${spannerVersion}"
testImplementation "com.google.cloud:google-cloud-bigtable:0.107.0"
testImplementation "com.google.api.grpc:proto-google-cloud-bigtable-v2:0.39.0"
testImplementation "com.google.api.grpc:grpc-google-cloud-bigtable-v2:0.39.0"
testImplementation "com.google.auth:google-auth-library-oauth2-http:0.9.0"
testImplementation "io.grpc:grpc-auth:${grpcVersion}"
testImplementation "io.grpc:grpc-stub:${grpcVersion}"
testImplementation "com.google.truth:truth:0.42"
testImplementation 'junit:junit:4.13.2'
}
protobuf {
protoc { artifact = "com.google.protobuf:protoc:${protocVersion}" }
plugins {
grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" }
}
generateProtoTasks {
all()*.plugins { grpc {} }
}
}
test {
testLogging {
outputs.upToDateWhen {false}
showStandardStreams = true
}
exclude 'com/google/cloud/grpc/SpannerIntegrationTest.class'
exclude 'com/google/cloud/grpc/BigtableIntegrationTest.class'
}
task allTests( type: Test ) {
// Execute all the tests, including integration tests.
}
sourceSets {
main {
java {
srcDirs 'build/generated/source/proto/main/grpc'
srcDirs 'build/generated/source/proto/main/java'
}
}
}
task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allJava
}
if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) {
// Nexus staging plugin only works at root project level
// See https://github.com/Codearte/gradle-nexus-staging-plugin/issues/47
nexusStaging {
username = ossrhUsername
password = ossrhPassword
packageGroup = group
}
}
publishing {
publications {
maven(MavenPublication) {
from components.java
artifact javadocJar
artifact sourcesJar
groupId = group
artifactId = 'grpc-gcp'
version = version
pom {
name = title
url = 'https://github.com/GoogleCloudPlatform/grpc-gcp-java/tree/master/grpc-gcp'
afterEvaluate {
// description is not available until evaluated.
description = project.description
}
scm {
connection = 'scm:git:https://github.com/GoogleCloudPlatform/grpc-gcp-java.git'
url = 'https://github.com/GoogleCloudPlatform/grpc-gcp-java'
}
licenses {
license {
name = 'Apache 2.0'
url = 'https://opensource.org/licenses/Apache-2.0'
}
}
developers {
developer {
id = "grpc.io"
name = "gRPC Contributors"
email = "[email protected]"
url = "https://grpc.io/"
organization = "gRPC Authors"
organizationUrl = "https://www.google.com"
}
}
}
}
}
repositories {
maven {
url 'https://google.oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials {
username = project.hasProperty('ossrhUsername') ? project.getProperty('ossrhUsername') : null
password = project.hasProperty('ossrhPassword') ? project.getProperty('ossrhPassword') : null
}
}
}
}
signing {
if (!project.hasProperty('skip.signing')) {
if (project.hasProperty('signing.gnupg.executable')) {
useGpgCmd()
}
sign publishing.publications.maven
}
}