@groovy.transform.CompileStatic class FactoriesFileWriter extends java.lang.Object
Writes factory registrations for compiled classes into a factories file in the compilation
target directory, merging any existing entries from previous compilation runs and from
hand-authored source registrations. The factories file location is supplied by the caller,
so the writer is shared by transformations targeting different registration files
(e.g. META-INF/grails.factories and META-INF/grails-cli.factories).
| Constructor and description |
|---|
FactoriesFileWriter() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
static java.io.File |
findSourceDirectory(java.io.File compilationTargetDirectory) |
|
static boolean |
updateFactoriesWithType(org.codehaus.groovy.ast.ClassNode classNode, org.codehaus.groovy.ast.ClassNode superType, java.io.File compilationTargetDirectory, java.lang.String factoriesLocation, java.util.List<java.lang.String> sourceFactoriesLocations)Registers the class as an implementation of the given super type in the factories file when the class is a non-abstract subtype. |
| 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) |
Registers the class as an implementation of the given super type in the factories file when the class is a non-abstract subtype.
classNode - the compiled classsuperType - the factory type to register the class undercompilationTargetDirectory - the compilation output directoryfactoriesLocation - the factories file path relative to the target directorysourceFactoriesLocations - project-relative paths of hand-authored factories files to mergetrue when the class was a subtype of the factory type