asciidoctor / asciidoctor-gradle-plugin

A Gradle plugin that uses Asciidoctor via JRuby to process AsciiDoc source files within the project.
https://asciidoctor.github.io/asciidoctor-gradle-plugin/
Apache License 2.0
286 stars 122 forks source link

Compatibility with Gradle 8.0 #602

Closed rieske closed 1 year ago

rieske commented 3 years ago

Gradle 7.1 will deprecate JavaExec.main for removal in Gradle 8.0. The replacement property to use is mainClass (available since Gradle 6.4).

The deprecated method is used by the plugin here: https://github.com/asciidoctor/asciidoctor-gradle-plugin/blob/34837b18609821bd85c239453a3111d13c1e0d0a/jvm/src/main/groovy/org/asciidoctor/gradle/jvm/AbstractAsciidoctorTask.groovy#L582

jannis-baratheon commented 3 years ago

i think I might have some time later today to try and fix this.

jannis-baratheon commented 3 years ago

Which branch should I base the fix against? development-3.x? And another question: do I need to add a test for the deprecation message? Or is there a plan to handle deprecation-warning tests globally somehow?

ysb33r commented 3 years ago

Which branch should I base the fix against? development-3.x? And another question: do I need to add a test for the deprecation message? Or is there a plan to handle deprecation-warning tests globally somehow?

development-3.x please.

As for the test, gradleTest should pick up the deprecation message and fail compatibility testing. CHeck first whether gradleTest.deprecationMessagesAreFailures = true is set in the build. If it does not then turn it on. If it is set and it does not detect the failure then it is a bug in that plugin and rather raise the issue against https://gitlab.com/ysb33rOrg/gradleTest/-/issues

wilkinsona commented 3 years ago

I'm in the process of upgrading Spring Boot's build to Gradle 7.2 and trying to get it free of deprecation warnings. To that end, I'm interested in contributing a fix for this. I've started taking a look and have learned that gradleTest is missing some deprecation warnings as @ysb33r suspected. I've opened https://gitlab.com/ysb33rOrg/gradleTest/-/issues/128.

jannis-baratheon commented 3 years ago

Oh. Kinda forgot about this. Let me stand next in line after you @wilkinsona. I've got no spare time for now and currently it's not a blocker for me.

thecodesmith commented 2 years ago

I am also interested in this fix and took a look at the source code. It appears more complicated than just updating the JavaExec.main reference, as the Gradle API version will need to be updated as well, from my understanding. But that will break backward compatibility. If you maintainers have some direction you prefer, I can take a shot at making the updates.

wilkinsona commented 2 years ago

To be able to add tests as part of fixing this, a release of https://gitlab.com/ysb33rOrg/gradleTest that contains the fix for issue 128 is required.

ysb33r commented 1 year ago

And that requires Grolifant 2.0 to get out, which is nearly there...

On 13/01/2022 03:26, Andy Wilkinson wrote:

To be able to add tests as part of fixing this, a release of https://gitlab.com/ysb33rOrg/gradleTest that contains the fix for issue 128 https://gitlab.com/ysb33rOrg/gradleTest/-/issues/128 is required.

— Reply to this email directly, view it on GitHub https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues/602#issuecomment-1011906110, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG5S2HNOY53CLZCA7TZBQLUV2EETANCNFSM44CKRPTQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

-- Schalk W. Cronjé Twitter / Ello: @ysb33r

ysb33r commented 1 year ago

Please try 4.0.0-alpha.1 and tell me if the problem still exists

marcphilipp commented 1 year ago

Tested successfully with the JUnit 5 build: https://github.com/junit-team/junit5/pull/3121