-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.gradle
139 lines (121 loc) · 3.88 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
plugins {
id "java-library"
id "jacoco"
id "org.sonarqube" version "5.1.0.4882"
id "maven-publish"
id "signing"
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
id "com.diffplug.spotless" version "6.25.0"
id "me.qoomon.git-versioning" version "6.4.4"
id "com.github.ben-manes.versions" version "0.51.0"
}
group = "io.github.stefanbratanov"
version = "develop"
gitVersioning.apply {
refs {
tag("v(?<version>.*)") {
version = '${ref.version}'
}
}
}
repositories {
mavenCentral()
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withJavadocJar()
withSourcesJar()
}
def jacksonVersion = "2.18.0"
def junitVersion = "5.11.1"
dependencies {
implementation("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${jacksonVersion}")
api("com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}")
testImplementation("org.junit.jupiter:junit-jupiter:${junitVersion}")
testImplementation("org.junit.jupiter:junit-jupiter-params:${junitVersion}")
testImplementation("org.assertj:assertj-core:3.26.3")
testImplementation("org.mock-server:mockserver-netty-no-dependencies:5.15.0")
testImplementation("com.atlassian.oai:swagger-request-validator-core:2.42.0")
testImplementation("org.skyscreamer:jsonassert:1.5.3")
}
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
isNonStable(it.candidate.version)
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = "jvm-openai"
description = "A minimalistic OpenAI API client for the JVM, written in Java"
url = "https://github.com/StefanBratanov/jvm-openai"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "StefanBratanov"
name = "Stefan Bratanov"
email = "stefan.bratanov93@gmail.com"
}
}
scm {
connection = "scm:git:git://github.com/StefanBratanov/jvm-openai.git"
developerConnection = "scm:git:ssh://github.com/StefanBratanov/jvm-openai.git"
url = "https://github.com/StefanBratanov/jvm-openai"
}
}
}
}
}
signing {
useInMemoryPgpKeys(System.getenv("SIGNING_KEY"), System.getenv("SIGNING_PASSWORD"))
sign publishing.publications
}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username = System.getenv("OSSRH_USERNAME")
password = System.getenv("OSSRH_PASSWORD")
}
}
}
spotless {
java {
googleJavaFormat()
}
}
test {
useJUnitPlatform()
testLogging {
events "FAILED"
showStandardStreams = true
exceptionFormat "full"
}
}
jacocoTestReport {
reports {
xml.required = true
}
}
sonar {
properties {
property "sonar.projectKey", "StefanBratanov_jvm-openai"
property "sonar.organization", "stefanbratanov"
property "sonar.host.url", "https://sonarcloud.io"
}
}