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

10th
Sep 2015
R. Tyler Croy
@rtyler
Sep 10 2015 14:16
@ysb33r so it turns out having properties named the same as class members behaves really weirdly when subclassing in Groovy
Schalk W. Cronjé
@ysb33r
Sep 10 2015 14:17
example?
R. Tyler Croy
@rtyler
Sep 10 2015 14:17
@ysb33r so I'm planning on introducing some changes that make it safer to subclass JRubyJar
rtyler @rtyler types quick example
R. Tyler Croy
@rtyler
Sep 10 2015 14:18
protected String configuration = "foo"

String getConfiguration() {
  return configuration
}

void doSometihng() {
  logger.info("I'm using ${configuration}")
}
then in a subclass:
@Override
String getConfiguration() { return "LOL" }

@Override
void doSomething() {
  logger.info("sub is using ${configuration}")
}
that will output:
er, sorry, I forgot the super.doSomething() call
but:
sub is using LOL
I'm using foo
so I'm changing the member names to not overlap with the property names
Schalk W. Cronjé
@ysb33r
Sep 10 2015 14:20
lemme just check something
R. Tyler Croy
@rtyler
Sep 10 2015 14:20
I think having these names overlap was largely due to laziness on my part and is ultimately making this code more confusing then it should be
Schalk W. Cronjé
@ysb33r
Sep 10 2015 14:23
I am trying to simulate the issue in groovyConsole
I sthe mis-spelling of Somethign intentional ?
R. Tyler Croy
@rtyler
Sep 10 2015 14:25
heh no
Schalk W. Cronjé
@ysb33r
Sep 10 2015 14:27
It has to do with the way Groovy resolves names
rtyler @rtyler nods
Schalk W. Cronjé
@ysb33r
Sep 10 2015 14:27
if you want to force access to the property then use "${this.@configuration}”
R. Tyler Croy
@rtyler
Sep 10 2015 14:28
I get what is happening here, but the side-effect of this are issues like jruby-gradle/jruby-gradle-storm-plugin#21
so I think a reasonable fix is to use different member names versus property names for our public APIs
Schalk W. Cronjé
@ysb33r
Sep 10 2015 14:28
to avoid confusion, then probably change it
to something more descriptive
R. Tyler Croy
@rtyler
Sep 10 2015 14:29
aye
R. Tyler Croy
@rtyler
Sep 10 2015 14:44
I'm definitely thinking of pulling this change and a couple others into a v1.0.4 release ahead of releasing 1.1 with @mkristian's embedded servlet changes
Schalk W. Cronjé
@ysb33r
Sep 10 2015 14:55
good idea
R. Tyler Croy
@rtyler
Sep 10 2015 14:55
#216 opened for that
i'll let travis CI chew on these pull requests, time to get off the bus and work on making me some COFFEEEEEEE
Schalk W. Cronjé
@ysb33r
Sep 10 2015 14:59

and work on making me some COFFEEEEEEE

also known as a 13262841114350

