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

18th
May 2015
Schalk W. Cronjé
@ysb33r
May 18 2015 20:34
anything I need to look at or need to clean up?
Christian Meier
@mkristian
May 18 2015 20:38
@ysb33r yes please have a look at jruby-gradle/jruby-gradle-jar-plugin#47 - tests are passing and it should fix quite some issues from jruby-gradle/jruby-gradle-jar-plugin#43 to jruby-gradle/jruby-gradle-jar-plugin#46
Schalk W. Cronjé
@ysb33r
May 18 2015 21:01
my feeling is to merge it and then make changes to it. There are bits in there that I think can be simplified.
Christian Meier
@mkristian
May 18 2015 21:02
ok - thanx for loooking
Schalk W. Cronjé
@ysb33r
May 18 2015 21:26
If I get time during the day I might have a look
I just noticed asciidoctorj build is runnign out of memory with jrubyPrepareGems under 1.6
Christian Meier
@mkristian
May 18 2015 21:28
jruby with java-1.6 ?
does it work with java1.7 ?
Schalk W. Cronjé
@ysb33r
May 18 2015 21:33
yip - now building with 1.8 to check
R. Tyler Croy
@rtyler
May 18 2015 21:33
Java6 o_O
Schalk W. Cronjé
@ysb33r
May 18 2015 21:33
Seems to be working
I tend to build gradle plugins with 1.6.
I ran into an issue with gradleTest that even though the compatibility was set to 1.6, building it with 1.8 still caused and issue
R. Tyler Croy
@rtyler
May 18 2015 22:12
@mkristian FYI, finally getting around to looking at your most recent changes
Christian Meier
@mkristian
May 18 2015 22:13
great - hope you do find only little issues ;)
R. Tyler Croy
@rtyler
May 18 2015 22:13
if this works in my integration testing, mind if I release?
Christian Meier
@mkristian
May 18 2015 22:15
I am OK - @ysb33r had few things as I might be too strict with what is possible to configure and reconfigure
R. Tyler Croy
@rtyler
May 18 2015 22:15
should I expect this to be API compatible with the current release?
Christian Meier
@mkristian
May 18 2015 22:17
well, it does not work with shadowJar anymore. still does something with Jar task but the jrubyJar should be the same
R. Tyler Croy
@rtyler
May 18 2015 22:18
but if I define a shadowJar { } I will still be able to configurator it right?
Christian Meier
@mkristian
May 18 2015 22:18
no
R. Tyler Croy
@rtyler
May 18 2015 22:19
okay, so I'll need to make a version jump
little bigger than usual :P
Christian Meier
@mkristian
May 18 2015 22:20
maybe - there is an instanceof Jar - maybe it works - maybe not.
R. Tyler Croy
@rtyler
May 18 2015 22:21
yeah, ShadowJar is an instance of Jar I believe
quickly double-checking
huzzah!
R. Tyler Croy
@rtyler
May 18 2015 22:41
@ysb33r incorporating your gradleTest plugin while I'm at it
excited with how simple this looks :D
R. Tyler Croy
@rtyler
May 18 2015 22:47
this might be a little too heavy-weight to run as part of my TDD cycle..
rats
R. Tyler Croy
@rtyler
May 18 2015 23:10
@mkristian ping
Christian Meier
@mkristian
May 18 2015 23:10
yes
R. Tyler Croy
@rtyler
May 18 2015 23:11
oh wait, I think I may have already found my issue
I need JrubyJar
this is what happens when you don't pay attention
ETOOMANYDISTRACTIONS
Christian Meier
@mkristian
May 18 2015 23:12
:)
R. Tyler Croy
@rtyler
May 18 2015 23:16
hah, well, I definitely created a jar
" zip.vim version v27
" Browsing zipfile /home/tyler/source/github/service-artifact-gradle-plugin/examples/jruby-service/build/libs/jruby-service-1.0+8929418.jar
" Select a file with cursor and press ENTER

