I’m currently experimenting with the new software model in the Asciidoctor Gradle plugin. Asciidoctor projects are, in large part, easy to model with the component-binary-sourceset structure. The bit I’m unsure about is the binaries.
Each Asciidoctor project can be processed into different output formats, such as HTML, Docbook and PDF. It seems like these output formats should be modelled as different types of BinarySpec
and I can work out how to set up these core binaries via a @ComponentBinaries
rule. I’m just having trouble with a couple of aspects:
-
Can a user specify which binary types to output for a given component in the model DSL? For example, they may just want the HTML output without PDF or Docbook.
-
Can a user specify a custom (i.e. non-core) binary spec for a component in the model DSL? I’ve seen examples of configuring custom components and source sets, but nothing that shows custom binaries.
I understand that I could generate tasks for all combinations of component and binary, leaving it up to the user to control which tasks they run, but then they have to mess around with task dependencies. Shouldn’t the output formats for a component be part of the model specification?