Skip to content

Commit 7480f74

Browse files
committed
feat: add BLite.Client.Java with Spring Boot integration, Maven Central pipeline, and integration tests
- Full gRPC client (BLiteClient, BLiteCollection, BLiteTransaction, BLiteKvStore, BLiteAdminClient) - C-BSON serialization (CbsonWriter, CbsonReader) - QueryBuilder / QuerySerializer (MessagePack wire format) - Spring Boot autoconfiguration (BLiteAutoConfiguration, BLiteTemplate, BLiteRepository) - Integration tests mirroring BLite.Client.TypeScript pattern (CRUD, Query, Transaction, KV) - Maven Central publish via com.vanniktech.maven.publish 0.30.0 (Central Portal) - Fix: MetadataUtils.attachHeaders -> withInterceptors(newAttachHeadersInterceptor) - Fix: QuerySerializer orderBy nil -> packArrayHeader(0); LogicalFilter wire format
1 parent 9be85ed commit 7480f74

57 files changed

Lines changed: 4471 additions & 1 deletion

Some content is hidden

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

.github/workflows/release.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,42 @@ jobs:
262262
env:
263263
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
264264

265+
# ── Maven Central (Java client) ──────────────────────────────────────────────
266+
maven-central-client:
267+
name: Publish BLite.Client.Java to Maven Central
268+
runs-on: ubuntu-latest
269+
270+
steps:
271+
- name: Checkout
272+
uses: actions/checkout@v4
273+
274+
- name: Extract version
275+
id: version
276+
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
277+
278+
- name: Setup Java 17
279+
uses: actions/setup-java@v4
280+
with:
281+
java-version: "17"
282+
distribution: "temurin"
283+
284+
- name: Setup Gradle
285+
uses: gradle/actions/setup-gradle@v4
286+
287+
- name: Publish to Maven Central
288+
working-directory: src/BLite.Client.Java
289+
run: gradle publish -Pversion=${{ steps.version.outputs.version }}
290+
env:
291+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
292+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
293+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SIGNING_KEY }}
294+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SIGNING_PASSWORD }}
295+
265296
# ── GitHub Release ────────────────────────────────────────────────────────────
266297
release:
267298
name: Create GitHub Release
268299
runs-on: ubuntu-latest
269-
needs: [nuget-client, npm-client, docker, windows-installer, linux-installer]
300+
needs: [nuget-client, npm-client, maven-central-client, docker, windows-installer, linux-installer]
270301

271302
steps:
272303
- name: Download Windows installer

src/BLite.Client.Java/.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Gradle
2+
.gradle/
3+
build/
4+
!gradle/wrapper/gradle-wrapper.jar
5+
!**/src/main/**/build/
6+
!**/src/test/**/build/
7+
8+
# Generated proto/gRPC sources
9+
src/main/java/io/blite/proto/
10+
11+
# IntelliJ IDEA
12+
.idea/
13+
*.iml
14+
*.ipr
15+
*.iws
16+
out/
17+
18+
# Eclipse
19+
.classpath
20+
.project
21+
.settings/
22+
bin/
23+
24+
# VS Code
25+
.vscode/
26+
27+
# macOS
28+
.DS_Store
29+
30+
# Windows
31+
Thumbs.db
32+
33+
# Maven local publish staging
34+
local-staging/
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
// BLite.Client.Java — Gradle build
2+
// Copyright (C) 2026 Luca Fabbri — AGPL-3.0
3+
4+
plugins {
5+
`java-library`
6+
id("com.google.protobuf") version "0.9.4"
7+
id("com.vanniktech.maven.publish") version "0.30.0"
8+
}
9+
10+
group = "io.blite"
11+
version = "0.1.2"
12+
13+
java {
14+
toolchain { languageVersion.set(JavaLanguageVersion.of(21)) }
15+
}
16+
17+
repositories {
18+
mavenCentral()
19+
}
20+
21+
val grpcVersion = "1.68.1"
22+
val protobufVersion = "3.25.5"
23+
24+
dependencies {
25+
// ── gRPC ────────────────────────────────────────────────────────────────
26+
api("io.grpc:grpc-protobuf:$grpcVersion")
27+
api("io.grpc:grpc-stub:$grpcVersion")
28+
runtimeOnly("io.grpc:grpc-netty-shaded:$grpcVersion")
29+
compileOnly("org.apache.tomcat:annotations-api:6.0.53") // javax.annotation for generated stubs
30+
31+
// ── MessagePack (QueryDescriptor serialization) ──────────────────────────
32+
api("org.msgpack:msgpack-core:0.9.8")
33+
34+
// ── Spring Boot autoconfigure (optional) ─────────────────────────────────
35+
compileOnly("org.springframework.boot:spring-boot-autoconfigure:3.4.1")
36+
compileOnly("org.springframework.data:spring-data-commons:3.4.1")
37+
38+
// ── Test ─────────────────────────────────────────────────────────────────
39+
testImplementation("org.junit.jupiter:junit-jupiter:5.11.4")
40+
testImplementation("org.assertj:assertj-core:3.27.2")
41+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
42+
}
43+
44+
protobuf {
45+
protoc { artifact = "com.google.protobuf:protoc:$protobufVersion" }
46+
plugins {
47+
create("grpc") { artifact = "io.grpc:protoc-gen-grpc-java:$grpcVersion" }
48+
}
49+
generateProtoTasks {
50+
all().forEach {
51+
it.plugins { create("grpc") }
52+
}
53+
}
54+
}
55+
56+
tasks.test {
57+
useJUnitPlatform()
58+
}
59+
60+
mavenPublishing {
61+
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
62+
signAllPublications()
63+
64+
coordinates("io.blite", "blite-client-java", version.toString())
65+
66+
pom {
67+
name.set("BLite Client Java")
68+
description.set("Java/Spring Boot client SDK for BLite Server — provides typed access over gRPC.")
69+
url.set("https://github.com/EntglDb/BLite.Server")
70+
licenses {
71+
license {
72+
name.set("AGPL-3.0-only")
73+
url.set("https://www.gnu.org/licenses/agpl-3.0.html")
74+
}
75+
}
76+
developers {
77+
developer {
78+
id.set("entgldb")
79+
name.set("Luca Fabbri")
80+
organization.set("EntglDb")
81+
}
82+
}
83+
scm {
84+
connection.set("scm:git:git://github.com/EntglDb/BLite.Server.git")
85+
developerConnection.set("scm:git:ssh://github.com/EntglDb/BLite.Server.git")
86+
url.set("https://github.com/EntglDb/BLite.Server/tree/main/src/BLite.Client.Java")
87+
}
88+
}
89+
}
42.7 KB
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.0-milestone-1-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)