Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
140 lines (122 loc) · 3.95 KB
/
Copy pathbuild.gradle
File metadata and controls
140 lines (122 loc) · 3.95 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
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
plugins {
id 'com.github.johnrengelman.shadow' version '6.1.0'
id 'java-library'
id 'com.google.protobuf' version '0.8.18'
id 'maven-publish'
id 'signing'
id 'idea'
id "io.github.gradle-nexus.publish-plugin" version '1.1.0'
}
group = 'io.pinecone'
version = '0.2.3' // [pc:VERSION_NEXT]
description = 'The Pinecone.io Java Client'
sourceCompatibility = JavaVersion.VERSION_1_8
repositories {
mavenCentral()
jcenter()
}
def grpcVersion = '1.53.0'
dependencies {
api "io.grpc:grpc-protobuf:${grpcVersion}"
api "io.grpc:grpc-stub:${grpcVersion}"
api "io.grpc:grpc-netty:${grpcVersion}"
runtime 'io.netty:netty-tcnative-boringssl-static:2.0.59.Final'
implementation 'org.slf4j:slf4j-api:2.0.5'
implementation 'com.google.api.grpc:proto-google-common-protos:2.14.3'
compileOnly "org.apache.tomcat:annotations-api:6.0.53" // necessary for Java 9+
testImplementation "io.grpc:grpc-testing:${grpcVersion}"
testImplementation 'junit:junit:4.13.2'
testImplementation "org.hamcrest:hamcrest:2.2"
testImplementation 'org.mockito:mockito-core:5.2.0'
testImplementation 'org.slf4j:slf4j-simple:2.0.5'
testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.14.2'
}
java {
withSourcesJar()
withJavadocJar()
}
tasks.named('jar') {
manifest {
attributes('Implementation-Title': project.name,
'Implementation-Version': project.version)
}
}
tasks.named('build') {
dependsOn('shadowJar')
}
// Configure Auto Relocation
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
task relocateShadowJar(type: ConfigureShadowRelocation) {
target = tasks.shadowJar
prefix = "io.pinecone.shadow" // Default value is "shadow"
}
tasks.shadowJar.dependsOn tasks.relocateShadowJar
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.19.4"
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
}
}
// Inform IDEs like IntelliJ IDEA, Eclipse or NetBeans about the generated code.
sourceSets {
main {
java {
srcDirs 'build/generated/source/proto/main/grpc'
srcDirs 'build/generated/source/proto/main/java'
}
}
}
publishing {
publications {
pineconeClientMaven(MavenPublication) {
from components.java
pom {
artifactId = 'pinecone-client'
name = 'pinecone-client'
description = 'The Pinecone.io Java Client'
url = 'https://github.com/pinecone-io/pinecone-java-client'
licenses {
license {
name = 'Proprietary License'
}
}
developers {
developer {
id = 'pinecone-ops'
name = 'Pinecone.io Ops'
email = 'ops@pinecone.io'
}
}
scm {
connection = 'scm:git:git://github.com/pinecone-io/pinecone-java-client.git'
developerConnection = 'scm:git:ssh://github.com/pinecone-io/pinecone-java-client.git'
url = 'http://github.com/pinecone-io/pinecone-java-client'
}
}
}
}
}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
signing {
def signingKeyId = findProperty("signingKeyId")
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign publishing.publications.pineconeClientMaven
}