META-INF/
META-INF/MANIFEST.MF
com/
com/github/
com/github/jrubygradle/
com/github/jrubygradle/jar/
com/github/jrubygradle/jar/bootstrap/
com/github/jrubygradle/jar/bootstrap/JarMain.class
META-INF/init.rb
that doesn't seem right
@mkristian did you test defaultGems() inside of a JRubyJar?
that's one of the only differences i'm seeing between what I'm doing and what you have in your example you gisted me
Christian Meier
@mkristian
May 18 2015 23:17
yes, I launched laefy
R. Tyler Croy
@rtyler
May 18 2015 23:17
hrm
Christian Meier
@mkristian
May 18 2015 23:18
what is the difference ?
R. Tyler Croy
@rtyler
May 18 2015 23:18
I am defining a task of type JRubyJar
with:
jruby {
  defaultMainClass()
  defaultGems()
}
the initScript works properly
which is set later
there's also some from() statements which clearly aren't working
Christian Meier
@mkristian
May 18 2015 23:20
so far I see the initScript does not work. there shoud be no META-INF/init.rb in the jar
R. Tyler Croy
@rtyler
May 18 2015 23:21
the init.rb is the content of my initScript though
Christian Meier
@mkristian
May 18 2015 23:21
it needs to be renamed to jar-bootstrap.rb whatever you give the initScript declarative
R. Tyler Croy
@rtyler
May 18 2015 23:21
actually, false
that is my init.rb
that I have sittingaround in my repo
which should be renamed to jar-bootstrap.rb
whoopsie
Christian Meier
@mkristian
May 18 2015 23:22
so you do not set a initScript ?
R. Tyler Croy
@rtyler
May 18 2015 23:22
yeah
in this test case
Christian Meier
@mkristian
May 18 2015 23:22
in this case the whole thing should fail - that was my strictness
I talked about before.
R. Tyler Croy
@rtyler
May 18 2015 23:23
hm
Christian Meier
@mkristian
May 18 2015 23:24
does the build/dirInfo directoru exists with you ?
R. Tyler Croy
@rtyler
May 18 2015 23:25
no it does not
do I need a base plugin change locally to go with the jar plugin changes?
Christian Meier
@mkristian
May 18 2015 23:25
not really - not in this state of yours
once you have gems and jars packed you need the master build of the base plugin
R. Tyler Croy
@rtyler
May 18 2015 23:26
oh for fuck's sake, I know what this is
or at least I think I do
the JRubyJar and the default jar are both being created
I need to disable the jar task

```➜ jruby-service git:(master) ✗ java -jar build/libs/jruby-service-jruby-1.0+8929418.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/jruby/embed/ScriptingContainer
at com.github.jrubygradle.jar.bootstrap.JarMain.<init>(bootstrap.java:10)
at com.github.jrubygradle.jar.bootstrap.JarMain.main(bootstrap.java:43)
Caused by: java.lang.ClassNotFoundException: org.jruby.embed.ScriptingContainer
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 2 more

```

this looks correct, I didn't do initScript runnable() or anything like that
you filed a ticket for making that jruby-mains failure better right?
Christian Meier
@mkristian
May 18 2015 23:29
you mean if jruby-mains does not find jruby ? no I did not file a ticket for this. does you jar contain jruby-complete ?
R. Tyler Croy
@rtyler
May 18 2015 23:29
checking
interesting, it does not, but it contains the gems
the name of the file is wrong too
jruby-service-jruby-1.0+8929418.jar
the "suffix" is jruby it appears
Christian Meier
@mkristian
May 18 2015 23:31
so I used you JRubyJar definition from about with only defaultGems(); defaultMainClass() and I get:
R. Tyler Croy
@rtyler
May 18 2015 23:31
in this example do your tasks work if you remove the jar task configuration?
Christian Meier
@mkristian
May 18 2015 23:31

$ ./gradlew me
:jrubyPrepareGems UP-TO-DATE
:jrubyPrepareJars UP-TO-DATE
:jrubyPrepare UP-TO-DATE
:me

FAILURE: Build failed with an exception.

  • What went wrong:
    there is no initScript configured

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 29.875 secs