R. Tyler Croy
@rtyler
Sep 10 2015 15:17
heh
Christian Meier
@mkristian
Sep 10 2015 15:24
O == 0 ?
R. Tyler Croy
@rtyler
Sep 10 2015 15:26
respun both pull requests with a fix to my property change
that was a stupid mistake
Schalk W. Cronjé
@ysb33r
Sep 10 2015 15:26
@mkristian Indeed
@mkristian It was too early in the mornign for @rtyler, he has not had his 13262841114350 yet.
R. Tyler Croy
@rtyler
Sep 10 2015 15:27
heh
@ysb33r how is the gradle book coming along?
Schalk W. Cronjé
@ysb33r
Sep 10 2015 15:28
it is coming
R. Tyler Croy
@rtyler
Sep 10 2015 15:29
is it to the alpha testing stage?
Christian Meier
@mkristian
Sep 10 2015 15:29
maybe @rtyler just had 12648430
Schalk W. Cronjé
@ysb33r
Sep 10 2015 15:30
:sparkles:
rtyler @rtyler waits impatiently
Yurii Rashkovskii
@yrashk
Sep 10 2015 16:24
hey guys, has anybody been able to use the jar plugin with initScript library()? I am getting No value has been specified for property 'mainClass'. I found a thread here https://groups.google.com/forum/#!topic/jruby-gradle/bktpjT7Si5k but not sure if there's any resolution besides resorting to the base plugin.
R. Tyler Croy
@rtyler
Sep 10 2015 16:28
yrashk: what version of the plugin?
@yrashk rather
R. Tyler Croy
@rtyler
Sep 10 2015 16:38
gahhhh this build hasn't even started yet
R. Tyler Croy
@rtyler
Sep 10 2015 16:45
@mkristian any clues why files might be deleted from dirinfo between gradle executions?
Christian Meier
@mkristian
Sep 10 2015 16:48
nope
R. Tyler Croy
@rtyler
Sep 10 2015 16:49
very weird
I think it might be the jrubydir generation code
hrm
Christian Meier
@mkristian
Sep 10 2015 16:52
did we ever revisited this code. I know was broken for some kind of jar configurations ?
R. Tyler Croy
@rtyler
Sep 10 2015 16:54
I don't remember a specific issue
I don't think its jrubydir generation so much as the dirinfo having jruby unzipped into it before the gem dependencies are installed
no that can't be it
that would make no sense, the first task that executes is my preparation task
Yurii Rashkovskii
@yrashk
Sep 10 2015 16:59
@rtyler 1.0.3
Christian Meier
@mkristian
Sep 10 2015 16:59
the relativePath it relative to the source dir and not to target
R. Tyler Croy
@rtyler
Sep 10 2015 17:00
@yrashk I'm preparing a 1.0.4 bug fix release today, if you can get a repro case and bug filed I'll make sure to include it
it sounds like a bug but I don't have the time to put together a repro case right now
@mkristian I don't think that's the issue here
unless that might be actually removing a file from the FS or an internal graph that gradle has of what /should/ be there
R. Tyler Croy
@rtyler
Sep 10 2015 17:44
@mkristian HAHA, I found it
@mkristian is there any reason for that line to exist?
R. Tyler Croy
@rtyler
Sep 10 2015 18:32
@mkristian I think my use of the dirinfo more accurately reflects what we need nowadays, which is a single place to act as a "staging" directory for packing a jar
so I think the dirinfo directory should only be removed on "clean"
the only negative implication that I can think of is that we would need to ensure that the .jrubydir files are regenerated every single time regardlesss of whether they are present or not
(which is what we have today whether we like it or not
Christian Meier
@mkristian
Sep 10 2015 20:23
@rtyler currently the implementation just appends to existing .jrubydir files. so only after a clean the files are guaranteed to be right. does not feels right in the long run, but OK for an fast fix.
Schalk W. Cronjé
@ysb33r
Sep 10 2015 20:31
I see I got a number of assigned issues… Do you want me to comment on them or merge them if they pass?
R. Tyler Croy
@rtyler
Sep 10 2015 20:53
@mkristian I'll try to think more about a solution
@mkristian each successive run of the jrubydirinfo processing will update the .jrubydir files, so the .jrubydir listing will be at least an accurate representation of what is on disk
Christian Meier
@mkristian
Sep 10 2015 20:58
it add but it does not remove entries. so it can be easily stale when changing what you want to pack into the jar
rtyler @rtyler nods
R. Tyler Croy
@rtyler
Sep 10 2015 21:00
but the only way you can ever really get to that pristine state is with a new build
fresh build rather
Schalk W. Cronjé
@ysb33r
Sep 10 2015 21:00
or maybe by using a staging directory ...
Christian Meier
@mkristian
Sep 10 2015 21:01
yes, something like do a "dry" zipping the jar first, collect all the dir-info, create all those files and to the actual zipping in a second run
R. Tyler Croy
@rtyler
Sep 10 2015 21:02
ysb33r: well, I kind of thought that build/dirinfo/$configuration was our staging directory :P
@ysb33r ^ rather
irc gateway is a little goofy
Schalk W. Cronjé
@ysb33r
Sep 10 2015 21:03
yeah, it can, but I have not looked at the code of late (obviously).
I guess it is possible but linking the correct task properties together
such that changes in input will cause dirinfo to be rebuilt from scratch
R. Tyler Croy
@rtyler
Sep 10 2015 21:15
well, right now the problem is that the construction of a JRubyDirInfo object obliterates that directory entirely
I think @mkristian is right in that we should find a more suitable longer term solution for generation of .jrubydir files
but that still wouldn't address one of his concerns raised is that without a clean the staging directory for a packed jar can become "ditty" so to speak
rtyler @rtyler wishes we had zfs snapshots everywhere
Blane Dabney
@raelik
Sep 10 2015 21:34
@rtyler That would be nice, too bad zfs isn't very stable on Linux.
R. Tyler Croy
@rtyler
Sep 10 2015 21:34
freebsd for everybody!
Blane Dabney
@raelik
Sep 10 2015 21:34
Pretty good way to get BSD in the door :D