-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Download Kindlegen if it can't be found #44
Comments
In the Gradle plugin for Asciidoctor we take care of this automatically, but it fails on Windows due to an issue on how kindlegen access is implemented in the GEM. |
@ysb33r Could you provide more details please? Do you have a bugreport against gradle plugin + kindlegen? We could possibly send a PR to kindlegen gem to fix that? Overall, I don't quite understand this issue. Kindlegen should not be any different from epubcheck, for example. |
IIRC the issue is that the only way to run it is to have it on the path, otherwise the GEM does not find it. Setting
The issue is described here asciidoctor/asciidoctorj#659. Ideally if the kindlegen location is passed via seom option or attribute it could also help. |
Thanks for the link, I'll try to figure out what's going on. |
It only occurs under JRuby. A good solution for us might be to only half-generate the files and then post-process them. IOW tell the GEM to only generate the files require by kindlegen, but not call it. In that way we can post-process from maven or gradle by calling kindlegen from the build tool after the GEM has generated the intermediate artifacts. |
That seems like a bad idea. We shouldn't be putting workarounds in place because of a bug. Instead, the focus should be on why it is failing. The invocation of kindlegen should be encapsulated by this converter. |
@mojavelinux Irrespective on that concern, having the ability to set the exact path to kindlegen without relying on setting an environmental variable is very useful. For instance is we run asciidoctorj inside the same JVm we cannot use an envVar. Also having access to the intermediate artifacts can be useful in certain cases. |
I don't see why we are even talking about an environment variable. The call to kindlegen should be encapsulated inside the gem. There should be no environment variable involved.
I'm not arguing against that and I can definitely see the value. |
Anyway, if we're failing to run |
I get that. I'm not advocating against the environment variable. I'm advocating against relying on it to fix a bug of kindlegen not being found.
1000% Exactly what I'm saying. If we have to download it ourselves because the kindlegen gem fails to do so (or properly), then let's just bite that bullet and do it. |
@mojavelinux while we're at it: asciidoctor/asciidoctor-gradle-examples seems to be very much abandoned. Would someone be able to review and merge PRs there if I submitted them or it is better to request commit access from you? |
I don't manage that project. I would suggest asking in the asciidoctor/asciidoctorj gitter channel. |
Okay |
I declare that this issue is a duplicate of #154. |
If Kindlegen can't be found (because the gem wasn't install or we can't install gems like in AsciidoctorJ), then download Kindlegen on demand, extract it to a temporary location and use that executable. This will allow mobi generation to work consistently everywhere and will give us control over the Kindlegen download.
The text was updated successfully, but these errors were encountered: