Add spec.platform to .gemspec if on JRuby #17
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks for merging the other pull-request!
Of course, it doesn't work simply like that, because of these:
phatworx/easy_captcha#30
rubygems/rubygems#1662 (comment)
I couldn't have caught this as this doesn't happen during development, only after a gem is released.
In short - this means that you have to build a
Java
specific version of the gem because the.gemspec
file is evaluated only at gem-build-time. You're building it (I guess) withgem build dotdiff
which builds it with aRUBY_PLATFORM
which is notjava
and that's it - the gem will then requirermagick
and notrmagick4j
. I read in a bunch of places and the easiest way to "fix" this is to create a java-specific gem.With this pull-request, doing a
gem build dotdiff
does what it did before (i.e. it outputs adotdiff-2.0.1.gem
file) but doing ajruby -S gem build dotdiff
outputs adotdiff-2.0.1-java.gem
file. Unfortunately I'm unfamiliar with publishing gems so you'll have to test this - I'm not sure whether the gem also has to have a different name (something like:spec.name = "dotdiff" + (is_java ? '-java' : '')
) or the fact that-java
is automatically added to the version number is enough.Thanks!