asciidoctor / asciidoctorj-pdf

AsciidoctorJ PDF bundles the Asciidoctor PDF RubyGem (asciidoctor-pdf) so it can be loaded into the JVM using JRuby.
Apache License 2.0
36 stars 17 forks source link

Fix upstream build #33

Closed robertpanzer closed 4 years ago

robertpanzer commented 4 years ago

Kind of change

[X] Bug fix [ ] New non-breaking feature [ ] New breaking feature [ ] Documentation update [ ] Build improvement

Description

What is the goal of this pull request?

Currently the upstream build fails with this error:

Caused by: org.jruby.exceptions.RaiseException: (ENOENT) No such file or directory - uri:classloader:/gems/asciidoctor-pdf-1.5.0.beta.7/data/themes/default-theme.yml
    at org.jruby.RubyIO.read(org/jruby/RubyIO.java:3600)
    at RUBY.load_file(uri:classloader:/gems/asciidoctor-pdf-1.5.0.beta.7/lib/asciidoctor/pdf/theme_loader.rb:88)
    at RUBY.load_theme(uri:classloader:/gems/asciidoctor-pdf-1.5.0.beta.7/lib/asciidoctor/pdf/theme_loader.rb:74)
    at RUBY.load_theme(uri:classloader:/gems/asciidoctor-pdf-1.5.0.beta.7/lib/asciidoctor/pdf/converter.rb:367)
    at RUBY.init_pdf(uri:classloader:/gems/asciidoctor-pdf-1.5.0.beta.7/lib/asciidoctor/pdf/converter.rb:301)
    at RUBY.convert_document(uri:classloader:/gems/asciidoctor-pdf-1.5.0.beta.7/lib/asciidoctor/pdf/converter.rb:163)
    at RUBY.convert(uri:classloader:/gems/asciidoctor-pdf-1.5.0.beta.7/lib/asciidoctor/pdf/converter.rb:138)
    at RUBY.convert(uri:classloader:/gems/asciidoctor-1.5.8/lib/asciidoctor/document.rb:1190)
    at RUBY.convert(uri:classloader:/gems/asciidoctor-1.5.8/lib/asciidoctor.rb:1521)
    at RUBY.block in convert_file(uri:classloader:/gems/asciidoctor-1.5.8/lib/asciidoctor.rb:1595)
    at org.jruby.RubyIO.open(org/jruby/RubyIO.java:1156)
    at RUBY.convert_file(uri:classloader:/gems/asciidoctor-1.5.8/lib/asciidoctor.rb:1595)
    at RUBY.convertFile(<script>:75)

It looks like the themes are required now. This PR tries to fix that.

How does it achieve that?

It adds the directory data/themes to the jar, which was excluded previously.

Are there any alternative ways to implement this?

Not that I am aware of if that change in asciidoctor-pdf upstream is intended.

Are there any implications of this pull request? Anything a user must know?

Bundle size increased by 20Kb

Issue

If this PR fixes an open issue, please add a line of the form:

Fixes #Issue

Release notes

Please add a corresponding entry to the file CHANGELOG.adoc

robertpanzer commented 4 years ago

Upstream build on Travis passed with this change.

@mojavelinux Is it good to add the data/themes directory to the jar? I cannot remember the reason why it was excluded in the first place.

mojavelinux commented 4 years ago

It should be included, yes.

robertpanzer commented 4 years ago

Upstream tests ftw!