R. Tyler Croy
@rtyler
May 18 2015 23:32
interesting
I wonder if it's the stage at which I'm defining this task
I'm not defining it in a build.gradle but rather a apply() function from a plugin
is there lots of afterEvaluate code running around in your changes?
ah
so the appendix of "jruby" is defined in the JRubyJar task definitely
Christian Meier
@mkristian
May 18 2015 23:35
ok I forgot to tell :)
you want jruby jar to no appendix ? no problem I/you remove it
R. Tyler Croy
@rtyler
May 18 2015 23:37
well, with my project's name of "jruby-service" :P
there's not a jruby-complete added in here
it looks like that's because the initScript function never ran
which is where those dependencies are thrown in
Christian Meier
@mkristian
May 18 2015 23:38
the afterEval just adds the jruby-complet and jruby-mains to jrubyJars config. both are handle by the same code
but you did see the jruby-mains !
R. Tyler Croy
@rtyler
May 18 2015 23:39
something is way fucking weird here
Christian Meier
@mkristian
May 18 2015 23:39
and my example works with and without the jar task
R. Tyler Croy
@rtyler
May 18 2015 23:40
Main-Class: com.github.jrubygradle.jar.bootstrap.JarMain·
is that right?
there's .jrubydirs in the zip, so that's good
Christian Meier
@mkristian
May 18 2015 23:41
but the string "com.github.jrubygradle.jar.bootstrap.JarMain" is not anywhere in the new jar plugin
you are not using the new plugin !
R. Tyler Croy
@rtyler
May 18 2015 23:42
yeah, what the fuck
Christian Meier
@mkristian
May 18 2015 23:42
or some weird version of it
I merged it to master after @ysb33r had a quick look at it
R. Tyler Croy
@rtyler
May 18 2015 23:42
yeah, I've got the code in my repo
I don't actually know how to verify what versions of plugins you're using
rtyler @rtyler cranks all the versionsup
R. Tyler Croy
@rtyler
May 18 2015 23:49
I think something fucked up was happening because I was referring to a SNAPSHOT version as a dependency
I installed a non-snapshot locally and then made sure all my versions are correct, now I get:
:prepareServiceScripts UP-TO-DATE
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar SKIPPED
:assemble UP-TO-DATE
:jrubyPrepareGems UP-TO-DATE
:jrubyPrepareJars
:jrubyPrepare
:serviceJar

FAILURE: Build failed with an exception.

* What went wrong:
there is no initScript configured

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 41.365 secs
total 52K
drwxr-xr-x 12 tyler tyler 4.0K May 18 16:48 .
drwxr-xr-x  7 tyler tyler 4.0K May 18 16:46 ..
drwxr-xr-x  3 tyler tyler 4.0K Apr 23 13:15 classes
drwxr-xr-x  2 tyler tyler 4.0K Apr 23 13:15 dependency-cache
drwxr-xr-x  3 tyler tyler 4.0K May 18 16:48 dirinfo
drwxr-xr-x  2 tyler tyler 4.0K May 18 16:45 distributions
drwxr-xr-x  9 tyler tyler 4.0K May 18 16:09 gems
drwxr-xr-x  3 tyler tyler 4.0K Apr 23 13:15 generated
drwxr-xr-x  2 tyler tyler 4.0K May 18 16:48 jars
drwxr-xr-x  2 tyler tyler 4.0K May 18 16:46 libs
drwxr-xr-x  3 tyler tyler 4.0K Apr 23 13:15 resources
drwxr-xr-x  7 tyler tyler 4.0K May 18 16:09 tmp
-rw-r--r--  1 tyler tyler  162 May 18 16:45 VERSION
Christian Meier
@mkristian
May 18 2015 23:50
that is better.
R. Tyler Croy
@rtyler
May 18 2015 23:50
i'll update my example to use an explicit initScript since we now require that too
Christian Meier
@mkristian
May 18 2015 23:50
just set initScript 'META-INF/init.rb and then you should see more
R. Tyler Croy
@rtyler
May 18 2015 23:50
I think I'm still going to create the next version of the jar plugin to 0.2.0
Christian Meier
@mkristian
May 18 2015 23:52
well, it would be really nice if we somehow can make sure it works together with this service-artifact plugin
R. Tyler Croy
@rtyler
May 18 2015 23:53
that's something that might be more possible with the gradleTest plugin from @ysb33r
:assembleService

