@AstTransformer @groovy.transform.CompileStatic class CompileStaticArtefactInjector extends java.lang.Object implements GrailsArtefactClassInjector
Opts controllers, services and tag libraries into @GrailsCompileStatic automatically when the
corresponding build opt-in is enabled.
The opt-ins are surfaced as system properties by the Grails Gradle plugin (see the nested
grails { compileStatic { controllers = true; services = true; tagLibs = true }} block).
When enabled, every matching artefact is compiled
statically unless it already declares its own @CompileStatic, @CompileDynamic,
@TypeChecked, @GrailsCompileStatic or @GrailsTypeChecked annotation - an
explicit choice on the class always wins.
The tag library opt-in additionally skips tag libraries that still define tags the deprecated way -
as closure fields rather than methods - because such tags cannot be compiled statically when they
dispatch to other tags. These are left dynamically compiled and a warning is emitted; migrate the tags
to methods (e.g. def myTag(Map attrs, Closure body)) to opt them in, or annotate the class with
@GrailsCompileStatic to force static compilation regardless.
| Type | Name and description |
|---|---|
static java.lang.String |
COMPILE_STATIC_CONTROLLERS_PROPERTY |
static java.lang.String |
COMPILE_STATIC_SERVICES_PROPERTY |
static java.lang.String |
COMPILE_STATIC_TAGLIBS_PROPERTY |
static java.lang.String |
TAGLIB_TYPE |
| Constructor and description |
|---|
CompileStaticArtefactInjector() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
java.lang.String[] |
getArtefactTypes() |
|
void |
performInjection(org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.classgen.GeneratorContext context, org.codehaus.groovy.ast.ClassNode classNode) |
|
void |
performInjection(org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.ast.ClassNode classNode) |
|
void |
performInjectionOnAnnotatedClass(org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.ast.ClassNode classNode) |
|
boolean |
shouldInject(java.net.URL url) |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |