Skip to content

Commit ada8ae4

Browse files
Merge branch 'publish'
2 parents 45126c8 + 4de0fdf commit ada8ae4

56 files changed

Lines changed: 1961 additions & 247 deletions

File tree

Some content is hidden

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

.gitlab-ci.yml

Lines changed: 55 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
# https://docs.gitlab.com/ci/yaml/
22

3-
# Default Docker image (currently only supporting Docker Linux containers)
4-
# This should match the image used to build the JVM database libraries (so Address Sanitizer library matches).
5-
# When updating, check if the test-jdk jobs need changing.
6-
image: objectboxio/buildenv-core:2025-07-03 # With JDK 21
7-
83
# Assumes these environment variables are configured in GitLab CI/CD Settings:
94
# - OBX_READ_PACKAGES_TOKEN
105
# - SONATYPE_USER
@@ -36,7 +31,7 @@ variables:
3631
GITLAB_PUBLISH_ARGS: "-PgitlabPublishTokenName=Job-Token -PgitlabPublishToken=$CI_JOB_TOKEN"
3732
CENTRAL_PUBLISH_ARGS: "-PsonatypeUsername=$SONATYPE_USER -PsonatypePassword=$SONATYPE_PWD"
3833
# CI_COMMIT_REF_SLUG is the branch or tag name, but web-safe (only 0-9, a-z)
39-
VERSION_ARGS: "-PversionPostFix=$CI_COMMIT_REF_SLUG"
34+
VERSION_ARGS: "-PversionSuffix=$CI_COMMIT_REF_SLUG"
4035

4136
# Using multiple test stages to avoid running some things in parallel (see job notes).
4237
stages:
@@ -65,28 +60,47 @@ workflow:
6560
# In all other cases, create a pipeline
6661
- when: always
6762

68-
test:
69-
stage: test
63+
.docker_linux_x64_android: &docker_linux_x64_android
7064
tags:
7165
- docker
7266
- linux
7367
- x64
68+
image: objectboxio/buildenv-android:2024-12-09 # With JDK 21, Android build-tools;35.0.0 and platforms;android-35 pre-installed
7469
variables:
7570
# Image defaults to POSIX (ASCII), set a compatible locale so UTF-8 tests that interact with the file system work.
7671
# Check with 'locale -a' for available locales.
7772
LC_ALL: "C.UTF-8"
73+
74+
.test_base:
7875
before_script:
7976
# Print Gradle and JVM version info
8077
- ./gradlew -version
8178
# Remove any previous JVM (Hotspot) crash log.
8279
# "|| true" for an OK exit code if no file is found
8380
- rm **/hs_err_pid*.log || true
81+
# By default, don't compile and test the Android APIs (only do in test job), there is currently no benefit to test
82+
# them using multiple platforms or JDKs.
83+
script: ./gradlew $GITLAB_REPO_ARGS $VERSION_ARGS clean build -PexcludeAndroid=true
84+
artifacts:
85+
when: always
86+
paths:
87+
- "**/hs_err_pid*.log" # Only on JVM (Hotspot) crash
88+
reports:
89+
junit: "**/build/test-results/**/TEST-*.xml"
90+
91+
test:
92+
<<: *docker_linux_x64_android
93+
extends: .test_base
94+
stage: test
95+
# Overwrite script key to run through ASAN script, compile and test Android APIs and test build of Web API docs.
96+
# Note: Address sanitizer is only available on Linux runners (see script).
8497
script:
8598
# build to assemble, run tests and spotbugs
8699
# javadocForWeb to catch API docs errors before releasing
87100
# Temporarily disable testing with Address Sanitizer until buildenv images are modernized, see #273
88101
# - ./scripts/test-with-asan.sh $GITLAB_REPO_ARGS $VERSION_ARGS clean build javadocForWeb
89102
- ./gradlew $GITLAB_REPO_ARGS $VERSION_ARGS clean build javadocForWeb
103+
# Overwrite artifacts key to archive spotbugs reports
90104
artifacts:
91105
when: always
92106
paths:
@@ -95,88 +109,59 @@ test:
95109
reports:
96110
junit: "**/build/test-results/**/TEST-*.xml"
97111

98-
.test-template:
99-
before_script:
100-
# Print Gradle and JVM version info
101-
- ./gradlew -version
102-
# Remove any previous JVM (Hotspot) crash log.
103-
# "|| true" for an OK exit code if no file is found
104-
- rm **/hs_err_pid*.log || true
105-
artifacts:
106-
when: always
107-
paths:
108-
- "**/hs_err_pid*.log" # Only on JVM (Hotspot) crash.
109-
reports:
110-
junit: "**/build/test-results/**/TEST-*.xml"
111-
112-
test-windows:
113-
extends: .test-template
114-
needs: ["test"]
115-
tags:
116-
- windows-jdk
117-
- x64
118-
script: ./gradlew $GITLAB_REPO_ARGS $VERSION_ARGS clean build
119-
120-
test-macos:
121-
extends: .test-template
122-
needs: ["test"]
123-
tags:
124-
- jdk
125-
- mac
126-
script: ./gradlew $GITLAB_REPO_ARGS $VERSION_ARGS clean build
127-
128-
# Address sanitizer is only available on Linux runners (see script).
129-
.test-asan-template:
130-
extends: .test-template
131-
tags:
132-
- docker
133-
- linux
134-
- x64
135-
variables:
136-
# Image defaults to POSIX (ASCII), set a compatible locale so UTF-8 tests that interact with the file system work.
137-
# Check with 'locale -a' for available locales.
138-
LC_ALL: "C.UTF-8"
112+
.test_jdks:
113+
<<: *docker_linux_x64_android
114+
extends: .test_base
115+
# Overwrite script key to run through ASAN script and to run test task directly to avoid
116+
# running SpotBugs (build runs check runs SpotBugs tasks).
117+
# Note: Address sanitizer is only available on Linux runners (see script).
139118
script:
140-
# Note: do not run check task as it includes SpotBugs.
141119
# Temporarily disable testing with Address Sanitizer until buildenv images are modernized, see #273
142120
# - ./scripts/test-with-asan.sh $GITLAB_REPO_ARGS $VERSION_ARGS clean :tests:objectbox-java-test:test
143121
- ./gradlew $GITLAB_REPO_ARGS $VERSION_ARGS clean :tests:objectbox-java-test:test
144122

145123
# Test oldest supported and a recent JDK.
146-
# Note: can not run these in parallel using a matrix configuration as Gradle would step over itself.
147124
test-jdk-8:
148-
extends: .test-asan-template
125+
extends: .test_jdks
149126
needs: ["test"]
150127
variables:
151128
TEST_JDK: 8
152129

153130
# JDK 21 is the default of the current build image, so test the latest LTS JDK 25
154131
test-jdk-25:
155-
extends: .test-asan-template
156-
needs: ["test-jdk-8"]
132+
extends: .test_jdks
133+
needs: ["test"]
157134
variables:
158135
TEST_JDK: 25
159136

160-
test-jdk-x86:
161-
extends: .test-template
162-
needs: ["test-windows"]
137+
test-macos:
138+
extends: .test_base
163139
tags:
164-
- windows-jdk
140+
- jdk
141+
- mac
142+
143+
test-windows:
144+
extends: .test_base
145+
tags:
146+
- jdk
147+
- windows
165148
- x64
149+
150+
test-windows-jdk-x86:
151+
extends: .test_base
152+
tags:
153+
- jdk-x86
154+
- windows
166155
variables:
167156
# TEST_WITH_JAVA_X86 makes objectbox-java-test use 32-bit java executable and therefore
168157
# 32-bit ObjectBox to run tests (see build.gradle file).
169158
# Note: assumes JAVA_HOME_X86 is set to 32-bit JDK path.
170159
TEST_WITH_JAVA_X86: "true"
171-
script: ./gradlew $GITLAB_REPO_ARGS $VERSION_ARGS clean build
172160

