如何配置asciidoctor-gradle-plugin处理plantuml?

And*_*dyJ 5 ruby gradle plantuml asciidoctor

我不知道任何Ruby,但我喜欢asciidoctor(和gradle插件)。有没有一种简单的方法来使插件生成Plantuml图?

我查看了基本的asciidoctor-diagrams功能,该功能似乎特定于使用本机/红宝石asciidoctor扩展(我没有,并且因为我喜欢使用gradle插件而不想安装)。

做得很好的asciidoctor-gradle-plugin文档页面显示,它接受requiresRuby模块的选项,但是在Ruby中没有任何基础,我不确定这是否是我需要的。

我尝试了阻力最小的路径,即:

asciidoctor {
    logDocuments = true
    separateOutputDirs = false
    sourceDir = file("src")
    outputDir = file("$buildDir/html")
    backends = [ 'html5' ]
    requires "asciidoctor-diagram"
}
Run Code Online (Sandbox Code Playgroud)

针对我的基本plantuml测试:

.The PlantUML block extension class
[plantuml, sample-plantuml-diagram, alt="Class diagram", width=135, height=118]
----
class BlockProcessor
class PlantUmlBlock
BlockProcessor <|-- PlantUmlBlock
----
Run Code Online (Sandbox Code Playgroud)

但是得到了:

* What went wrong:
Execution failed for task ':asciidoctor'.
> (LoadError) no such file to load -- asciidoctor-diagram
Run Code Online (Sandbox Code Playgroud)

在配置阶段。

如何配置asciidoctor-gradle-plugin以处理植物?

And*_*dyJ 1

姆哈基来救援。 我不想完全抄袭他的帖子,但万一链接变坏,gradle 文件中还需要满足许多其他依赖项,我没有的第一个依赖项是com.github.jruby-gradle:jruby-gradle-plugin:0.1.5他应用了两个插件包括com.github.jruby-gradle.base并依赖 ruby​​ gems ( rubygems:asciidoctor-diagram:1.2.0)。我认为他的博客网站非常可靠,所以我不会详细介绍。