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

asciidoctorGemsPrepare and --continuous #613

Open fapdash opened 3 years ago

fapdash commented 3 years ago

I've looked at configuration samples on github (https://github.com/search?q=dependsOn+asciidoctorGemsPrepare&type=code) to find out how to use asciidoctorGemsPrepare and the way to go seems to make the asciidoctor task depend on asciidoctorGemsPrepare via asciidoctor { dependsOn asciidoctorGemsPrepare }.

When using this in conjunction with the gradle --continuous mode to get continuous build updates while working on asciidoc files the additional GEMs get installed on every save action / continuous build. This changes the continuous build from taking less than a second to taking more than 5 seconds on my machine which is a really long feedback loop when making quick changes and verifying them.

Is there a way to cache the result of asciidoctorGemsPrepare so it doesn't install the gem on every build? Is there another way to solve this? Maybe letting an other task than asciidoctor depend on asciidoctorGemsPrepare?

ysb33r commented 10 months ago

In 4.0 that task will be cacheable