Re: Is it possible to enable CompileStatic for an entire project

2016-06-21 Thread Mr Andersson
On 06/21/2016 11:41 PM, Mr Andersson wrote: On 06/21/2016 10:55 PM, Jochen Theodorou wrote: [...] The problem with the ANT task is that I don't think I can set classpath argumetns to the actual so passing the config location is a problem that needs be resolved. Not that easy with maven.

Re: Is it possible to enable CompileStatic for an entire project

2016-06-21 Thread Keegan Witt
Besides the example page, I have an integration test ( https://github.com/groovy/GMavenPlus/tree/master/src/it/configScriptCompile) making sure this functionality works. If you'd like, I'm willing to help with your pom. -Keegan On Tue, Jun 21, 2016 at 12:37 PM, Mr Andersson wrote: > > > On 06/

Re: Is it possible to enable CompileStatic for an entire project

2016-06-21 Thread Mr Andersson
On 06/21/2016 10:55 PM, Jochen Theodorou wrote: [...] The problem with the ANT task is that I don't think I can set classpath argumetns to the actual so passing the config location is a problem that needs be resolved. Not that easy with maven. I am actually not quite sure what you mean with

Re: Integrating Groovy with a Java EE application and Maven

2016-06-21 Thread Mr Andersson
On 06/21/2016 10:39 PM, Jochen Theodorou wrote: On 21.06.2016 09:04, Mr Andersson wrote: Gmaven or Gmaven 2 did not work for me either. Resulted in a bunch of compilation issues which I started to correct, but then gave up on. I shouldn't have to change my code to get on Groovy. yeah, forget

RE: Is it possible to enable CompileStatic for an entire project

2016-06-21 Thread Winnebeck, Jason
I can say as someone who writes Groovy on a daily basis for about a year now on a project that uses CompileStatic by default on a team of 6-10 that we haven’t had many problems forgetting @CompileStatic or been too annoyed with it. Although as I’ve said in earlier post, we have forgotten once or

Re: Is it possible to enable CompileStatic for an entire project

2016-06-21 Thread Mr Andersson
On 06/21/2016 08:08 PM, Winnebeck, Jason wrote: I would say that if you use the config script, then it would mean you’d want to use @CompileDynamic on every class where you don’t want static. It’s a default. I would think once you start adding logic into a compiler config script like that y

Re: Is it possible to enable CompileStatic for an entire project

2016-06-21 Thread Jochen Theodorou
[...] The problem with the ANT task is that I don't think I can set classpath argumetns to the actual so passing the config location is a problem that needs be resolved. Not that easy with maven. I am actually not quite sure what you mean with "I don't think I can set classpath arguments to t

Re: Integrating Groovy with a Java EE application and Maven

2016-06-21 Thread Jochen Theodorou
On 21.06.2016 09:04, Mr Andersson wrote: Gmaven or Gmaven 2 did not work for me either. Resulted in a bunch of compilation issues which I started to correct, but then gave up on. I shouldn't have to change my code to get on Groovy. yeah, forget about those... gmavenplus is supposed to work. If

Re: Groovy hot deploy in production

2016-06-21 Thread Erwin Müller
Just have a data storage for persistent data, and let the Groovy code access that data in an atomic way. Just a simple synchronized map would be sufficient as the data storage. That way, you won't need to storage any data in your Groovy code. It's just important to use atomic types like primitive t

RE: Is it possible to enable CompileStatic for an entire project

2016-06-21 Thread Winnebeck, Jason
I would say that if you use the config script, then it would mean you’d want to use @CompileDynamic on every class where you don’t want static. It’s a default. I would think once you start adding logic into a compiler config script like that you’ll get into trouble with users being confused. I’

Re: Groovy hot deploy in production

2016-06-21 Thread Aplomb Chen
I am developing chat servers which need hold user information in server memory like the tcp or udp channels and other user session data. Hot deployments will be useful that I can keep the user information in memory and upgrade the business code for new features. So that those chat users won't need

Re: Groovy hot deploy in production

2016-06-21 Thread Aplomb Chen
Thanks, onStart and onStop are a good hit for my cases. On Tue, Jun 21, 2016 at 10:17 PM, Erwin Müller wrote: > Why not have start and stop hooks for such stuff? > > Have an interface with onStart() and onStop() methods, and call them when > you load and unload a class. > > If you really need mo

Re: Is it possible to enable CompileStatic for an entire project

2016-06-21 Thread Cédric Champeau
Or use `@CompileDynamic` on your specs (that's the idea). But in any case, the IDE will never interpret the script configuration file, so it won't know that your classes are statically compiled, so won't show you the proper errors. 2016-06-21 19:03 GMT+02:00 Mario Garcia : > If I'm not wrong, pro

Re: Is it possible to enable CompileStatic for an entire project

2016-06-21 Thread Mario Garcia
If I'm not wrong, projects like Spock doesn't like @CompileStatic so in case I would like to statically compile my project, at least I should be telling the compiler not to compile statically my specifications. Something like: withConfig(configuration) { source(unitValidator: { unit -> !unit.A

Re: Is it possible to enable CompileStatic for an entire project

2016-06-21 Thread Cédric Champeau
A strong -1 for both options. We already have 2 variants of Groovy today, indy and non indy, and in practice *nobody uses the invokedynamic version* because it's impractical to use. Typically projects depend on `groovy.jar` or `groovy-all.jar`, not their invokedynamic version. Adding a new dimensio

Re: Is it possible to enable CompileStatic for an entire project

2016-06-21 Thread Mr Andersson
On 06/21/2016 02:38 PM, Winnebeck, Jason wrote: Tying Cédric’s advice to your previous question about gmavenplus and joint compilation, per https://github.com/groovy/GMavenPlus/wiki/Examples#configuration-script you add the configuration tag with a reference to your groovy script. I also

Re: Is it possible to enable CompileStatic for an entire project

2016-06-21 Thread Mr Andersson
On 06/21/2016 02:38 PM, Winnebeck, Jason wrote: Tying Cédric’s advice to your previous question about gmavenplus and joint compilation, per https://github.com/groovy/GMavenPlus/wiki/Examples#configuration-script you add the configuration tag with a reference to your groovy script. Actuall

Re: Groovy hot deploy in production

2016-06-21 Thread Domingo Suárez Torres
I always avoid hot deployments, I prefer to have multiple running JVMs and a proxy or load balancer in front. On Tue, Jun 21, 2016 at 9:18 AM Erwin Müller wrote: > Why not have start and stop hooks for such stuff? > > Have an interface with onStart() and onStop() methods, and call them when >

RE: Is it possible to enable CompileStatic for an entire project

2016-06-21 Thread Winnebeck, Jason
The annotations also work on classes, per the documentation: When a class is annotated, all methods, properties, files, inner classes, etc. of the annotated class will be type checked. When a method is annotated, static compilation applies only to items (closures and anonymous inner clsses) with

Re: Is it possible to enable CompileStatic for an entire project

2016-06-21 Thread Charles G
If we do it the doc way: http://docs.groovy-lang.org/latest/html/documentation/#_static_compilation_by_default would I just use http://docs.groovy-lang.org/next/html/gapi/groovy/transform/CompileDynamic.html for classes I want to be dynamic -- or is it for methods only? Docs: http://docs.groovy-l

Re: Groovy hot deploy in production

2016-06-21 Thread Erwin Müller
Why not have start and stop hooks for such stuff? Have an interface with onStart() and onStop() methods, and call them when you load and unload a class. If you really need modularity, use OSGi. Regards, Erwin. > Sun Jun 19 2016 15:00:56 CEST from "Aplomb Chen" >Subject: Groovy hot dep

Re: Using a groovy package from jruby

2016-06-21 Thread Keegan Witt
I don't think the Groovy-Eclipse plugin would be the one most would recommend at this point. JRuby and Groovy joint compilations aren't a very common case, but I'd be happy to look at your GMavenPlus configuration. It should work. Just make sure the stubs get generated. If you're happy with usin

Re: Integrating Groovy with a Java EE application and Maven

2016-06-21 Thread Keegan Witt
Also the usage page has the two most common ways GMavenPlus is used. -Keegan On Tue, Jun 21, 2016 at 8:31 AM, Winnebeck, Jason < jason.winneb...@windstream.com> wrote: > You are trying to do joint compilation so this is the only section you > nee

Re: Is it possible to enable CompileStatic for an entire project

2016-06-21 Thread Thibault Kruse
I would prefer to have a codenarc rule enforcing @CompileStatic for projects requiring it that way. On Tue, Jun 21, 2016 at 2:38 PM, Winnebeck, Jason wrote: > Tying Cédric’s advice to your previous question about gmavenplus and joint > compilation, per > https://github.com/groovy/GMavenPlus/wiki/

RE: Is it possible to enable CompileStatic for an entire project

2016-06-21 Thread Winnebeck, Jason
Tying Cédric’s advice to your previous question about gmavenplus and joint compilation, per https://github.com/groovy/GMavenPlus/wiki/Examples#configuration-script you add the configuration tag with a reference to your groovy script. Actually about 90+% of our code base in Groovy is CompileStat

Re: Is it possible to enable CompileStatic for an entire project

2016-06-21 Thread Schalk Cronjé
On 21/06/2016 13:29, Cédric Champeau wrote: It's in the docs: http://docs.groovy-lang.org/latest/html/documentation/#_static_compilation_by_default I am wondering how (or if) IntelliJ would recognise that? -- Schalk W. Cronjé Twitter / Ello / Toeter : @ysb33r

RE: Integrating Groovy with a Java EE application and Maven

2016-06-21 Thread Winnebeck, Jason
You are trying to do joint compilation so this is the only section you need: https://github.com/groovy/GMavenPlus/wiki/Examples#joint-compilation The only difference from pure Groovy compile and joint compilation is you list the stub tasks to the goals. Basically all you do is add the gmavenplus-

Re: Is it possible to enable CompileStatic for an entire project

2016-06-21 Thread Cédric Champeau
It's in the docs: http://docs.groovy-lang.org/latest/html/documentation/#_static_compilation_by_default 2016-06-21 14:24 GMT+02:00 Mr Andersson : > Is it possible to enable CompileStatic for an entire project? > > Or do you have to do it on a per class basis? > > I like Groovy for some of it's fe

Is it possible to enable CompileStatic for an entire project

2016-06-21 Thread Mr Andersson
Is it possible to enable CompileStatic for an entire project? Or do you have to do it on a per class basis? I like Groovy for some of it's features, and mostly for it's close to Java syntax but I would really like it to be a static language. I've heard about Groovy++ but I believe that's dead

Re: Integrating Groovy with a Java EE application and Maven

2016-06-21 Thread Mr Andersson
Gmaven or Gmaven 2 did not work for me either. Resulted in a bunch of compilation issues which I started to correct, but then gave up on. I shouldn't have to change my code to get on Groovy. I don't remember the exact errors, but there were some. I just tried again and it failed. I tried the j