Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Mar 3, 2023

Conversation

chuckatkins
Copy link
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>
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