B4J Question Javadoc for obfuscated libraries

yo3ggx

Active Member
Licensed User
Longtime User
Hello,

I've built a java library in Eclipse and then obfuscate it using ProGuard.
The library contains ~20 classes, from which only 2 are not obfuscated (containing functions to be called from my main app).
When I create Javadoc, all public functions are included, not only the ones from the un-obfuscated classes.
Of course I can edit manually the resulted XML file to remove unwanted classes, but there is any way to generate Javadoc only for the classes containing the lines @BA.ShortName(...) and @BA.Version(,,,) ?

Thank you.
 

MicroDrie

Well-Known Member
Licensed User
Try first to use the @Hide custom tag used in Android platform's javadoc to hide methods and classes from the generated API documentation.

Update: don't forget this import in each class:
Hide import:
import anywheresoftware.b4a.BA.Hide;

If that doesn't work, there's another tricky option :rolleyes:. Install Java 1.8, then point to your B4J IDE to use Java 8 and use the B4J compiler, fingers crossed and hope for a successful compilation and creation of the doclet xml file.

Only with Java 1.8 you get the doclet xml file, Java 11 stumbles over the creation of the Doclet xml file and with Java 14 compiling fails.

This solution does require an error-free java source. With this approach I manage to create Doclet xml files with Android API level 33 and Java jdk-1.8.3_81 for support in B4A and B4J. I myself first make the Java source error-free with and provide Doclet info in the current latest Eclipse Version: 2023-06 (4.28.0) and Build id: 20230608-1333.
.
Let us know if and how you got it working.
 
Last edited:
Upvote 0

yo3ggx

Active Member
Licensed User
Longtime User
Sorry. It was a silly question, as I can select from Eclipse GUI what classes to be used with javadoc.
Now I have in the xml file only the unobfuscated exports from the library.
Unfortunately, for an unknown reason, selection is not kept, so I have to reselect the classes each time I run javadoc from Eclipse.
I'm using Java 1.8 in Eclipse.
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
I forget to mention to let the @Hide works, you need to import anywheresoftware.b4a.BA.Hide;. Solution of post 2 updated.
 
Upvote 0

yo3ggx

Active Member
Licensed User
Longtime User
Thanks. Good to know If I want to hide for javadoc some public functions from the non-obfuscated classes.
 
Upvote 0
Top