Skip to content

Commit cbabc42

Browse files
authored
Merge branch 'master' into fix-optional-primitive-decoder
2 parents 912373c + 4e89da2 commit cbabc42

File tree

19 files changed

+465
-138
lines changed

19 files changed

+465
-138
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -124,41 +124,6 @@ jobs:
124124
- name: Pack
125125
run: ./csharp/pack.sh
126126

127-
cpp-gcc-2004-build:
128-
name: C++ GCC ${{ matrix.version }} (Ubuntu 20.04)
129-
runs-on: ubuntu-20.04
130-
timeout-minutes: 60
131-
strategy:
132-
fail-fast: false
133-
matrix:
134-
version: [ '6', '7', '8', '9', '10' ]
135-
env:
136-
CC: gcc-${{ matrix.version }}
137-
CXX: g++-${{ matrix.version }}
138-
steps:
139-
- name: Checkout code
140-
uses: actions/checkout@v4
141-
with:
142-
ref: ${{ github.sha }}
143-
- name: Install compiler
144-
run: |
145-
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ bionic main universe"
146-
sudo apt-get install -y g++-${{ matrix.version }} libsparsehash-dev libidn11
147-
- name: Setup java to run Gradle script
148-
uses: actions/setup-java@v4
149-
with:
150-
distribution: 'zulu'
151-
java-version: ${{ env.JAVA_VERSION }}
152-
- name: Setup BUILD_JAVA_HOME & BUILD_JAVA_VERSION
153-
run: |
154-
java -Xinternalversion
155-
echo "BUILD_JAVA_HOME=${JAVA_HOME}" >> $GITHUB_ENV
156-
echo "BUILD_JAVA_VERSION=${{ env.JAVA_VERSION }}" >> $GITHUB_ENV
157-
- name: Setup Gradle
158-
uses: gradle/actions/setup-gradle@v4
159-
- name: Build
160-
run: ./cppbuild/cppbuild
161-
162127
cpp-gcc-2404-build:
163128
name: C++ GCC ${{ matrix.version }} (Ubuntu 24.04)
164129
runs-on: ubuntu-24.04
@@ -195,52 +160,14 @@ jobs:
195160
- name: Build
196161
run: ./cppbuild/cppbuild
197162

