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

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

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.

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

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 :

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: 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()

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)

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 >

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

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

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

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