Quantcast

Glu Scripts with intellij

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Glu Scripts with intellij

travikk
Hello,

I am in the process of introducing Glu to range of products.
One thing that I have been unable to resolve is to make IntelliJ (or any IDE) recognize Glu API injected by agent (shell, log, ....) to the groovy scripts.

Is there a way to take advantage of code completion for that API?

Thanks,
Konrad
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Glu Scripts with intellij

frenchyan
Administrator
Hi Konrad

There is no way built-in glu to do it. I am not aware of anybody in the community who would have written an IntelliJ plugin to do it. If somebody has done it please let us know :)


There may already be a way with the groovy plugin to declare this. Maybe you could check with the groovy community?

Yan

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Glu Scripts with intellij

travikk
Thanks!

Can I find org.linkedin.glu.agent-api in maven? Latest version I can locate is 4.7.1, I guess it should reflect the version of agent which is 5.5.4?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Glu Scripts with intellij

frenchyan
Administrator
They are at hosted at bintray (see release notes: http://pongasoft.github.io/glu/docs/latest/html/RELEASE.html#glu-5-0-0):


If you use gradle, you simply add this to your build:

     maven {
     }

and simply use regular maven coordinates 

Yan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Glu Scripts with intellij

travikk
Ok, so I have an idea

If you pull that jar as a dependency into your project, and then define this in your gluscript:
def GluScript shell

you get all the code completion you want :)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Glu Scripts with intellij

frenchyan
Administrator
I think a better idea would be to simply declare the fact that the glu script implement the interface... since that is what it actually does at runtime...

class MyGluScript implements GluScript
{
}

getMountPoint(), getShell() etc... can then all be used as

mountPoint, shell (this is how groovy works)

Of course your IDE will not be happy about you not implementing the method, but you will have full code completion. 


Yan

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Glu Scripts with intellij

travikk
Yeah, I didn't want to do it since I wouldn't be implementing the interface myself, and IDE would complain...

But thanks for the idea! Something to look at definitely
Loading...