asciidoctor-gradle-plugin icon indicating copy to clipboard operation
asciidoctor-gradle-plugin copied to clipboard

Fatal Build Success

Open micheljung opened this issue 1 year ago • 4 comments

build.gradle.kts:

plugins {
  id("org.asciidoctor.jvm.convert") version "3.3.2"
}

src/docs/asciidoc/index.adoc:

[[index]]
include::attributes.adoc[]

src/docs/asciidoc/attributes.adoc

:doctype: book

Output:

09:12:55: Executing 'asciidoctor'...


> Task :my-project-docs:asciidoctor
include file not found: C:/foo/my-project/my-project-docs/attributes.adoc :: index.adoc :: C:/foo/my-project/my-project-docs/C:/foo/my-project/my-project-docs/src/docs/asciidoc/index.adoc:2 (uri:classloader:/gems/asciidoctor-2.0.10/lib/asciidoctor/reader.rb:preprocess_include_directive)
M�rz 28, 2023 9:12:58 VORM. uri:classloader:/gems/asciidoctor-2.0.10/lib/asciidoctor/reader.rb preprocess_include_directive
FATAL: index.adoc: line 2: include file not found: C:/foo/my-project/my-project-docs/attributes.adoc

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 3s
1 actionable task: 1 executed
09:12:58: Execution finished 'asciidoctor'.

Let's ignore that I don't get yet why it searches attributes.adoc at the wrong place, I would never expect the Gradle build to be successful in case of a FATAL error.

micheljung avatar Mar 28 '23 07:03 micheljung

FYI the error was fixed using:

tasks {
  "asciidoctor"(org.asciidoctor.gradle.jvm.AsciidoctorTask::class) {
    setBaseDir(sourceDir)
  }
}

micheljung avatar Mar 28 '23 07:03 micheljung

I stumbled into this very same error (and it took me some hours to come here, as I expected the problem to be sitting in front of the computer ...).

Unfortunately, the workaround does not work if applied literally, @micheljung. Will try to figure out how this could work.

ascheman avatar Apr 24 '24 13:04 ascheman

By chance I found that you could add baseDirFollowsSourceFile() to the asciidoctor task definition to resolve this:

...
asciidoctor {
    ...
    baseDirFollowsSourceFile()
    ...
}
...

Please provide at least some documentation about it, @mojavelinux. Thanks!

ascheman avatar Apr 24 '24 13:04 ascheman

Don't tell me to add documentation. If you want documentation added, you can step up and contribute it. This project relies on community contributions. It's not my job to handle everything.

mojavelinux avatar Apr 24 '24 19:04 mojavelinux