-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
113 lines (98 loc) · 3.39 KB
/
build.gradle.kts
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
plugins {
id("java")
id("com.diffplug.spotless") version "5.15.1"
// Publishing plugins
id("maven-publish")
id("signing")
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
}
group = "software.momento.java"
repositories {
mavenCentral()
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
// For publishing
withSourcesJar()
withJavadocJar()
}
dependencies {
implementation("io.lettuce:lettuce-core:6.4.0.RELEASE")
implementation("software.momento.java:sdk:1.15.0")
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("org.slf4j:slf4j-api:2.0.16")
testImplementation("ch.qos.logback:logback-classic:1.5.7")
}
tasks.test {
useJUnitPlatform()
outputs.upToDateWhen { false }
testLogging {
events("PASSED", "FAILED", "SKIPPED")
showStandardStreams = true
}
}
spotless {
java {
removeUnusedImports()
googleJavaFormat("1.11.0")
}
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
groupId = group.toString()
artifactId = project.name
version = project.version.toString()
pom {
name.set("Momento Lettuce Compatibility Client")
description.set("Momento-backed implementation of the Lettuce Redis client")
url.set("https://github.com/momentohq/momento-java-lettuce-client")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("momento")
name.set("Momento")
organization.set("Momento")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git://github.com/momentohq/momento-java-lettuce-client.git")
developerConnection.set("scm:git:[email protected]:momentohq/momento-java-lettuce-client.git")
url.set("https://github.com/momentohq/momento-java-lettuce-client")
}
}
}
}
}
// Signing and Nexus publishing setup
val signingKey: String? = System.getenv("SONATYPE_SIGNING_KEY")
val signingPassword: String? = System.getenv("SONATYPE_SIGNING_KEY_PASSWORD")
if (signingKey != null && signingPassword != null) {
signing {
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications["mavenJava"])
}
}
val sonatypeUsername: String? = System.getenv("SONATYPE_USERNAME")
val sonatypePassword: String? = System.getenv("SONATYPE_PASSWORD")
if (sonatypeUsername != null && sonatypePassword != null) {
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.set(sonatypeUsername)
password.set(sonatypePassword)
}
}
}
}