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
287 stars 122 forks source link

Unable to use 4.0 in precompiled script plugin #711

Closed vpavic closed 4 months ago

vpavic commented 10 months ago

We're using org.asciidoctor:asciidoctor-gradle-jvm-pdf in a (very simple) precompiled script plugin written in Kotlin.

After attempting to upgrade the plugin to 4.0.1 the build fails with the following error:

$ ./gradlew asciidoctorPdf

> Task :plugins:compileKotlin FAILED
e: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
    class org.asciidoctor.gradle.jvm.pdf.AsciidoctorPdfTask, unresolved supertypes: org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask
    class org.asciidoctor.gradle.jvm.pdf.AsciidoctorPdfThemesExtension, unresolved supertypes: org.asciidoctor.gradle.base.AbstractDownloadableComponent
Adding -Xextended-compiler-checks argument might provide additional information.

This setup works fine with 3.3.2.

Here's a simple reproducer: sample-asciidoctor-pdf.zip

ysb33r commented 10 months ago

QQ: If you asciidoctor-gradle-jvm to your dependencies in the included build, do you still see the same problem?

vpavic commented 10 months ago

That indeed helps, thanks.

Having taken a closer look at the project build now, shouldn't api configuration be used here (instead of implementation): https://github.com/asciidoctor/asciidoctor-gradle-plugin/blob/34f2cf13abec169ca7e4e3c0b666a3ba46848260/jvm-pdf/build.gradle#L14

ysb33r commented 10 months ago

Thanks for confirming. It has been changed for the 4.0.2 release, which hopefully should out before end of Jan '24.

I am going to close this out.

vpavic commented 10 months ago

This situation is still the same with 4.0.2, could you please re-open this?

Looking at the published POMs here, org.asciidoctor:asciidoctor-gradle-jvm dependency is still declared with the runtime scope (vs compile as it was pre-4.0).

I can see that 82d2a2bb changed the dependency configuration, but that change isn't present on master.

vpavic commented 9 months ago

Any feedback here @ysb33r?

ysb33r commented 9 months ago

I haven't had a chance to look at this.

vpavic commented 4 months ago

This was apparently resolved in 4.0.3.