Skip to content

Commit 1cae8ba

Browse files
authored
Merge pull request #2 from neaeraconsulting/2025-q3-internal-review
Internal review
2 parents f37e547 + d14f65b commit 1cae8ba

Some content is hidden

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

43 files changed

+519
-151
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
branches:
99
- main
1010
- develop
11+
- "**"
1112
jobs:
1213
test:
1314
runs-on: ubuntu-latest
@@ -22,7 +23,7 @@ jobs:
2223
- name: Print env
2324
run: env | sort
2425
- name: Setup Gradle
25-
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
26+
uses: gradle/actions/setup-gradle@v5
2627
with:
2728
gradle-version: '8.13'
2829
- name: Test Library

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Print env
1919
run: env | sort
2020
- name: Setup Gradle
21-
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
21+
uses: gradle/actions/setup-gradle@v5
2222
with:
2323
gradle-version: '8.13'
2424
- name: Publish package

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ build
77
.idea/
88

99
bin/
10+
**/bin/
1011

1112
out.log
1213

Dockerfile-build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ WORKDIR /build
2626

2727
ADD ./asn1_codec/asn1c_combined/generated-files/2024.tar.gz /build
2828
ADD ./CMakeLists.txt /build
29-
ADD ./run-lib.sh /build
3029
COPY ./src /build/src/
3130

3231
ENV CC=/usr/bin/clang

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ A native, dynamic library, `libasnapplication.so`, is generated from asn1c gener
6161
The Java library, `j2735-2024-ffm-lib`, includes code generated by the [Jextract tool](https://github.com/openjdk/jextract).
6262

6363
Native method calls and native data structures are handled inside a Java thread-scoped "Arena".
64-
Arenas are FFM's way of limiting the scope and lifetime of memory used by native methods, to prevent memory leaks
65-
and security issues.
64+
Arenas are FFM's way of limiting the scope and lifetime of memory used by native methods, to prevent memory leaks and security issues.
6665
See: [docs.oracle.com: Memory Segments and Arenas](https://docs.oracle.com/en/java/javase/22/core/memory-segments-and-arenas.html#GUID-01CE34E8-7BCB-4540-92C4-E127C1F62711)
6766

6867
Java FFM bindings are generated by running the Jextract tool on the [src/convert.h](src/convert.h) header file.
@@ -99,6 +98,14 @@ The Java source code from jextract is copied to the `generated-jextract` folder.
9998

10099
The Windows library doesn't have an automated build process. It can be recreated using Visual Studio 2022 (not VSCode) with the Clang compiler for Windows. Some edits to the generated C files are required to build for Windows. Follow the instructions here: [C codec edits for Windows](generated-files/README.md). And then build via CMake in Visual Studio. The `CMakeSettings.json` file contains the Visual Studio configuration to use CMake with the clang compiler.
101100

101+
After regenerating the native libraries to the `lib` folder, also be sure to copy them to the [j2735-2024-ffm-lib/src/test/resources/j2735ffm](j2735-2024-ffm-lib/src/test/resources/j2735ffm) folder since they are required for the unit tests in that Java project via:
102+
103+
```bash
104+
cd lib
105+
cp libasnapplication.so ../j2735-2024-ffm-lib/src/test/resources/j2735ffm/
106+
cp asnapplication.dll ../j2735-2024-ffm-lib/src/test/resources/j2735ffm/
107+
```
108+
102109
## Unit Tests
103110

104111
The unit tests can be run in either Linux or Windows.
@@ -143,7 +150,19 @@ Content types are:
143150
| UPER hex | text/plain |
144151
| XER | application/xml |
145152

153+
### Demo API Open API Documentation
154+
155+
Swagger UI documentation for the Demo REST API is available at:
156+
157+
http://localhost:4000/swagger-ui.html
158+
159+
The OpenAPI specification is available in JSON format at:
160+
161+
http://localhost:4000/api-docs
162+
163+
or in YAML format at:
146164

165+
http://localhost:4000/api-docs.yaml
147166

148167

149168

generated-files/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.c
2-
*.h
2+
*.h
3+
2024/*

generated-files/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ C files extracted from the zip archive from asn1_codec are extracted here for us
55
Not persisted to version control.
66

77
To compile for Windows run the script `prepare-for-windows.sh` script to remove files
8-
related to GeneralizedTime, and edit the file `pdu_collection.c` to remove the lines:
8+
related to GeneralizedTime, and edit the file `pdu_collection.c` to comment out the lines:
99

1010
```c
1111
extern struct asn_TYPE_descriptor_s asn_DEF_Period;
1212
extern struct asn_TYPE_descriptor_s asn_DEF_AggregatedSingleTariffClassSession;
1313
extern struct asn_TYPE_descriptor_s asn_DEF_DetectedChargeObject;
14+
15+
&asn_DEF_AggregatedSingleTariffClassSession,
16+
&asn_DEF_DetectedChargeObject,
17+
&asn_DEF_Period,
1418
```
1519

j2735-2024-api/build.gradle

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins {
22
id 'java'
33
id 'java-library'
44
id "io.freefair.lombok" version "8.10.2"
5-
id 'org.springframework.boot' version '3.3.5'
5+
id 'org.springframework.boot' version '3.5.6'
66
id 'io.spring.dependency-management' version '1.1.6'
77
}
88

@@ -21,6 +21,17 @@ dependencies {
2121
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.3'
2222
implementation 'commons-io:commons-io:2.18.0'
2323
implementation 'org.springframework.boot:spring-boot-starter-web'
24+
25+
// Springdoc 2.8, requires Spring Boot 3.5
26+
// Ref: https://springdoc.org/#what-is-the-compatibility-matrix-of-springdoc-openapi-with-spring-boot
27+
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.13'
28+
29+
// Needed for springdoc to read javadocs
30+
// Ref: https://springdoc.org/#javadoc-support
31+
implementation 'com.github.therapi:therapi-runtime-javadoc:0.15.0'
32+
annotationProcessor 'com.github.therapi:therapi-runtime-javadoc-scribe:0.15.0'
33+
34+
2435
compileOnly 'org.projectlombok:lombok'
2536
annotationProcessor 'org.projectlombok:lombok'
2637
testImplementation 'org.springframework.boot:spring-boot-starter-test'
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
### OPEN API Docs in JSON format
2+
GET http://localhost:4000/api-docs
3+
4+
### OPEN API Docs in YAML format
5+
GET http://localhost:4000/api-docs.yaml
6+
7+
### Swagger HTML Doce
8+
GET http://localhost:4000/swagger-ui.html

j2735-2024-api/src/main/java/j2735api/ApiConfiguration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
public class ApiConfiguration {
2626
long textBufferSize;
2727
long uperBufferSize;
28+
long errorBufferSize;
2829
String libraryPath;
2930
String windowsLibraryPath;
3031
}

0 commit comments

Comments
 (0)