198-
cpp-clang-2004-build:
199-
name: C++ Clang ${{ matrix.version }} (Ubuntu 20.04)
200-
runs-on: ubuntu-20.04
201-
timeout-minutes: 60
202-
strategy:
203-
fail-fast: false
204-
matrix:
205-
version: [ '9', '10', '11', '12' ]
206-
env:
207-
CC: clang-${{ matrix.version }}
208-
CXX: clang++-${{ matrix.version }}
209-
steps:
210-
- name: Checkout code
211-
uses: actions/checkout@v4
212-
with:
213-
ref: ${{ github.sha }}
214-
- name: Install compiler
215-
run: |
216-
sudo mkdir -p /etc/apt/keyrings/
217-
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/llvm-snapshot.gpg
218-
echo "deb [signed-by=/etc/apt/keyrings/llvm-snapshot.gpg] http://apt.llvm.org/focal/ llvm-toolchain-focal-${{ matrix.version }} main" | sudo tee /etc/apt/sources.list.d/llvm.list
219-
sudo apt-get update
220-
sudo apt-get install -y clang-${{ matrix.version }} libsparsehash-dev libidn11
221-
- name: Setup java to run Gradle script
222-
uses: actions/setup-java@v4
223-
with:
224-
distribution: 'zulu'
225-
java-version: ${{ env.JAVA_VERSION }}
226-
- name: Setup BUILD_JAVA_HOME & BUILD_JAVA_VERSION
227-
run: |
228-
java -Xinternalversion
229-
echo "BUILD_JAVA_HOME=${JAVA_HOME}" >> $GITHUB_ENV
230-
echo "BUILD_JAVA_VERSION=${{ env.JAVA_VERSION }}" >> $GITHUB_ENV
231-
- name: Setup Gradle
232-
uses: gradle/actions/setup-gradle@v4
233-
- name: Build
234-
run: ./cppbuild/cppbuild
235-
236163
cpp-clang-2404-build:
237164
name: C++ Clang ${{ matrix.version }} (Ubuntu 24.04)
238165
runs-on: ubuntu-24.04
239166
timeout-minutes: 60
240167
strategy:
241168
fail-fast: false
242169
matrix:
243-
version: [ '13', '14', '15', '16', '17', '18' ]
170+
version: [ '13', '14', '15', '16', '17', '18', '19', '20' ]
244171
env:
245172
CC: clang-${{ matrix.version }}
246173
CXX: clang++-${{ matrix.version }}
@@ -371,7 +298,7 @@ jobs:
371298
strategy:
372299
fail-fast: false
373300
matrix:
374-
version: [ '1.22.x' ]
301+
version: [ '1.23.x', '1.24.x' ]
375302
steps:
376303
- name: Checkout code
377304
uses: actions/checkout@v4

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ jobs:
5757
- name: Setup Gradle
5858
uses: gradle/actions/setup-gradle@v4
5959
- name: Publish with Gradle
60-
run: ./gradlew publish
60+
run: ./gradlew publish uploadArtifactsToCentralPortal
6161
env:
62-
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.SONATYPE_CENTRAL_USERNAME }}
63-
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }}
64-
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_RSA_SIGN_KEY }}
65-
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_RSA_SIGN_KEYPASS }}
62+
SIGNING_GPG_SECRET_KEY: ${{ secrets.GPG_RSA_SIGN_KEY }}
63+
SIGNING_GPG_PASSWORD: ${{ secrets.GPG_RSA_SIGN_KEYPASS }}
64+
SONATYPE_CENTRAL_PORTAL_USERNAME: ${{ secrets.SONATYPE_CENTRAL_PORTAL_USERNAME }}
65+
SONATYPE_CENTRAL_PORTAL_PASSWORD: ${{ secrets.SONATYPE_CENTRAL_PORTAL_PASSWORD }}

.gitignore

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@
1919
build-local.properties
2020
deps
2121
*/bin
22-
build
23-
.gradle
24-
target
22+
build/
23+
!buildSrc/
24+
!buildSrc/src/**/build
25+
.gradle/
26+
target/
2527
GTAGS
2628
GRTAGS
2729
GPATH
2830
prop
29-
out
31+
out/
3032
.vs/
3133
.vscode
3234

