package-info.java is generated with the wrong package name and directory #315
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
java
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
java-gi/java-gi#315
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
While trying to generate bindings for libpanel using the
java-gicommand line tool, I found that thepackage-info.javafile path is generated using different code than the paths for other Java files.Compare
github.com/jwharm/java-gi@7732f6a765/generator/src/main/java/org/javagi/JavaGI.java (L185)to
github.com/jwharm/java-gi@7732f6a765/generator/src/main/java/org/javagi/JavaGI.java (L264)The
package-info.javaincorrectly ends up in "panel/my/package/path" (panel is the name of the gobject library) with the package name panel.my.package.path in the resulting directory/JAR, whereas the rest of the code goes to the proper directory "my/package/path".The packageName isn't passed into the generate method.
Thanks for trying out java-gi and for providing feedback!
I tried to reproduce the issue but I don't see anything wrong.
The command:
results in the following generated files:
Did you expect
package-info.javato be in another location?I really appreciate you taking a look. You're right. My issue was that I had set
--outputto a Maven variable${generatedOutputDir}and then added${generatedOutputDir}as a source root in Maven. But java-gi creates a subdirectorypanelso it can store the generated source for each module separately. All I had to do was add${generatedOutputDir}/panelas a source root instead. For some reason it still partially worked when I configured it the wrong way in Maven, but only for the classes, and not the package-info. Funny! Thanks so much for the reply. This is really an awesome software project!