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

30th
Sep 2015
Schalk W. Cronjé
@ysb33r
Sep 30 2015 09:43
@rtyler what is the groovy code that surfaces the bug?
Christian Meier
@mkristian
Sep 30 2015 14:28
if I want to compile against core gradle which are maven coordinates to add to build.gradle
?
R. Tyler Croy
@rtyler
Sep 30 2015 14:29
eeep
Schalk W. Cronjé
@ysb33r
Sep 30 2015 14:29
you use compile gradleApi()
R. Tyler Croy
@rtyler
Sep 30 2015 14:29
yeah, the exat coordinates aren't well defined AFAICT
I went down thi road a bit trying to build against older gradles
Christian Meier
@mkristian
Sep 30 2015 14:30
cool
R. Tyler Croy
@rtyler
Sep 30 2015 14:37
@mkristian how close do you think #241 is to being mergable, I'm somewhat convinced that the issues I'm seeing are due to jetty weirdness
I witnessed the errors yesterday when I was on the ferry, presumably due to a network interruption
Schalk W. Cronjé
@ysb33r
Sep 30 2015 14:38
ferry?
R. Tyler Croy
@rtyler
Sep 30 2015 14:39
I live a ways outside of SF now, heading down to SF requires either a bus over the bridge or ferry over the water
Christian Meier
@mkristian
Sep 30 2015 14:39
hard to say still not seeing these gradle core files when compiling. today is possible
Schalk W. Cronjé
@ysb33r
Sep 30 2015 14:39
ah.
ysb33r @ysb33r knows very little about SF
R. Tyler Croy
@rtyler
Sep 30 2015 14:39
when you come here for javaone I can show you around ;)
Schalk W. Cronjé
@ysb33r
Sep 30 2015 14:40
maybe next year :smile:
R. Tyler Croy
@rtyler
Sep 30 2015 14:40
@mkristian FWIW this is the type of error I'm seeing in travis https://gist.github.com/rtyler/d0b4a011eb43d0f47203
Christian Meier
@mkristian
Sep 30 2015 14:42
oh missing NoSuchMethodError
R. Tyler Croy
@rtyler
Sep 30 2015 14:43
it's sporadic which is confusing to me
Christian Meier
@mkristian
Sep 30 2015 14:43
looks like a classloader problem. maybe turn of parallel build
R. Tyler Croy
@rtyler
Sep 30 2015 14:44
ah, good idea
Christian Meier
@mkristian
Sep 30 2015 15:08
so my problem is that I did pick the ResourceConnectorFactory from master which has one method more then on gradle-2.6
would this run when I compile against gradle-2.8 and use it with gradle 2.6 or older ?
R. Tyler Croy
@rtyler
Sep 30 2015 15:12
yay!
good catch @mkristian
Christian Meier
@mkristian
Sep 30 2015 15:13
happy that is runs again on travis. travis only errors are quite painful
Schalk W. Cronjé
@ysb33r
Sep 30 2015 15:45
@Mkristian not sure about that
do you need to specific method that you used?
Christian Meier
@mkristian
Sep 30 2015 15:48
first I use the interface from gradle-2.6 and of this is really working as hoped then I will see.
R. Tyler Croy
@rtyler
Sep 30 2015 16:06
@mkristian we're gradle 2.0 compatible right now
R. Tyler Croy
@rtyler
Sep 30 2015 16:12
we have to at least be runtime compatible with 2.x
Schalk W. Cronjé
@ysb33r
Sep 30 2015 16:13
Maybe for the resolver, we can say that it is only 2.7+ or something like that
if you use an older version of gradle you have to stick to using torquebox
It is even possible to have the resolver code in the plugin, but only activate it when gradle of a specific version is being run.
in that way one only has to maintain one plugin, but have functionality enabled depending on gradle version
R. Tyler Croy
@rtyler
Sep 30 2015 16:15
and there's an API requirement to use the later versions?
Schalk W. Cronjé
@ysb33r
Sep 30 2015 16:16
@rtyler in what way?
R. Tyler Croy
@rtyler
Sep 30 2015 16:16
I'm asking about the requirement to use the later APIs
Schalk W. Cronjé
@ysb33r
Sep 30 2015 16:17
Gradle is moving so fast fwd, that I think it is worth thinking of taking a new base version of 2.x to be compatible with, or at least only enable additional functionality from that level forward
Until now we have stuck to 2.0 as the base for obvious reasons
R. Tyler Croy
@rtyler
Sep 30 2015 16:18
I've not seen any features worth moving the baseline yet, which would require a new major version
if you look at our bintray downloads there's still a lot of downloads of 0.4 too
Schalk W. Cronjé
@ysb33r
Sep 30 2015 16:19
I would guess 0.4 is due to asciidoctorj builds, I don’t think they have upgraded yet
However, what I think is that we could possibly say that the plugin remains compatible with 2.0+, but certain new functionality only gets activated should you be on 2.7+ (or whichever version we choose).
In that way there is no need for a major version release.
The GEM resolver springs to mind as a good use case
R. Tyler Croy
@rtyler
Sep 30 2015 16:25
I think that's reasonable, but I'd like to make sure we're putting an effort to keep things 2.0 compatible if at all possible
if you tell me it's simply not doable, then okay :)
Christian Meier
@mkristian
Sep 30 2015 17:18
this changing gradle api is quite a thing. I needed to remove rm -rf /Users/cmeier/.gradle/wrapper/dists/gradle-2.0-bin to get it compile against gradle-2.6 - the compiler daemon did use jars from this directory which contained older interfaces :(
R. Tyler Croy
@rtyler
Sep 30 2015 17:20
eep
Christian Meier
@mkristian
Sep 30 2015 18:10
2.3 <> 2.6 <> 2.8 . I have to compile against 2.3 that is what the compiler uses. but the plugin API is quite nice, cross fingers things work in the end
Blane Dabney
@raelik
Sep 30 2015 19:14
This message was deleted
Christian Meier
@mkristian
Sep 30 2015 19:15
@rtyler hmm. I have the code compiling but I do not see that it gets registered. maybe I missed something. BUT in the end it could go into gradle proper - at least PR and see what the feedback is
@rtyler @ysb33r so with gradle-2.3 those url schemes are hardcoded. it became more flexible when the s3 protocol was added to gradle
@raelik not that I am aware of any change
Blane Dabney
@raelik
Sep 30 2015 19:28
I deleted that message because it wasn't relevant. My real issue is that -S is no longer working with any bin scripts that any gems have installed
Christian Meier
@mkristian
Sep 30 2015 19:29
oh. is there a ./bin directory inside the jar file ?
Blane Dabney
@raelik
Sep 30 2015 19:30
yeah
doing a diff between the jar that isn't working and an older one that I have that is, that's definitely the problem, the bin/ folder isn't being included
I see some other things that have been excluded that weren't before, but they seem to be superfluous
(.jrubydir files, the jruby-mains jar, cache/ directory)
Christian Meier
@mkristian
Sep 30 2015 19:32
java -Djruby.debug.scriptResolution=true -jar ... should give you some debug on where jruby searches for the -S script
Blane Dabney
@raelik
Sep 30 2015 19:33
right, the issue is that the bin/ scripts aren't getting into the jar anymore
they used to be
Christian Meier
@mkristian
Sep 30 2015 19:34
yes, we changed the way we include gem directories - let me look at the code
Schalk W. Cronjé
@ysb33r
Sep 30 2015 19:34
@mkristian I think we should just select the appropriate gem repo according to the version of gradle in use.
We can catch issues in testing via gradleTest
Christian Meier
@mkristian
Sep 30 2015 19:36
@ysb33r the problem is that older gradle like 2.3 can not add such custom scheme. tomorrow I will see if I get it compiled and work with latest gradle. but I am less certain if it works
@raelik it is a BUG
Blane Dabney
@raelik
Sep 30 2015 19:37
cool!
R. Tyler Croy
@rtyler
Sep 30 2015 19:38
hah
Christian Meier
@mkristian
Sep 30 2015 19:38
hmm
Blane Dabney
@raelik
Sep 30 2015 19:40
Here's the diff of what was in my old jar (I think it was built with 0.3.2), vs built with 1.1.2: https://gist.github.com/raelik/a80aae58ee12c92283af
R. Tyler Croy
@rtyler
Sep 30 2015 19:41
@raelik what configuration are those gems in?
Blane Dabney
@raelik
Sep 30 2015 19:42
rubygems
R. Tyler Croy
@rtyler
Sep 30 2015 19:42
and the rest of the gem is getting included yeah?
Christian Meier
@mkristian
Sep 30 2015 19:42
@rtyler that is what we inlcude: include 'specifications/**', 'gems/**', 'jars/**', 'Jars.lock'
Blane Dabney
@raelik
Sep 30 2015 19:42
errr gems
R. Tyler Croy
@rtyler
Sep 30 2015 19:43
ah
Christian Meier
@mkristian
Sep 30 2015 19:43
the bin/* is missing
Blane Dabney
@raelik
Sep 30 2015 19:43
yeah, the gems themselves are there
just the bin/* scripts are gone
Christian Meier
@mkristian
Sep 30 2015 19:43
we changed from exclude to include and missed the bin :(
R. Tyler Croy
@rtyler
Sep 30 2015 19:43
@raelik yeah, plz file a ticket, I have the time to cut a released
Blane Dabney
@raelik
Sep 30 2015 19:43
kk
R. Tyler Croy
@rtyler
Sep 30 2015 19:43
@mkristian I excluded it on purpose, forget about @raelik :P
Blane Dabney
@raelik
Sep 30 2015 19:44
So no ticket then?
Christian Meier
@mkristian
Sep 30 2015 19:44
why ?
R. Tyler Croy
@rtyler
Sep 30 2015 19:44
no no, file a ticket
Blane Dabney
@raelik
Sep 30 2015 19:44
oh, you mean you forgot about my use case?
R. Tyler Croy
@rtyler
Sep 30 2015 19:44
yes
Blane Dabney
@raelik
Sep 30 2015 19:45
kk
Blane Dabney
@raelik
Sep 30 2015 19:50
jruby-gradle/jruby-gradle-plugin#245
Pretty obvious fix
R. Tyler Croy
@rtyler
Sep 30 2015 19:51
wanna make a commit? get major github points? :P
Blane Dabney
@raelik
Sep 30 2015 19:52
sure!
Blane Dabney
@raelik
Sep 30 2015 19:57
jruby-gradle/jruby-gradle-plugin#246
R. Tyler Croy
@rtyler
Sep 30 2015 20:28
@raelik I'll cherry-pick this back to the 1.1. release branch and cut a release
let me check for other bug fixes first
Blane Dabney
@raelik
Sep 30 2015 20:29
excellent!
R. Tyler Croy
@rtyler
Sep 30 2015 20:30
I'm wondering if the .jrubydir bugfixes are worth bringing back
Blane Dabney
@raelik
Sep 30 2015 20:33
what were those? I missed that whole thing
R. Tyler Croy
@rtyler
Sep 30 2015 20:33
basically a fix for #238 #225 and #223
I'm going to leave those out
I'm leaving them out for now
Blane Dabney
@raelik
Sep 30 2015 20:34
ohhh, yeah, those don't look too critical
R. Tyler Croy
@rtyler
Sep 30 2015 20:35
well, they're a pretty huge pain in the ass, and require work arounds in the storm plugin
jruby-gradle/jruby-gradle-storm-plugin#24
Blane Dabney
@raelik
Sep 30 2015 20:35
ahhhhhh
R. Tyler Croy
@rtyler
Sep 30 2015 20:35
it breaks some stuff at @Lookout, but we've got some work-arounds
without those .jrubydir Dir.glob type operations inside the packed jar won't work properly
Blane Dabney
@raelik
Sep 30 2015 20:36
right
R. Tyler Croy
@rtyler
Sep 30 2015 20:37
there's a world in which shrinkwrap makes it feasible to ditch those .jrubydir files entirely
Blane Dabney
@raelik
Sep 30 2015 20:55
that would be handy
R. Tyler Croy
@rtyler
Sep 30 2015 20:55
yeah, there's all sort of fun things that shrinkwrap would allow us to do if their classloader shenanigans weren't so sucky
R. Tyler Croy
@rtyler
Sep 30 2015 21:09
alright, going to prep a 1.1.3
Schalk W. Cronjé
@ysb33r
Sep 30 2015 21:22

@mkristian what I’m thinking is something like the following (excluding buildscript for simplicity)

// in Plugin apply code
void apply(Project p) {
  // Comparison, not syntactically correct, but just follow the logic...
  if(p.gradle.gradleVersion < ‘2.6’) {
    p.repositories.add ( /* code as it is today */ )
  } else {
    p.repositories.with {
      maven {
         url ‘gem://rubygems.org'
      }
    }
  }
}

Because you use the java service registry approach to load the gem protocol, the extension will simply be ignored under older versionsm becasue it is not looking for that. Also, as long as the above is dynamic (Not @CompileStatic) the else block will never be entered under older Gradle versions.

R. Tyler Croy
@rtyler
Sep 30 2015 21:39
huh
it only seems like the bintray plugin uploaded one of the plugins :fire:
there we go
finally
@raelik you're all set
Blane Dabney
@raelik
Sep 30 2015 23:44
awesome!
FYI, not seeing a new release on github