Skip to content
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

Upgrade to JDK 21 and Gradle 8.11 (WIP) - Close #1 #2

Merged

Conversation

manoelcampos
Copy link
Collaborator

@manoelcampos manoelcampos commented Dec 12, 2024

Hello @manticore-projects,

I've realized it will require a huge effort to make this work. But I'll try.
Definitely I'd appreciate some help if you have availability.
I've worked with the Doclet API in JDK 8 and it has completely changed since then.
I'm following this limited official migration guide, but I need to find some references. The Parser and XmlDoclet.java classes are not compiling yet.

The old Gradle version doesn't work with JDK 21 and I had to update and make lots of changes.
Gradle configuration has changed a lot too. The build.gradle file is mostly correct (there are some warnings in IntelliJ yet).

I've never header of this JAXB XJC (JAXB Binding Compiler) and it was using very old dependencies (from com.sun package). I could update it too.

I realized this XJC lib generates some Java code (which is configured in the jaxb2 { xjc } entry).
But it's not working with the current JDK/Gradle version. It seems to require a plugin.
I added the com.github.gradlecommunity.jaxb2 but this one is not working with JDK 21/Gradle 8 either, as reported here.

The JAX-B has been removed from the JDK so now we need to add it as a dependency, as I did.

I'll keep trying to make this work and any help is much appreciated.
Thanks in advance.

Close #1

Signed-off-by: Manoel Campos <[email protected]>
Signed-off-by: Manoel Campos <[email protected]>
Signed-off-by: Manoel Campos <[email protected]>
Moves getVersion() implementation to /buildSrc/main/groovy/CustomVersionTask.groovy
and updates build.gradle to use the new way to run a custom task.

Moving the function implementation makes the build.gradle simpler.

Signed-off-by: Manoel Campos <[email protected]>
/.gradle and /build were not ignoring directories named .gradle and build, respectively.

Signed-off-by: Manoel Campos <[email protected]>
Signed-off-by: Manoel Campos <[email protected]>
Signed-off-by: Manoel Campos <[email protected]>
@manoelcampos manoelcampos marked this pull request as draft December 12, 2024 19:13
@manoelcampos manoelcampos changed the title Upgrade to JDK 21 and Gradle 8.11 (WIP) Upgrade to JDK 21 and Gradle 8.11 (WIP) - Close #1 Dec 12, 2024
Signed-off-by: Manoel Campos <[email protected]>
The println was intended to show the name of a
build.gradle property that is not configured.
To show the property name without escaping,
we just need to print the message using single quotes.
This way, ${project.name} is not recognized as
a variable inside the quotes.

Signed-off-by: Manoel Campos <[email protected]>
that works with JDK 21 and generates Java files from XSD files.
Introduces SupportedOptions class.

Signed-off-by: Manoel Campos <[email protected]>
…impledata/.svn

This is just garbage from the ancient SVN version control system.
files at src/**/*.java, ignoring
java files generated at the /build dir

Signed-off-by: Manoel Campos <[email protected]>
Signed-off-by: Manoel Campos <[email protected]>
@manoelcampos
Copy link
Collaborator Author

manoelcampos commented Jan 3, 2025

Main updates so far (still WIP)

  • The project is now building and the XmlDoclet and Parser classes were updated to use the new Doclet API. But I haven't tried to use the XmlDoclet and it may not work yet.
  • The jaxb2 plugin doesn't work with JDK 21 and the project seems to be abandoned. I replaced it by xsd2java-gradle-plugin, which was upgraded to JDK 21.
  • Temporarily removes tests in commit 453a9bf, because they are not compiling after JDK 21. At the end, the commit will be reverted and I will try to fix the tests.
  • Removes directory src/test/java/com/github/markusbernhardt/xmldoclet/simpledata/.svn (just SVN junk)
  • Generates the Java files from the javadoc.xsd inside the build/generated/sources dir. This way, they don't pollute the working dir.

I will continue working and keep you informed.

Signed-off-by: Manoel Campos <[email protected]>
Signed-off-by: Manoel Campos <[email protected]>
…clipse-java-google-style.xml to 140 characters.

With current high-dimension screens, 100 chars line width is too limiting.

Disables the join_lines_in_comments configuration, so that manual
breaks in comments are kept, providing more organization for documentation
and readability.

Signed-off-by: Manoel Campos <[email protected]>
Signed-off-by: Manoel Campos <[email protected]>
Signed-off-by: Manoel Campos <[email protected]>
Signed-off-by: Manoel Campos <[email protected]>
@manoelcampos
Copy link
Collaborator Author

Hey @ccschneidr, I'm wondering if you could help in this PR in any way (reviewing, testing, updating docs or any other kind of help).

@ccschneidr
Copy link

Sorry, can't invest time here. Our current solution is to stop using xml-doclet 🤷‍♂️

@manoelcampos
Copy link
Collaborator Author

manoelcampos commented Jan 6, 2025

Sorry, can't invest time here. Our current solution is to stop using xml-doclet 🤷‍♂️

No problem @ccschneidr. We'll try to make it work and let you know.

@sbwong
Copy link

sbwong commented Jan 7, 2025

Is the Maven plugin also being updated or will the existing Maven configurations be usable with the updated xml-doclet? The sh-cho version does not support Maven yet, so you're the only game in town at the moment.

Also, do you have an approximate timeline that you're driving for? No pressure, I'm just trying to plan ahead. Thanks for all your hard work!

@manoelcampos
Copy link
Collaborator Author

Is the Maven plugin also being updated or will the existing Maven configurations be usable with the updated xml-doclet?

@sbwong, I expect the maven configuration to work fine when the PR is finished, since the XmlDoclet is used with the maven-javadoc-plugin.

Also, do you have an approximate timeline that you're driving for?

I have no defined deadline since I'm working on my free time.
But I'm needing this too, so I'll try to finish ASAP.
I think the hardest part was overcome.
I'm allocation some hours one day a week to work on it.
Let's see how it goes.

@manticore-projects
Copy link
Owner

I have created a branch JDK11 to keep the old/stable version on JDK11.
I will now merge your development into master and all development shall continue on JDK21.

@manticore-projects manticore-projects marked this pull request as ready for review January 8, 2025 09:19
@manticore-projects manticore-projects merged commit 31122db into manticore-projects:master Jan 8, 2025
1 check failed
@manticore-projects
Copy link
Owner

@manoelcampos : please join this project.

I have been able to build but fail to run it, please see #3
I am investigating now.

@manoelcampos
Copy link
Collaborator Author

@manoelcampos : please join this project.

How can I join?

I have been able to build but fail to run it, please see #3 I am investigating now.

I’m a little confused. The changes were not ready, I didn’t even try to run the project and all tests were temporarily removed. However, you merged the incomplete PR anyway and opened a new issue.

@manticore-projects
Copy link
Owner

Greetings @manoelcampos

I sent you a GitHub invite.

No worries on the early merge. JDK11 is branched off and we can develop in master on JDK21.

@manticore-projects
Copy link
Owner

I am incorporating "module-info.java" as we speak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

incompatible with JDK >= 13
4 participants