These are chat archives for jruby-gradle/jruby-gradle-plugin

15th
Mar 2016
wenhoujx
@wenhoujx
Mar 15 2016 14:14
@mkristian did you get a chance to take a look at the example ?
wenhoujx
@wenhoujx
Mar 15 2016 14:59
thanks, checking it out
:)
wenhoujx
@wenhoujx
Mar 15 2016 15:38
what do i need to change if i want include jruby-complete in the jar as well? I tried to change compile to jrubyJar, but it doesn't seem to work .
Christian Meier
@mkristian
Mar 15 2016 15:40
is this what you really want. any java library does have dependencies to other libraries - usually. so this one has a dependency to jruby
for executing the commandline I needed some jruby on the classpath and here jruby-complete.jar is the easiest way to do so
if you want to embed jruby inside the jar switch from library() to runnable() and use the condig mainClass 'Main' to set a different main class then the default
the jars from the jrubyJar config are the ones which require 'jars/setup' will load inside the app.rb file, i.e. they are the dependencies for the ruby application. the compile jars are the dependency for the java application.
wenhoujx
@wenhoujx
Mar 15 2016 15:48
thanks for explaining, I'd prefer to handle the jruby-complete dep on my end, my client will not like to use that jar.
configurations { compile.extendsFrom jrubyJar jrubyJar.extendsFrom gems }
if i have that configurations, then can i use compile for everything ?
Christian Meier
@mkristian
Mar 15 2016 15:56
not a good idea. better keep jrubyJar and compile separated, there is otherwise a chance to run into classloader problems.
might need to add jruby-complete compile with provided scope - not sure how to do this with gradle. but I think there is a plugin for this
bbl
wenhoujx
@wenhoujx
Mar 15 2016 16:15
why do i need to add jruby-complete compile with a provided scope ?
Christian Meier
@mkristian
Mar 15 2016 19:21
setting initScript runnable() will include/shades the jruby-complete jar into you jar. so jruby-complete is a compile time only dependency, as the runtime will get has it already.
wenhoujx
@wenhoujx
Mar 15 2016 21:15
@mkristian oh, i see, thanks for explaining.
thanks for your help, I was finally able to pack ruby together with java into a library jar. This plugin is a life-saver !!