BUILD SUCCESSFUL

Total time: 57.433 secs
Ignoring bcrypt-ruby-2.1.4 because its extensions are not built.  Try: gem pristine bcrypt-ruby --version 2.1.4
Ignoring eventmachine-1.0.3 because its extensions are not built.  Try: gem pristine eventmachine --version 1.0.3
Ignoring faye-websocket-0.4.6 because its extensions are not built.  Try: gem pristine faye-websocket --version 0.4.6
Ignoring ffi-1.9.6 because its extensions are not built.  Try: gem pristine ffi --version 1.9.6
Ignoring ffi-1.2.0 because its extensions are not built.  Try: gem pristine ffi --version 1.2.0
Ignoring hitimes-1.2.2 because its extensions are not built.  Try: gem pristine hitimes --version 1.2.2
Ignoring http_parser.rb-0.5.3 because its extensions are not built.  Try: gem pristine http_parser.rb --version 0.5.3
Ignoring json-1.8.2 because its extensions are not built.  Try: gem pristine json --version 1.8.2
Ignoring nokogiri-1.6.3.1 because its extensions are not built.  Try: gem pristine nokogiri --version 1.6.3.1
Ignoring nokogiri-1.6.1 because its extensions are not built.  Try: gem pristine nokogiri --version 1.6.1

I am the greeter!
Hello world!
[2015-05-18 16:53:25] INFO  WEBrick 1.3.1
[2015-05-18 16:53:25] INFO  ruby 1.9.3 (2015-05-04) [java]
== Sinatra (v1.4.6) has taken the stage on 4567 for development with backup from WEBrick
[2015-05-18 16:53:25] INFO  WEBrick::HTTPServer#start: pid=28500 port=4567
^C== Sinatra has ended his set (crowd applauds)
total 52K
drwxr-xr-x 12 tyler tyler 4.0K May 18 16:48 .
drwxr-xr-x  7 tyler tyler 4.0K May 18 16:52 ..
drwxr-xr-x  3 tyler tyler 4.0K Apr 23 13:15 classes
drwxr-xr-x  2 tyler tyler 4.0K Apr 23 13:15 dependency-cache
drwxr-xr-x  3 tyler tyler 4.0K May 18 16:53 dirinfo
drwxr-xr-x  2 tyler tyler 4.0K May 18 16:45 distributions
drwxr-xr-x  9 tyler tyler 4.0K May 18 16:09 gems
drwxr-xr-x  3 tyler tyler 4.0K Apr 23 13:15 generated
drwxr-xr-x  2 tyler tyler 4.0K May 18 16:48 jars
drwxr-xr-x  2 tyler tyler 4.0K May 18 16:53 libs
drwxr-xr-x  3 tyler tyler 4.0K Apr 23 13:15 resources
drwxr-xr-x  7 tyler tyler 4.0K May 18 16:09 tmp
-rw-r--r--  1 tyler tyler  162 May 18 16:53 VERSION
success!
I'm going to go ahead and cut a 0.2.0 of jruby-gradle jar, then I'll work with that and release a new SAP before the end of the day
thanks for sticking around and helping
Christian Meier
@mkristian
May 18 2015 23:56
what are those nokogiri warnings and alike at the beginning ? never saw them before !
R. Tyler Croy
@rtyler
May 18 2015 23:56
I'm pretty sure that's bullshit from RVM in my local environment
I ignore it
Christian Meier
@mkristian
May 18 2015 23:57
ok - RVM I am not using ;)
R. Tyler Croy
@rtyler
May 18 2015 23:58
well, 0.2.0 has been released to bintray
Christian Meier
@mkristian
May 18 2015 23:58
so I cross fingers the main things are working
R. Tyler Croy
@rtyler
May 18 2015 23:59
they appear to be in that gist, it starts sinatra :)