Open mojavelinux opened 10 years ago
We don't have to use Warbler specifically. We can just do whatever Warbler does to delegate to the cli class provided by the gem.
I wonder how a user would register their own processors, converters etc if we don't explicitly run the code to load these extensions via the ServiceLoader anymore? Wouldn't it be painful if the writer of an extension in Java would have to write their own Ruby code to load Asciidoctor and register their Java extension?
Currently, the cli in AsciidoctorJ is custom built using jcommander. I think we should look into Warbler (https://github.com/jruby/warbler) to create a simple wrapper around the Asciidoctor command-line so that we don't have to maintain a separate command-line implementation in AsciidoctorJ.
NOTE: Perhaps the JRuby Gradle plugin could provide a task for creating a jar file using warbler.
To try out warbler, just follow these steps:
You should see output similar to:
All we need to do is get whatever class Warbler is putting into that jar file into AsciidoctorJ and we've got it! No extra jars!!
https://github.com/jruby/warbler/blob/master/ext/JarMain.java