Questions tagged [groovyc]

groovyc is the Groovy compiler command line tool. It allows you to compile Groovy sources into bytecode. It plays the same role as javac in the Java world.

groovyc is the Groovy compiler command line tool. It allows you to compile Groovy sources into bytecode. It plays the same role as javac in the Java world.

11 questions
6
votes
2 answers

Can 'groovyc' be told to just generate stubs? (Joint-compile of Java+Groovy+Kotlin)

I am trying to get joint/mixed compilation between all of Java, Groovy and Kotlin. I am currently working on a theory that it should be possible if groovyc can be made to just emit stub-files as a first stage. Can it? Otherwise, any pointers towards…
stolsvik
  • 5,253
  • 7
  • 43
  • 52
5
votes
1 answer

GroovyAST add generic field at compile time

I want to add a generic field to some classes at compile time. To this objective, I was implement my own AST annotation and transformation classes by following the official documentation and annotate desired classes with AST annotation. But I am…
vahidreza
  • 843
  • 1
  • 8
  • 19
3
votes
0 answers

Grails grails.project.target.level config has no effect?

How do I compile my groovy source code into java 1.8 bytecode? I'm using Grails 2.5.4, Java 1.8.0_74 I might be missing something obvious here, but the below settings in Grails BuildConfig.groovy don't seem to affect the Java bytecode being…
Vahid Pazirandeh
  • 1,552
  • 3
  • 13
  • 29
2
votes
1 answer

Groovy: passing PermSize to groovy compiler from IntellijIdea

I have big grails project (five modules + 2 custom no pre-compiled plugins). At first – compilation was failed with out of memory in javac. I added as params: -J-Xmx1024m -J-Xms512m -J-XX:MaxPermSize=2048m great, first OOM – fixed. At second – I…
VKDev
  • 604
  • 7
  • 18
2
votes
1 answer

Groovyc *.groovy strange behavior

I have a handfull of groovy files that I compile into java class files with groovyc (because it's a good bit quicker to start java than starting up groovy just to run a short script.) All the scripts are in the default package but they share some…
Bill K
  • 62,186
  • 18
  • 105
  • 157
1
vote
1 answer

IntelliJ IDEA fails to compile a groovy test

When running a test that has previously run successfully but now groovyc throws: Information:Groovyc: While compiling tests of project.module.test:java.lang.NoClassDefFoundError: path.to.your.clas.User at…
0
votes
1 answer

`gradlew` compiling successfully without checking for symbols on the classpath

I am using a gradle project to build a Jenkins shared library. I have a build.gradle with following content: // Apply the groovy plugin to add support for groovy apply plugin: 'groovy' sourceSets { main { groovy { srcDirs =…
sshekhar
  • 137
  • 10
0
votes
1 answer

Groovy Compiler config: Want global CompileStatic but with TypeChecking off

I have search everywhere for this answer, and I thinking it can't be done. Here is my compiler-config.groovy file: import groovy.transform.CompileStatic withConfig(configuration) { ast(CompileStatic) } What i want to do is add some additional…
Jeff S.
  • 11
0
votes
2 answers

groovyc seems to not compile, class not runnable

I am not able to compile and run Groovy-scripts. I take a very first example Gold.groovy . I can compile it with groovyc Gold.groovy when I try to start it thereafter with: java Gold I get the error message "Fehler: Hauptklasse Gold konnte…
toohoo
  • 3
  • 6
0
votes
1 answer

Is there a way to specify bootclasspath argument with Groovy compiler?

I'm need to compile a Groovy code with a specific bootclasspath. Is there a way to specify the argument with groovyc. When I specify it the way I specify with javac, it complains about it being unrecognized.
Psycho Punch
  • 6,418
  • 9
  • 53
  • 86
-1
votes
1 answer

Groovy compiler fails for nested omitted parentheses in method calls

In Groovy, parentheses can be omitted when there is no ambiguity. However, the groovy compiler fails for this piece of code: def firstChar(String str) { str[0] } println " ".split(firstChar " ") I have troubles understanding what is ambiguous…
Fureeish
  • 12,533
  • 4
  • 32
  • 62