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
285 stars 120 forks source link

Can not run under Gradle 7.4.2 #649

Closed life888888 closed 1 year ago

life888888 commented 1 year ago

https://github.com/asciidoctor/asciidoctor-gradle-examples/tree/master/asciidoc-to-pdf-example

OK - ./gradlew asciidoctor

FAIL - gradle asciidoctor

gradle -v -> Gradle 7.4.2

> Task :asciidoctorPdf FAILED

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':asciidoctorPdf' (type 'AsciidoctorPdfTask').
  - In plugin 'org.asciidoctor.jvm.pdf' type 'org.asciidoctor.gradle.jvm.pdf.AsciidoctorPdfTask' property 'fontsDir' is missing an input or output annotation.

    Reason: A property without annotation isn't considered during up-to-date checking.

    Possible solutions:
      1. Add an input or output annotation.
      2. Mark it as @Internal.

    Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#missing_annotation for more details about this problem.

asciidoctor-gradle-plugin-master/jvm-pdf/src/main/groovy/org/asciidoctor/gradle/jvm/pdf/AsciidoctorPdfTask.groovy

    @Deprecated
    @ReplacedBy('getFontsDirs')
    File getFontsDir() {
        if (this.fontDirs.size() > 1) {
            throw new PdfFontDirException('There is more than 1 file in the fonts directory')
        }
        if (this.fontDirs.empty) {
            throw new PdfFontDirException('No directory is specified')
        }
        this.project.file(this.fontDirs.first())
    }

    @InputFiles
    @PathSensitive(PathSensitivity.RELATIVE)
    @Optional
    FileCollection getFontsDirs() {
        this.project.files(this.fontDirs)
    }

maybe add @Internal will solve ?

    @Internal
    @Deprecated
    @ReplacedBy('getFontsDirs')
    File getFontsDir() {
life888888 commented 1 year ago

My Fault, Change version 3.3.0 to 3.3.2

Can use Gradle 7.x

plugins {
  id "org.asciidoctor.jvm.pdf" version "3.3.2"
  id "org.asciidoctor.jvm.gems" version "3.3.2"
}