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

5th
Sep 2014
R. Tyler Croy
@rtyler
Sep 05 2014 05:37
@ysb33r ive got some localized changes that have to go into base and jar
Will try to get pushed uo tomorrow morning then we'll have a working jar plugin
Schalk W. Cronjé
@ysb33r
Sep 05 2014 12:18
sure. thanks for the fixes
BTW look at asciidoctor/asciidoctorj#198. Should we do the same for base?
R. Tyler Croy
@rtyler
Sep 05 2014 12:29
@ysb33r 2.0 mode in JRuby 1.7 isn't fully mature
Schalk W. Cronjé
@ysb33r
Sep 05 2014 12:31
Should we give the option for people who would want to use it?
R. Tyler Croy
@rtyler
Sep 05 2014 12:32
IMO no
it's not even something I'm sure is totally functional
JRuby never supported 2.0 mode in 1.7
Schalk W. Cronjé
@ysb33r
Sep 05 2014 12:34
I don’t know enough about the matter to argue
rtyler @rtyler nods
R. Tyler Croy
@rtyler
Sep 05 2014 12:35
I just woke up from an on-call page, let me deal with that and then i'll get my changes pushesd
Schalk W. Cronjé
@ysb33r
Sep 05 2014 12:35
Yah, I wondered why you woke up at an unsociable hour :P
Schalk W. Cronjé
@ysb33r
Sep 05 2014 12:50
According to @mojavelinux "JRuby now supports this as of JRuby 1.7.5".
R. Tyler Croy
@rtyler
Sep 05 2014 12:50
@ysb33r pushed some of my changes, just switching around the artifact for warbler-bootstrap
I'll see if I can find the documentation about 2.0 mode
since all I've got is based on a a @headius presentation right now
R. Tyler Croy
@rtyler
Sep 05 2014 13:07
@ysb33r well, executable jars aren't working
rror: java.lang.ClassNotFoundException: org.jruby.embed.ScriptingContainer
it looks like the jar was packaged up mostly correctly though!
META-INF should contain a lib folder with jruby complete jars
Schalk W. Cronjé
@ysb33r
Sep 05 2014 13:13
Right, so Building a Jar test in JRubyJarPluginSpec needs extending to cover those cases
rtyler @rtyler nods
Schalk W. Cronjé
@ysb33r
Sep 05 2014 13:14
but…
unlike WARs, we do not unnecessarily pack JARs with more JARs.
we usually create a dependency via the maven POM
R. Tyler Croy
@rtyler
Sep 05 2014 13:15
creating a library jar is something I'm less familiar with how that will all hook up with jruby
@ysb33r this is an executable .jar that I built with warbler FWIW
Schalk W. Cronjé
@ysb33r
Sep 05 2014 13:16
thanks that might just be the example I’m looking for.
It might be a simpler test than trying to work with the more complex asciidoctorj jar
R. Tyler Croy
@rtyler
Sep 05 2014 13:17
I'm quite unsure what the right way to create a JRuby-based library jar might be
heh
I can probably come up with a demo-jar repository under @jruby-gradle too
Schalk W. Cronjé
@ysb33r
Sep 05 2014 13:18
that could be useful. I am just gong to play with your jar to see if it will work for me
What we seem to be missing is a main.rb/init.rb in META-INF?
R. Tyler Croy
@rtyler
Sep 05 2014 13:20
I have a init.rb
no META-INF/lib though
let me commit my WIP changes
for blick, then you can check that out
Schalk W. Cronjé
@ysb33r
Sep 05 2014 13:21
sure
R. Tyler Croy
@rtyler
Sep 05 2014 13:21
here's running the warbled jar: https://gist.github.com/rtyler/949eba6a4e5655215807
and pushed my gradle chnages up here: https://github.com/rtyler/blick
Schalk W. Cronjé
@ysb33r
Sep 05 2014 13:23
great I can play with that
R. Tyler Croy
@rtyler
Sep 05 2014 13:24
i'll work on a demo jar project right after my morning chores :)
Schalk W. Cronjé
@ysb33r
Sep 05 2014 13:24
having that and asciidoctorj and two different jruby jars I can play and test so ensure that the plugin will create both correctly
R. Tyler Croy
@rtyler
Sep 05 2014 13:24
is asciidoctor going to be executable? or is it more of a library-jar?
Schalk W. Cronjé
@ysb33r
Sep 05 2014 13:29
both. Firstly there is just the asciidoctorj jar for now, but it is already executable - they ran their own way of doing it. Secondly there is discussion on making it a tar/zip, so that it can be a unpacked as standalone app. The latter does not require it to be executable
however on the former @mojavelinux did express the nice-to-have to simplify it with warbler
Schalk W. Cronjé
@ysb33r
Sep 05 2014 13:36
@rtyler Did you have to code main.rb & init.rb by hand for blick?
R. Tyler Croy
@rtyler
Sep 05 2014 13:37
everything to build those jars is in the repo
R. Tyler Croy
@rtyler
Sep 05 2014 13:48
crap, now I'm late for my bus
bbiab
Schalk W. Cronjé
@ysb33r
Sep 05 2014 13:54
I could be totaly on the wrong track here. I am thinking like someone who is used to building jars in the ‘java+gradle’ way. In my mind I was distinguishing between a plain jar (with some ruby stuff) and a fat jar (which contains all of the dependencies).
I suspect I am mostly think about the first, whilst you have the second in mind
R. Tyler Croy
@rtyler
Sep 05 2014 14:03
indeed!
the plain jar, in your words, I think will actually be a lot harder in JRuby
since require in Ruby will load a jar, but I'm not sure it will load in the .rb files by default
building a "far jar" just requires constructing the archive correctly, I fear that the plain jar requires more than just build time work
but I've not validated that assumption
Schalk W. Cronjé
@ysb33r
Sep 05 2014 14:05
I have confused myself with all of this and asking myself the question: Is it even possible to build an executable jar that is dependent on external JARs?
R. Tyler Croy
@rtyler
Sep 05 2014 14:05
it is!
but then your classpath has to contain those jars
an executable jar is only unique in that it has a MainClass attribute in the manifest
so there's executable fat and executable plain jars
{executable,library} + {plain,fat} jars, so many possibilities! ;)
Schalk W. Cronjé
@ysb33r
Sep 05 2014 14:14
Checkpoint: I was validating the assumption on asciidoctorj (not the one I have built) and even-though it has a Main-Class attribute, it fails to execute via -jar
even with all the external dependencies specified via -cp
however if I remove -jar asciidoctorj… and add it to the class path, supplying the Main-Class on the command-line it works
R. Tyler Croy
@rtyler
Sep 05 2014 14:16
got a gist example?
Schalk W. Cronjé
@ysb33r
Sep 05 2014 14:16
I’ll gist it quickly
aha!
Schalk W. Cronjé
@ysb33r
Sep 05 2014 14:21
asciidoctorj specifies a Class-Path, but never bundles the JARs
that is why it’s not working
however, that does not tell me whether it is possible to build a exec jar and specify extra dependencies via -cp
Schalk W. Cronjé
@ysb33r
Sep 05 2014 14:40
So according to man java : When you use this option, the JAR file is the source of all user classes, and other user class path settings are ignored.
R. Tyler Croy
@rtyler
Sep 05 2014 14:43
the -cp command?
Schalk W. Cronjé
@ysb33r
Sep 05 2014 14:43
java -cp
rtyler @rtyler nods
Schalk W. Cronjé
@ysb33r
Sep 05 2014 14:48
So I think… One facility to just build the jar with its jruby deps - pretty much is what the plugin does now. Plus one facility to build a fatJar.
Schalk W. Cronjé
@ysb33r
Sep 05 2014 15:00
maybe simply adding defaultMainClass(), mainClass ‘foo’ should invoke additional behaviour of packing all dependencies to lib/ asn setting the Class-Path attribute
This just leaves having to pack init.rb etc. (we already have the GEMs).
rtyler @rtyler nods
R. Tyler Croy
@rtyler
Sep 05 2014 15:11
I'll try to be as helpful as I can today, but I'm already in a pretty sour mood because of that page at 5:30am
rtyler @rtyler tries his best to be nice
Schalk W. Cronjé
@ysb33r
Sep 05 2014 15:12
It’s OK. I have sympathy.
R. Tyler Croy
@rtyler
Sep 05 2014 15:12
heh
Schalk W. Cronjé
@ysb33r
Sep 05 2014 15:13
sympathy with call outs. I had 4pm calls in the past as well. And I had the lovely task of calling people up when it was 4pm in their TZ too.
This message was deleted
This message was deleted
Schalk W. Cronjé
@ysb33r
Sep 05 2014 15:17
There you go, better than the one I was going to paste
R. Tyler Croy
@rtyler
Sep 05 2014 15:17
heh
Schalk W. Cronjé
@ysb33r
Sep 05 2014 15:18
the gorilla pic ...
gorilla face
R. Tyler Croy
@rtyler
Sep 05 2014 15:18
heh
Schalk W. Cronjé
@ysb33r
Sep 05 2014 15:31
Mmmm. we used to use jrubyEmbeds for something, but now I cannot track down for waht
R. Tyler Croy
@rtyler
Sep 05 2014 15:32
warbler-bootstrap?
for expanding the JarMain.class into the archive
Schalk W. Cronjé
@ysb33r
Sep 05 2014 15:32
that’s the one, thanks
so what I maybe need is a jrubyJar config similar to jrubyWar
R. Tyler Croy
@rtyler
Sep 05 2014 15:33
I don't think that's a bad idea
Schalk W. Cronjé
@ysb33r
Sep 05 2014 16:06
I might get something done over the weekend, however ….
this is the start of the pro rugby season this weekend, of which I am a big fan.
R. Tyler Croy
@rtyler
Sep 05 2014 16:08
hahaha
noted
Schalk W. Cronjé
@ysb33r
Sep 05 2014 23:18
Ha, solved most of it. Just left with init.rb