Parses a folder of .java files into appropriate .hx externs!
This generator is typically not necessary. The compiler argument --java-lib-extern <jar-file> will allow you to compile your code with full type checking.
This generator is useful if you need to create a library of extern classes which you can modify and apply macros to. It also allows you to add HaxeDocs and typedefs for ease of use.
Given:
- a folder of
.javafiles in./source-folder/ - a set of packages to parse
net.package.a,net.package.b - a set of jar files for the
.javadependencies - a desired output folder at
./output-folder/(optional, defualt is printing to console)
Usage is simple:
java -jar java-haxe-extern-creator.jar -source ./source-folder/ -output ./output-folder/ --packages net.package.a:net.package.b -classpath ./1.jar;./2.jarThis will create matching Haxe externs in (output-dir) for each Java class in the specified packages, looking in (source-dir).
The result will be structured based on the class hierarchy of the Java files. The result will include proper types, and proper HaxeDox (converted from JavaDox).
If output directory is not specified, output will be displayed in the console.
Before utilizing the generated Haxe externs, check for any instances of ~~~ in the output; these represent an unhandled case. Report these in the Issues tab on the Github page.
- Fix
Null<@org.jetbrains.annotations.Nullable Type> - Resolve unknown modifier:
protected - Resolve unknown modifier:
abstract - Fix bare javadoc comment (ArmorItem#getSlot)
- Fix javadoc comment with @code (Potion#byName)
- Fix javadoc comment with param and return (Potion#byName)
- Resolve element:
interface - Resolve element:
enum - Resolve type: Wildcard (
?) - Resolve all documentation
- Resolve element:
record - [] Resolve element:
annotation_type