-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
173 lines (155 loc) · 4.87 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
166
167
168
169
170
171
172
173
buildscript {
ext.kotlin_version = '2.1.0'
repositories {
mavenCentral()
//Needed only for SNAPSHOT versions
//maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.30.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath 'build.buf:buf-gradle-plugin:0.10.0'
}
}
apply plugin: "java"
apply plugin: "kotlin"
apply plugin: "kotlinx-serialization"
apply plugin: "maven-publish"
apply plugin: "signing"
apply plugin: 'io.codearte.nexus-staging'
apply plugin: 'build.buf'
tasks.named("bufFormatApply").configure {
dependsOn("bufGenerate")
dependsOn("bufFormatCheck")
dependsOn("bufLint")
}
group = "org.vdaas.vald"
archivesBaseName = "vald-client-java"
version = "1.7.16"
description = "a client library for Vald (https://github.com/vdaas/vald)."
def isDevBuild
def isSnapshotBuild
def isReleaseBuild
def sonatypeRepositoryUrl
def sonatypeUsername = System.getenv('SONATYPE_USERNAME')
def sonatypePassword = System.getenv('SONATYPE_PASSWORD')
def protoDepsPath = "proto_deps"
if (hasProperty("release")) {
isReleaseBuild = true
sonatypeRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
} else if (hasProperty("snapshot")) {
isSnapshotBuild = true
version += "-SNAPSHOT"
sonatypeRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
} else {
isDevBuild = true
version += "-SNAPSHOT"
}
nexusStaging {
packageGroup = "org.vdaas.vald"
stagingProfileId = "24fc47a63d38e2"
numberOfRetries = 100
delayBetweenRetriesInMillis = 30000
}
repositories {
jcenter()
if (isDevBuild) {
mavenLocal()
} else {
mavenCentral()
}
}
dependencies {
implementation 'io.grpc:grpc-stub:1.69.0'
implementation 'io.grpc:grpc-protobuf:1.69.0'
implementation 'com.google.protobuf:protobuf-java:3.25.1'
implementation 'javax.annotation:javax.annotation-api:1.3.2'
implementation 'build.buf:protovalidate:0.5.0'
testImplementation 'org.jetbrains.kotlin:kotlin-stdlib:2.1.0'
testImplementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.0'
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.4'
testImplementation 'io.grpc:grpc-okhttp:1.69.0'
}
test {
useJUnitPlatform()
testLogging {
showStandardStreams true
events 'started', 'skipped', 'passed', 'failed'
exceptionFormat 'full'
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar, javadocJar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = 'vald-client-java'
packaging = 'jar'
description = "a client library for Vald (https://github.com/vdaas/vald)."
url = 'https://github.com/vdaas/vald-client-java'
scm {
url = "scm:[email protected]:vdaas/vald-client-java.git"
connection = "scm:[email protected]:vdaas/vald-client-java.git"
developerConnection = "scm:[email protected]:vdaas/vald-client-java.git"
}
licenses {
license {
name = 'Apache 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0'
}
}
developers {
developer {
id = 'kpango'
name = 'Yusuke Kato'
email = '[email protected]'
}
developer {
id = 'kmrmt'
name = 'Kosuke Morimoto'
email = '[email protected]'
}
developer {
id = 'kevindiu'
name = 'Kevin Diu'
email = '[email protected]'
}
}
}
}
}
repositories {
maven {
url = sonatypeRepositoryUrl
credentials {
username = sonatypeUsername
password = sonatypePassword
}
}
}
}
signing {
required { isReleaseBuild }
if(isReleaseBuild) {
sign publishing.publications.mavenJava
}
}
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}