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

27th
Jul 2015
R. Tyler Croy
@rtyler
Jul 27 2015 07:32
gah fuck, I need to basically rewrite the JRubyStormLocal task in the storm plugin now that we've cleaned up and changed a lot of JRubyExec over the past few months
R. Tyler Croy
@rtyler
Jul 27 2015 08:50
@ysb33r is there a particular reason, other than preventing users from doing something stupid,, that JRubyExec prohibits the setting of a Main?
Schalk W. Cronjé
@ysb33r
Jul 27 2015 08:53
Because it forces the use of the Jruby entrypoint
R. Tyler Croy
@rtyler
Jul 27 2015 08:53
there's a lot more logic in there that I want to re-use, setting up of the gem environment and the jruby-complete dependency
in the case of JRubyStormLocal I have the exact same runtime requirements as a normal JRubyExec except the main class must be different than org.jruby.Main
I've found similar use-cases for doing testing with rubydoop (Ruby hadoop interface), where I want to use almost 100% of JRubyExec for setting up the execution environment but then supply a different main
Schalk W. Cronjé
@ysb33r
Jul 27 2015 08:58
Would it be worth inheriting from JRubyExec?
R. Tyler Croy
@rtyler
Jul 27 2015 08:58
that's what I'm doing now, but I don't think it's possible to override setMain and then call the JavaExec setMain
Schalk W. Cronjé
@ysb33r
Jul 27 2015 08:59
super.super.setMain?
R. Tyler Croy
@rtyler
Jul 27 2015 08:59
O_O
that works O_O
rtyler @rtyler tries
R. Tyler Croy
@rtyler
Jul 27 2015 14:01
@ysb33r that does not work <_<
Schalk W. Cronjé
@ysb33r
Jul 27 2015 14:01
:worried:
R. Tyler Croy
@rtyler
Jul 27 2015 14:02
        groovy.lang.MissingMethodException: No signature of method: com.github.jrubygradle.storm.JRubyStormLocal_Decorated.getSuper() is applicable for argument types: () values: []
        Possible solutions: getLogger(), getName(), getState(), getInputs(), getInputs(), getClass()
unless I'm being very stupid
Schalk W. Cronjé
@ysb33r
Jul 27 2015 14:04
I have to say it looks like that… lemme just try something
not that stupd then...
ysb33r @ysb33r looking at fix
R. Tyler Croy
@rtyler
Jul 27 2015 14:07
well, I am calling this through the constructor so that might be funky
let me try a different callsite
Schalk W. Cronjé
@ysb33r
Jul 27 2015 14:09
same thing will happen
already tried it
if I cannto fidn a quick way of doing it, my recommendation is to use a protected method in JrubyExec which can be inherited and then make setMain call that.
R. Tyler Croy
@rtyler
Jul 27 2015 14:12
this works from a different callsite
in exec I'm calling it
Schalk W. Cronjé
@ysb33r
Jul 27 2015 14:12
really?
class A {
    void foo() { println "*** A***" }
}

class B extends A {
    @Override
    void foo() { println "*** B***" }
}

class C extends B {
    @Override
    void foo() { super.super.foo() }
}

[ new A(), new B(), new C() ].each { it.foo() }
This fails for me
R. Tyler Croy
@rtyler
Jul 27 2015 14:13
huh, well, it seems to work in this class now
weird!
Schalk W. Cronjé
@ysb33r
Jul 27 2015 14:16
crazy.
maybe the way that gradle crates the delegate class actually allows it to work