RaidAndFade / javadoc-json-doclet

Json Doclet for Javadoc (Turn things into json. Fully fleged using Gson)
MIT License
10 stars 8 forks source link

Updated alternatives to this project? #4

Closed Andre601 closed 5 months ago

Andre601 commented 1 year ago

Hey.

Not sure if you still maintain it (or give help on it), but I currently was wondering, if there is a updated version of a doclet like this?

The reason I ask is, that I tried to use yours, but since Java 13 is the com.sun.javadoc API no longer supported. I would love to use a doclet or something similar to this to generate JSON from my Javadocs to use...

IoIxD commented 7 months ago

as of the time i am seeing this, the answer is "downgrade to java 11"

Andre601 commented 7 months ago

Not really a solution tho.

IoIxD commented 5 months ago

Somebody finally found an updated one!

https://github.com/ScaCap/spring-auto-restdocs/tree/master/spring-auto-restdocs-json-doclet-jdk9

Andre601 commented 5 months ago

Well, "Updated"... If you ignore the fact this repository is archived.

Andre601 commented 5 months ago

Additionally, this seems to be specifically for Spring and not just Java itself? Unless I'm missing something.

RaidAndFade commented 5 months ago

Hello.

I have not used this package in years, so obviously I have no personal reasons to refactor this to support the new jdk.java.javadoc API.

Looking over the code quickly, I see that pretty much every part of sun.javadoc has an equivalent (or a replacement) in jdk.java.javadoc. I encourage anyone who wants to see this package work in modern JDK to look at https://docs.oracle.com/en/java/javase/11/docs/api/jdk.javadoc/jdk/javadoc/doclet/package-summary.html docs and see if it's feasible to just replace the sun.javadoc types to their new javax element alternatives, i don't see why that wouldn't work, it seems most types I used have a 1:1 replacement type.

This seems like a fairly easy PR, if you truly need this package, get it working and I'll gladly merge it here on a new JDK12+ branch

Andre601 commented 5 months ago

One major I can already see is the fact that this repository lacks a lot of major files required to even setup a proper environment to build the final jar in, such as a pom.xml or build.gradle.

This makes it extremely difficult to work with, and making one from scratch would probs be an easier task in the end...

RaidAndFade commented 5 months ago

It's a single file using two jar imports. i dont think I even made it in an IDE.... 😆

Andre601 commented 5 months ago

That is noticable. Also your statement that most can just have its imports replaced isn't really true either, because while there are alternatives listed, the code itself becomes not really compatible.

One example is the first line of your start method: There RootDoc is now DocletEnvironment and ClassDoc is now TypeElement. The main issue comes with getting a collection of these elements. DocletEnvironment has methods to get sets, but the issue here is that these are sets of ? extends Element, making it not possible to use Set<TypeElement>. And that's just the first line.

That's why I asked if there are updated alternatives to this one here, as this one is clearly not easy to be updated at all... Not to mention would just converting it as-is result in a doclet that doesn't follow certain standards established (i.e. now requiring to implement a interface to include specific methods for options and alike).

RaidAndFade commented 5 months ago

Looking at it again, I can see .idea and going through those files shows that there is IDE support for intelliJ, as well as build files to setup your jar artifact

Im going go ahead and close this issue for now since it's been a year of just complaints and "it wont be possible". I encourage anyone who needs this tool to work on it, I don't have any way to test since I don't work with Java projects as much anymore.

Open source works on the basis of small improvements in a codebase that reach goals over time, not on people who ask for features with no intent to make them happen. This library is a 200 line long Java file, designed to generate docs for Java projects... Anyone who uses it can certainly code Java. Even making it "from scratch" would be a single day of work for any seasoned developer.

IoIxD commented 5 months ago

Should probably pin this if you're gonna close it @RaidAndFade

The Soring code did work for me, btw