grails.plugin.markup.view.internal.MarkupViewsTransform.groovy Maven / Gradle / Ivy
package grails.plugin.markup.view.internal
import grails.compiler.traits.TraitInjector
import grails.plugin.markup.view.MarkupViewTemplate
import grails.views.compiler.ViewsTransform
import groovy.transform.CompileStatic
import groovy.transform.InheritConstructors
import org.codehaus.groovy.control.CompilePhase
import org.codehaus.groovy.transform.GroovyASTTransformation
import org.grails.core.io.support.GrailsFactoriesLoader
/**
* @author Graeme Rocher
* @since 1.0
*/
@GroovyASTTransformation(phase = CompilePhase.SEMANTIC_ANALYSIS)
@CompileStatic
@InheritConstructors
class MarkupViewsTransform extends ViewsTransform {
@Override
protected List findTraitInjectors() {
def injectors = super.findTraitInjectors()
injectors += GrailsFactoriesLoader.loadFactories(TraitInjector).findAll() { TraitInjector ti ->
ti.artefactTypes.contains(MarkupViewTemplate.TYPE)
}
return injectors
}
}