173161
# Publish Maven artifacts to internal Maven repo
174162
publish-maven-internal:
163+
<<: *docker_linux_x64_android
175164
stage: publish-maven-internal
176-
tags:
177-
- docker
178-
- linux
179-
- x64
180165
rules:
181166
# Not when using release versions and not publishing a release to avoid duplicate artifacts
182167
# (GitLab would allow to upload duplicates for a release version)
@@ -191,36 +176,30 @@ publish-maven-internal:
191176
# Otherwise, only if no previous stages failed
192177
- when: on_success
193178
script:
194-
- ./gradlew $GITLAB_REPO_ARGS $GITLAB_PUBLISH_ARGS $VERSION_ARGS publishMavenJavaPublicationToGitLabRepository
179+
- ./gradlew $GITLAB_REPO_ARGS $GITLAB_PUBLISH_ARGS $VERSION_ARGS publishAllPublicationsToGitLabRepository
195180

196181
# Publish Maven artifacts to public Maven Central repo
197182
publish-maven-central:
183+
<<: *docker_linux_x64_android
198184
stage: publish-maven-central
199-
tags:
200-
- docker
201-
- linux
202-
- x64
203185
rules:
204186
# Only if publishing a release, only if no previous stages failed
205187
- if: $OBX_PUBLISH_RELEASE == "true"
206188
when: on_success
207189
before_script:
208-
- ci/send-to-gchat.sh "$GOOGLE_CHAT_WEBHOOK_JAVA_CI" --thread $CI_COMMIT_SHA "*Releasing Java library:* job $CI_JOB_NAME from branch $CI_COMMIT_BRANCH ($CI_COMMIT_SHORT_SHA)..."
190+
- ci/send-to-gchat.sh "$GOOGLE_CHAT_WEBHOOK_JAVA_CI" --thread $CI_COMMIT_SHA "*Releasing Java libraries to Maven Central:* job $CI_JOB_NAME from branch $CI_COMMIT_BRANCH ($CI_COMMIT_SHORT_SHA)..."
209191
script:
210-
# Note: supply internal repo as tests use native dependencies that might not be published, yet.
211-
- ./gradlew $GITLAB_REPO_ARGS $VERSION_ARGS $CENTRAL_PUBLISH_ARGS publishMavenJavaPublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository
192+
# Note: supply internal repo as tests use native dependencies that might not be available publicly, yet.
193+
- ./gradlew $GITLAB_REPO_ARGS $VERSION_ARGS $CENTRAL_PUBLISH_ARGS publishAllPublicationsToSonatypeRepository closeAndReleaseSonatypeStagingRepository
212194
after_script:
213195
# Also runs on failure, so show CI_JOB_STATUS.
214-
- ci/send-to-gchat.sh "$GOOGLE_CHAT_WEBHOOK_JAVA_CI" --thread $CI_COMMIT_SHA "*Releasing Java library:* *$CI_JOB_STATUS* for $CI_JOB_NAME"
196+
- ci/send-to-gchat.sh "$GOOGLE_CHAT_WEBHOOK_JAVA_CI" --thread $CI_COMMIT_SHA "*Releasing Java libraries to Maven Central:* *$CI_JOB_STATUS* for $CI_JOB_NAME"
215197
- ci/send-to-gchat.sh "$GOOGLE_CHAT_WEBHOOK_JAVA_CI" --thread $CI_COMMIT_SHA "Check https://repo1.maven.org/maven2/io/objectbox/ in a few minutes."
216198

217199
# Create Java API docs archive
218200
package-api-docs:
201+
<<: *docker_linux_x64_android
219202
stage: package-api-docs
220-
tags:
221-
- docker
222-
- linux
223-
- x64
224203
rules:
225204
# Only if publishing a release, only if no previous stages failed
226205
- if: $OBX_PUBLISH_RELEASE == "true"

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ Notable changes to the ObjectBox Java library.
44

