Skip to content

Commit 03cad90

Browse files
committed
feat: added java definition codegen
1 parent 7e8065e commit 03cad90

15 files changed

+763
-146
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Chat Types Merge Processing
2+
3+
on:
4+
push:
5+
branches:
6+
- feature/flareProtocolCodeGen
7+
paths:
8+
- '**/chatTypes.json'
9+
10+
jobs:
11+
process-merge:
12+
name: Process Merge with chatTypes.json changes
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Chat Types PR Validation
2+
3+
on:
4+
workflow_dispatch: # Allows manual triggering
5+
pull_request:
6+
branches:
7+
- feature/flareProtocolCodeGen
8+
paths:
9+
- 'types/codegen/schemas/chatTypes.json'
10+
11+
jobs:
12+
validate-pr:
13+
name: Validate PR with chatTypes.json changes
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '20.x'
24+
#should we cache: 'npm'
25+
26+
- name: Install dependencies
27+
working-directory: types/codegen
28+
run: npm ci
29+
30+
- name: Generate types
31+
working-directory: types/codegen
32+
run: npm run generate
33+
34+
- name: Build TypeScript
35+
working-directory: types/codegen/generated/typescript
36+
run: |
37+
npm ci
38+
npm run build
39+
40+
- name: Setup Java
41+
uses: actions/setup-java@v4
42+
with:
43+
distribution: 'temurin'
44+
java-version: '21'
45+
#should we cache: 'gradle'
46+
47+
- name: Build Java
48+
working-directory: types/codegen/generated/java
49+
run: ./gradlew build

package-lock.json

Lines changed: 11 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

types/codegen/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
generated/
2-
typescript-template-bank/
2+
typescript-template-bank

types/codegen/README.md

Whitespace-only changes.

types/codegen/custom-templates/index.mustache

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"templates": {
3+
"model.mustache": {
4+
"source_path": "java-template-bank/out/model.mustache",
5+
"target_path": "custom-templates/model.mustache",
6+
"source_hash": "496bf6c76363f2102086d2a7020ffa105ae6572e4355f0f45fa00bac1884bcf3",
7+
"target_hash": "496bf6c76363f2102086d2a7020ffa105ae6572e4355f0f45fa00bac1884bcf3",
8+
"copied_at": "2025-07-10T11:17:30.085023",
9+
"modified": true,
10+
"current_hash": "39ef4b764b19778863a9e12722f9d9de33793114d56e5fbf463234374f27d9ed"
11+
},
12+
"pojo.mustache": {
13+
"source_path": "java-template-bank/out/pojo.mustache",
14+
"target_path": "custom-templates/pojo.mustache",
15+
"source_hash": "aa28b136f03ed415f596d37c69293e3e4bb9f2b7a0ccae66f4e7ff5dbe6c5d1f",
16+
"target_hash": "aa28b136f03ed415f596d37c69293e3e4bb9f2b7a0ccae66f4e7ff5dbe6c5d1f",
17+
"copied_at": "2025-07-10T11:21:17.951238",
18+
"modified": false
19+
}
20+
},
21+
"last_updated": "2025-07-10T12:01:06.511098",
22+
"version": "1.0"
23+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{>licenseInfo}}
2+
3+
package {{package}};
4+
5+
// Selective imports for records
6+
import com.fasterxml.jackson.annotation.JsonProperty;
7+
import javax.annotation.Nullable;
8+
import javax.annotation.Nonnull;
9+
{{#imports}}
10+
import {{import}};
11+
{{/imports}}
12+
13+
{{#models}}
14+
{{#model}}
15+
{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#vendorExtensions.x-is-one-of-interface}}{{>oneof_interface}}{{/vendorExtensions.x-is-one-of-interface}}{{^vendorExtensions.x-is-one-of-interface}}{{>record}}{{/vendorExtensions.x-is-one-of-interface}}{{/isEnum}}
16+
{{/model}}
17+
{{/models}}

0 commit comments

Comments
 (0)