Skip to content

Add a --java-package-prefix option to flatc#7848

Merged
dbaileychess merged 2 commits intogoogle:masterfrom
chuckatkins:java-package-prefix
Mar 3, 2023
Merged

Add a --java-package-prefix option to flatc#7848
dbaileychess merged 2 commits intogoogle:masterfrom
chuckatkins:java-package-prefix

Conversation

@chuckatkins
Copy link
Copy Markdown
Contributor

This adds an option to flatc for a prefix to the generated package name in java.

Example:

Running

./flatc -j samples/monster.fbs

generates the following:

MyGame/Sample/Color.java
MyGame/Sample/Equipment.java
MyGame/Sample/Vec3.java
MyGame/Sample/Monster.java
MyGame/Sample/Weapon.java

each containing

package MyGame.Sample;

When using the new --java-package-prefix option, running

./flatc -j --java-package-prefix com.monsters samples/monster.fbs

generates the following:

com/monsters/MyGame/Sample/Color.java
com/monsters/MyGame/Sample/Equipment.java
com/monsters/MyGame/Sample/Vec3.java
com/monsters/MyGame/Sample/Monster.java
com/monsters/MyGame/Sample/Weapon.java

each containing

package com.monsters.MyGame.Sample;

@github-actions github-actions bot added c++ codegen Involving generating code from schema java labels Mar 1, 2023
@dbaileychess dbaileychess merged commit b90cc35 into google:master Mar 3, 2023
dbaileychess added a commit that referenced this pull request Mar 15, 2023
Co-authored-by: Derek Bailey <derekbailey@google.com>
jochenparm pushed a commit to jochenparm/flatbuffers that referenced this pull request Oct 29, 2024
Co-authored-by: Derek Bailey <derekbailey@google.com>
jochenparm pushed a commit to jochenparm/flatbuffers that referenced this pull request Oct 29, 2024
Co-authored-by: Derek Bailey <derekbailey@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ codegen Involving generating code from schema java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants