-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fix double annotations in javadocs #9682
Conversation
Here's a link to my fix-javadoc-plugin: https://github.com/mfnalex/gradle-fix-javadoc-plugin I'm currently waiting to get it approved for the gradle plugin portal - until then, it'll only be available in my own repository. |
depending on a 3rd party repo is pretty much a no-go as for the intent of this PR, I mean, post cleanup is nice, not something I personally care about enough to introduce a plugin and such for |
As said, I'm waiting to get it approved in the gradlePluginPortal(). I could also PR the whole plugin into the paper repo instead? It's basically just one .kt class in buildSrc |
Imho there's 5 solutions:
Please let me know if you're interested in adding this at all, because if not, I don't have to waste time into getting it approved for the plugin portal and/or uploading it to maven central |
I like this on principle, but is using regex really the best approach here? Also, I guess ideally it would be fixed in the javadoc generator, anybody ever tried to chase that down? |
I know that regex isn‘t the best solution, I only wrote this for myself and it seemed to work just fine. I didn‘t dare to take a look at the actual javadoc generation code lol |
JDK-8175533 and JDK-8278592 are the only references i can find with any info.
|
I don't think the bug is going to be fixed in the javadoc tool anytime soon. I meanwhile did some improvements to the fix-javadoc-plugin. It doesn't just throw regex over the whole html file but instead parses only the relevant stuff using Jsoup. I have let it generate the full paper API docs and uploaded them here (EDIT: See my reply below), in case anyone is bored feel free to check them out and let me know if you can find any issues (like e.g. still duplicated annotations, or maybe even missing correct annotations or anything). As mentioned, I'd be happy to either pull request the whole plugin directly into the paper repo, or alternatively upload the plugin into the papermc repository if anyone would like that - the current docs are a pain to look at. |
I noticed that by default, the annotations in method parameters appear on separate lines (at least that's what happens when using annotations-java5), so I made that configurable in the task (with newlines being the default). In case anyone wants to take a look at the fixed paper docs: |
Version 1.19 of the plugin is available in gradlePluginPortal(), so no separate repository is required anymore. |
Any news on this? If there's still something that needs changes before being able to merge, I'd be happy to hear them. |
We've generally decided not to go forward with this change, there is generally little interest in pulling in 3rd party build tooling in order to fix what really amounts to an aesthetical grievance which generally has 0 side effects |
Hi, this pull requests adds the fix-javadoc-plugin to the "root" build file. It automatically adds a "finalizedBy" task for each task of the Javadoc type to get rid of the annoying "double annotations".
Before:
![image](https://private-user-images.githubusercontent.com/1122571/265239120-b89576a1-9eb0-4145-8d98-6dbc4d65c5b0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5MTY1NTksIm5iZiI6MTczOTkxNjI1OSwicGF0aCI6Ii8xMTIyNTcxLzI2NTIzOTEyMC1iODk1NzZhMS05ZWIwLTQxNDUtOGQ5OC02ZGJjNGQ2NWM1YjAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMThUMjIwNDE5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTFhYjNiNWI1NTFiZmUyNzQ3M2U3NzYzZDU1NTk2NjAxNWQ2MmQ5NjI0NDMyYTk3OWNiMGQ4NDM1YzY1YTVjMiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.MCpkWbYxe6IFWyc6dGhy0nEuQmVXMdKzxf4DwCK0sl8)
After:
![image](https://private-user-images.githubusercontent.com/1122571/265239134-faec3671-e3f4-4d51-ba38-82454df0a7d8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTU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