Skip to content

Commit f33ca16

Browse files
authored
Merge pull request #104 from raphaeldelio/feature/java-sdk
Initial implementation of the Java SDK Client
2 parents b81205d + 5dcb3f0 commit f33ca16

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+7084
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,5 +235,5 @@ libs/redis/docs/.Trash*
235235
.claude
236236
TASK_MEMORY.md
237237
*.code-workspace
238-
238+
/agent-memory-client/agent-memory-client-java/.gradle/
239239
augment*.md
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
plugins {
2+
id("java-library")
3+
id("maven-publish")
4+
}
5+
6+
group = "com.redis"
7+
version = project.findProperty("version") as String? ?: "0.1.0"
8+
description = "Java client for the Agent Memory Server REST API"
9+
10+
java {
11+
sourceCompatibility = JavaVersion.VERSION_11
12+
targetCompatibility = JavaVersion.VERSION_11
13+
withJavadocJar()
14+
withSourcesJar()
15+
}
16+
17+
repositories {
18+
mavenCentral()
19+
}
20+
21+
dependencies {
22+
// HTTP Client
23+
implementation("com.squareup.okhttp3:okhttp:4.12.0")
24+
25+
// JSON Processing
26+
implementation("com.fasterxml.jackson.core:jackson-databind:2.16.1")
27+
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.16.1")
28+
29+
// ULID generation
30+
implementation("com.github.f4b6a3:ulid-creator:5.2.3")
31+
32+
// Annotations
33+
compileOnly("org.jetbrains:annotations:24.1.0")
34+
35+
// Testing
36+
testImplementation(platform("org.junit:junit-bom:5.10.0"))
37+
testImplementation("org.junit.jupiter:junit-jupiter")
38+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
39+
testImplementation("org.mockito:mockito-core:5.8.0")
40+
testImplementation("org.mockito:mockito-junit-jupiter:5.8.0")
41+
testImplementation("com.squareup.okhttp3:mockwebserver:4.12.0")
42+
43+
// Testcontainers for integration tests
44+
testImplementation(platform("org.testcontainers:testcontainers-bom:1.19.3"))
45+
testImplementation("org.testcontainers:testcontainers")
46+
testImplementation("org.testcontainers:junit-jupiter")
47+
}
48+
49+
tasks.test {
50+
useJUnitPlatform {
51+
excludeTags("integration")
52+
}
53+
}
54+
55+
// Create a separate task for integration tests
56+
tasks.register<Test>("integrationTest") {
57+
description = "Runs integration tests with Testcontainers"
58+
group = "verification"
59+
60+
testClassesDirs = sourceSets["test"].output.classesDirs
61+
classpath = sourceSets["test"].runtimeClasspath
62+
63+
useJUnitPlatform {
64+
includeTags("integration")
65+
}
66+
67+
shouldRunAfter(tasks.test)
68+
69+
// Integration tests may take longer
70+
testLogging {
71+
events("passed", "skipped", "failed")
72+
showStandardStreams = true
73+
}
74+
}
75+
76+
tasks.withType<JavaCompile> {
77+
options.encoding = "UTF-8"
78+
}
79+
80+
tasks.javadoc {
81+
options {
82+
(this as StandardJavadocDocletOptions).apply {
83+
addStringOption("Xdoclint:none", "-quiet")
84+
}
85+
}
86+
}
87+
88+
publishing {
89+
publications {
90+
create<MavenPublication>("mavenJava") {
91+
from(components["java"])
92+
93+
groupId = project.group.toString()
94+
artifactId = project.name
95+
version = project.version.toString()
96+
97+
pom {
98+
name.set("Agent Memory Client Java")
99+
description.set(project.description)
100+
url.set("https://github.com/redis-developer/agent-memory-server")
101+
inceptionYear.set("2024")
102+
103+
licenses {
104+
license {
105+
name.set("Apache License 2.0")
106+
url.set("https://www.apache.org/licenses/LICENSE-2.0")
107+
}
108+
}
109+
110+
developers {
111+
developer {
112+
id.set("redis")
113+
name.set("Brian Sam-Bodden.")
114+
email.set("[email protected]")
115+
organization.set("Redis Inc.")
116+
organizationUrl.set("https://redis.io")
117+
}
118+
}
119+
120+
scm {
121+
connection.set("scm:git:git://github.com/redis-developer/agent-memory-server.git")
122+
developerConnection.set("scm:git:ssh://github.com:redis-developer/agent-memory-server.git")
123+
url.set("https://github.com/redis-developer/agent-memory-server")
124+
}
125+
}
126+
}
127+
}
128+
129+
repositories {
130+
maven {
131+
name = "staging"
132+
url = uri(layout.buildDirectory.dir("staging-deploy"))
133+
}
134+
}
135+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
version=0.1.0
2+
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)