CHANGELOG.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Changelog
2+
3+
## [1.35.3] - 2025-06-06
4+
### Changed
5+
* **Java:** Publish release artifacts to Central Portal using OSSRH Staging API service.
6+
* **Java:** Bump `Agrona` to 2.2.2.
7+
* **Java:** Bump `Checkstyle` to 10.25.0.
8+
* **Java:** Bump `Gradle` to 8.14.2.
9+
10+
## [1.35.1] - 2025-06-02
11+
### Changed
12+
* Bump `Agrona` to 2.2.1.
13+
* Bump `JUnit` to 5.13.0.
14+
15+
## [1.35.0] - 2025-05-26
16+
### Changed
17+
* Update `Implementation-Vendor`.
18+
* **Rust:** Elide explicit ActingVersion lifetime. ([#1053](https://github.com/aeron-io/simple-binary-encoding/pull/1053))
19+
* **CI:** Use `gradle/actions/setup-gradle` action for caching Gradle dependencies.
20+
* **CI:** Enable JDK 24 GA build.
21+
* **CI:** Simplify error log upload.
22+
* **CI:** Remove Ubuntu 20.04 based builds.
23+
* **CI:** Bump Go build to use 1.23.x and 1.24.x.
24+
* Bump `Agrona` to 2.2.0.
25+
* Bump `Gradle` to 8.14.1.
26+
* Bump `Checkstyle` to 10.24.0.
27+
* Bump `json` to 20250517.
28+
* Bump `JUnit` to 5.12.2.
29+
* Bump `Mockito` to 5.18.0.
30+
* Bump `Shadow` to 8.3.6.
31+
* Bump `Versions` to 0.52.
32+
33+
### Fixed
34+
* **Java:** include field 'deprecated' in ir encoding and decoding.
35+
* **Java:** Adjust Java DTO Choice Set Access. ([#1064](https://github.com/aeron-io/simple-binary-encoding/issues/1064))
36+
* **Rust:** get proper version for composite types. ([#1058](https://github.com/aeron-io/simple-binary-encoding/pull/1058))
37+
* **C#:** Read NuGet package version from version file ([#1061](https://github.com/aeron-io/simple-binary-encoding/pull/1061))
38+
* **C#:** Enable dual build for netstandard2.0 & netstandard2.1. ([#1062](https://github.com/aeron-io/simple-binary-encoding/pull/1062))
39+
40+
## [1.34.1] - 2025-01-13
41+
### Changed
42+
* Bump `json` to 20250107.
43+
* Bump `Mockito` to 5.15.2.
44+
45+
### Added
46+
* **Doc:** Add `--add-opens java.base/jdk.internal.misc=ALL-UNNAMED` to the example execution.
47+
* **Rust:** encoding primitive arrays now supports slice instead of array (issue [#1021](https://github.com/aeron-io/simple-binary-encoding/issues/)). ([#1040](https://github.com/aeron-io/simple-binary-encoding/pull/1040))
48+
49+
### Fixed
50+
* **C++:** check for not wrapped state in `decodeLength()` when precedence checks are enabled. ([#1046](https://github.com/aeron-io/simple-binary-encoding/pull/1046))
51+
* **C++:** use `m_actingBlockLength` in `decodeLength()`. ([#1045](https://github.com/aeron-io/simple-binary-encoding/pull/1045))
52+
53+
## [1.34.0] - 2024-12-17
54+
### Changed
55+
* **C++:** hide the m_codecStatePtr behind ifdefs to avoid overhead when precedence checking is disabled. ([#1036](https://github.com/aeron-io/simple-binary-encoding/pull/1036))
56+
* **C++:** use constexpr to define precedence checks lookup tables.
57+
* **Rust:** Enhance enum supporting fromstr and display and into. ([#1020](https://github.com/aeron-io/simple-binary-encoding/pull/1020))
58+
* **Rust:** codegen of primitive enums now implement 'From' instead of 'Into'. ([#1029](https://github.com/aeron-io/simple-binary-encoding/pull/1029))
59+
* **Java:** Update Checkstyle rules and apply them.
60+
* **Breaking:** Bump `Agrona` to 2.0.0.
61+
_**Note:** `--add-opens java.base/jdk.internal.misc=ALL-UNNAMED` JVM option must be specified in order to generate codecs or use the generated Java classes. For example:_
62+
```shell
63+
$ java --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -Dsbe.generate.ir=true -Dsbe.target.language=Cpp -Dsbe.target.namespace=sbe -Dsbe.output.dir=include/gen -Dsbe.errorLog=yes -jar sbe-all/build/libs/sbe-all-${SBE_TOOL_VERSION}.jar my-sbe-messages.xml
64+
```
65+
* Bump `Gradle` to 8.11.1.
66+
* Bump `Checkstyle` to 10.21.0.
67+
* Bump `ByteBuddy` to 1.15.11.
68+
* Bump `JUnit` to 5.11.4.
69+
* Bump `jqwik` to 1.9.2.
70+
71+
### Added
72+
* **C++:** Integrate std::span support for flyweight API. ([#1038](https://github.com/aeron-io/simple-binary-encoding/pull/1038), [#1027](https://github.com/aeron-io/simple-binary-encoding/pull/1027))
73+
* **Rust:** generate message schema level info in lib.rs. ([#1019](https://github.com/aeron-io/simple-binary-encoding/pull/1019))
74+
75+
### Fixed
76+
* **C++:** Fix field precedence check issue [#1031](https://github.com/aeron-io/simple-binary-encoding/issues/1031). ([#1033](https://github.com/aeron-io/simple-binary-encoding/pull/1033))
77+
* **C++:** respect the package override option for C++ codecs and DTOs. ([#1024](https://github.com/aeron-io/simple-binary-encoding/pull/1024))
78+
* **C#:** respect the package override option for C# codecs and DTOs. ([#1024](https://github.com/aeron-io/simple-binary-encoding/pull/1024))
79+
* **Go:** Fix warning about used args in GolangFlyweightGenerator.
80+
* **Rust:** Updated code generator to resolve Issue [#1028](https://github.com/aeron-io/simple-binary-encoding/issues/1028). ([#1037](https://github.com/aeron-io/simple-binary-encoding/pull/1037))
81+
* **Java:** Prevent collision when field name is 'value'.
82+
* **Java:** Preserve byte order throughout IR transformations.
83+
84+
[1.35.3]: https://github.com/aeron-io/simple-binary-encoding/releases/tag/1.35.3
85+
[1.35.1]: https://github.com/aeron-io/simple-binary-encoding/releases/tag/1.35.1
86+
[1.35.0]: https://github.com/aeron-io/simple-binary-encoding/releases/tag/1.35.0
87+
[1.34.1]: https://github.com/aeron-io/simple-binary-encoding/releases/tag/1.34.1
88+
[1.34.0]: https://github.com/aeron-io/simple-binary-encoding/releases/tag/1.34.0

build.gradle

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -53,26 +53,30 @@ def toolchainLauncher = javaToolchains.launcherFor {
5353
def sbeGroup = 'uk.co.real-logic'
5454
def sbeVersion = file('version.txt').text.trim()
5555

56-
ext {
57-
isReleaseVersion = !sbeVersion.endsWith('-SNAPSHOT')
58-
releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
59-
snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
60-
61-
if (!project.hasProperty('ossrhUsername')) {
62-
ossrhUsername = ''
56+
def getConfigProperty(final String projectPropertyName, final String envVarName) {
57+
String value = project.findProperty(projectPropertyName)
58+
if (!value) {
59+
value = System.getenv(envVarName)
60+
if (!value) {
61+
return null
62+
}
6363
}
6464

65-
if (!project.hasProperty('ossrhPassword')) {
66-
ossrhPassword = ''
67-
}
65+
value = value.trim()
6866

69-
if (!project.hasProperty('signingKey')) {
70-
signingKey = null
71-
}
67+
return value ? value : null
68+
}
7269

73-
if (!project.hasProperty('signingPassword')) {
74-
signingPassword = null
75-
}
70+
ext {
71+
isReleaseVersion = !sbeVersion.endsWith('-SNAPSHOT')
72+
73+
sonatypeCentralPortalReleasesRepoUrl = 'https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/'
74+
sonatypeCentralPortalSnapshotsRepoUrl = 'https://central.sonatype.com/repository/maven-snapshots/'
75+
sonatypeCentralPortalUsername = getConfigProperty('sonatypeCentralPortalUsername', 'SONATYPE_CENTRAL_PORTAL_USERNAME')
76+
sonatypeCentralPortalPassword = getConfigProperty('sonatypeCentralPortalPassword', 'SONATYPE_CENTRAL_PORTAL_PASSWORD')
77+
78+
signingKey = getConfigProperty('signingKey', 'SIGNING_GPG_SECRET_KEY') // NOTE: ASCII armored secret key
79+
signingPassword = getConfigProperty('signingPassword', 'SIGNING_GPG_PASSWORD') // NOTE: Plain text
7680
}
7781

7882
def projectPom = {
@@ -172,15 +176,15 @@ subprojects {
172176
group = sbeGroup
173177
version = sbeVersion
174178

179+
checkstyle.toolVersion = libs.versions.checkstyle.get()
180+
175181
java {
176182
toolchain {
177183
languageVersion = JavaLanguageVersion.of(buildJavaVersion)
178184
}
179185
sourceCompatibility = JavaVersion.VERSION_17
180186
}
181187

182-
checkstyle.toolVersion = libs.versions.checkstyle.get()
183-
184188
tasks.withType(Sign).configureEach {
185189
onlyIf {
186190
isReleaseVersion && gradle.taskGraph.hasTask(tasks.publish)
@@ -389,10 +393,10 @@ project(':sbe-tool') {
389393

390394
repositories {
391395
maven {
392-
url = !isReleaseVersion ? snapshotsRepoUrl : releasesRepoUrl
396+
url = !isReleaseVersion ? sonatypeCentralPortalSnapshotsRepoUrl : sonatypeCentralPortalReleasesRepoUrl
393397
credentials {
394-
username = ossrhUsername
395-
password = ossrhPassword
398+
username = sonatypeCentralPortalUsername
399+
password = sonatypeCentralPortalPassword
396400
}
397401
}
398402
}
@@ -459,10 +463,10 @@ project(':sbe-all') {
459463
}
460464
repositories {
461465
maven {
462-
url = !isReleaseVersion ? snapshotsRepoUrl : releasesRepoUrl
466+
url = !isReleaseVersion ? sonatypeCentralPortalSnapshotsRepoUrl : sonatypeCentralPortalReleasesRepoUrl
463467
credentials {
464-
username = ossrhUsername
465-
password = ossrhPassword
468+
username = sonatypeCentralPortalUsername
469+
password = sonatypeCentralPortalPassword
466470
}
467471
}
468472
}
@@ -579,10 +583,10 @@ project(':sbe-samples') {
579583

580584
repositories {
581585
maven {
582-
url = !isReleaseVersion ? snapshotsRepoUrl : releasesRepoUrl
586+
url = !isReleaseVersion ? sonatypeCentralPortalSnapshotsRepoUrl : sonatypeCentralPortalReleasesRepoUrl
583587
credentials {
584-
username = ossrhUsername
585-
password = ossrhPassword
588+
username = sonatypeCentralPortalUsername
589+
password = sonatypeCentralPortalPassword
586590
}
587591
}
588592
}
@@ -672,6 +676,7 @@ tasks.register('generateRustTestCodecs', JavaExec) {
672676
'sbe-tool/src/test/resources/issue984.xml',
673677
'sbe-tool/src/test/resources/issue987.xml',
674678
'sbe-tool/src/test/resources/issue1028.xml',
679+
'sbe-tool/src/test/resources/issue1057.xml',
675680
'sbe-tool/src/test/resources/issue1066.xml',
676681
'sbe-tool/src/test/resources/fixed-sized-primitive-array-types.xml',
677682
'sbe-tool/src/test/resources/example-bigendian-test-schema.xml',
@@ -1115,8 +1120,14 @@ tasks.named('dependencyUpdates').configure {
11151120
}
11161121
}
11171122

1123+
tasks.register('uploadArtifactsToCentralPortal', uk.co.real_logic.sbe.build.SonatypeCentralPortalUploadRepositoryTask) {
1124+
portalUsername.set(sonatypeCentralPortalUsername)
1125+
portalPassword.set(sonatypeCentralPortalPassword)
1126+
groupId.set(sbeGroup)
1127+
snapshotRelease.set(!isReleaseVersion)
1128+
}
1129+
11181130
wrapper {
1119-
gradleVersion = libs.versions.gradle.get()
11201131
distributionType = 'ALL'
11211132
}
11221133

buildSrc/build.gradle

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
repositories {
2+
mavenCentral()
3+
}
4+
5+
configurations.configureEach {
6+
resolutionStrategy {
7+
failOnVersionConflict()
8+
}
9+
}
10+
11+
dependencies {
12+
implementation libs.json
13+
}
14+
15+
tasks.withType(JavaCompile).configureEach {
16+
configure(options) {
17+
options.compilerArgs << '-Xlint:deprecation' << '-Xlint:unchecked' // examples
18+
}
19+
}

buildSrc/settings.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
dependencyResolutionManagement {
2+
versionCatalogs {
3+
create("libs") {
4+
from(files("../gradle/libs.versions.toml"))
5+
}
6+
}
7+
}

0 commit comments

Comments
 (0)