55
For more insights into what changed in the database libraries, [check the ObjectBox C changelog](https://github.com/objectbox/objectbox-c/blob/main/CHANGELOG.md).
66

7+
## 5.4.2 - 2026-05-05
8+
9+
- Update Android and JVM libraries to database version `5.3.2-2026-05-05`
10+
- Fixed a corner case with "unique replace on conflict" and absent (e.g. null) sync clock value
11+
- Internal fixes and improvements
12+
713
## 5.4.1 - 2026-03-26
814

915
- Update Android and JVM libraries to database version `5.3.1-2026-03-26`

Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ String buildsToKeep = '500'
66

77
String gradleArgs = '--stacktrace'
88
boolean isPublish = BRANCH_NAME == 'publish'
9-
String versionPostfix = isPublish ? '' : BRANCH_NAME // Build script detects empty string as not set.
9+
String versionSuffix = isPublish ? '' : BRANCH_NAME // Build script detects empty string as not set.
1010

1111
// Note: using single quotes to avoid Groovy String interpolation leaking secrets.
1212
def signingArgs = '-PsigningKeyFile=$SIGNING_FILE -PsigningKeyId=$SIGNING_ID -PsigningPassword=$SIGNING_PWD'
@@ -107,7 +107,7 @@ pipeline {
107107

108108
stage('upload-to-internal') {
109109
steps {
110-
sh "./gradlew $gradleArgs $signingArgs $gitlabRepoArgs -PversionPostFix=$versionPostfix publishMavenJavaPublicationToGitLabRepository"
110+
sh "./gradlew $gradleArgs $signingArgs $gitlabRepoArgs -PversionSuffix=$versionSuffix publishMavenJavaPublicationToGitLabRepository"
111111
}
112112
}
113113

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ agp = "AGP_VERSION"
151151
kotlin = "KOTLIN_VERSION"
152152

153153
# Define a variable for the version of the ObjectBox plugin
154-
objectbox = "5.4.1"
154+
objectbox = "5.4.2"
155155

156156
[plugins]
157157
# For an Android project, using Android Gradle Plugin 9.0 or newer
@@ -251,7 +251,7 @@ Your project can now use ObjectBox, continue by [defining entity classes](https:
251251

252252
plugins {
253253
// Add the ObjectBox plugin
254-
id("io.objectbox") version "5.4.1" apply false
254+
id("io.objectbox") version "5.4.2" apply false
255255
}
256256
```
257257

@@ -283,7 +283,7 @@ dependencyResolutionManagement {
283283

284284
buildscript {
285285
// Define a variable for the ObjectBox plugin version
286-
val objectboxVersion by extra("5.4.1")
286+
val objectboxVersion by extra("5.4.2")
287287

288288
repositories {
289289
// Add Maven Central to the plugin repositories
@@ -313,7 +313,7 @@ allprojects {
313313
314314
buildscript {
315315
// Define a variable for the ObjectBox plugin version
316-
ext.objectboxVersion = "5.4.1"
316+
ext.objectboxVersion = "5.4.2"
317317
318318
repositories {
319319
// Add Maven Central to the plugin repositories

build-logic/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Build logic project
2+
3+
This project provides common build logic and is included as a composite build in the root settings file (as it provides
4+
a plugin, in the `pluginManagement` block instead of before the usual include statements):
5+
6+
```kotlin
7+
pluginManagement {
8+
includeBuild("build-logic")
9+
}
10+
```
11+
12+
## Convention Plugins
13+
14+
- [objectbox.publishing-conventions](src/main/kotlin/objectbox.publishing-conventions.gradle.kts): adds GitLab repo,
15+
configures common Maven POM values, configures signing of artifacts
16+
17+
## Related Gradle documentation
18+
19+
- https://docs.gradle.org/current/userguide/composite_builds.html#included_plugin_builds
20+
- https://docs.gradle.org/current/userguide/best_practices_structuring_builds.html#use_convention_plugins
21+
- https://github.com/gradle/gradle/tree/master/platforms/documentation/docs/src/snippets/best-practices/useConventionPlugins-do

build-logic/settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = "build-logic"

0 commit comments

Comments
 (0)