@CompileStatic class PruneGeneratedFactories extends java.lang.Object implements org.gradle.api.Action<Task>
Drops the entries of a factories file the Grails compiler generated that name a class the compilation no longer produces, keeping those declared by the hand-authored file it merged in.
The compiler writes a registration as it compiles the class, so it can only change one while it is compiling. When the only change is a deleted source that nothing depends on, incremental compilation deletes the class file and compiles nothing, and the entry naming the class would survive into what the build packages: a registration of a class that cannot be loaded. This runs after the compilation, when every class it produces has been written.
Only an incremental Groovy compilation, which a build opts into with
options.incremental = true, leaves such an entry behind. The default compilation
recompiles everything and cleans its destination directory first, so the compiler writes the
generated file again from the classes that remain and this action finds nothing to drop.
| Type | Name and description |
|---|---|
static java.lang.String |
CLI_FACTORIES_LOCATION |
static java.lang.String |
GRAILS_FACTORIES_LOCATION |
| Constructor and description |
|---|
PruneGeneratedFactories(java.lang.String factoriesLocation, java.util.List<java.io.File> handAuthoredFiles) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
execute(Task task) |
|
static void |
register(Project project, AbstractCompile task, java.lang.String factoriesLocation, java.util.List<java.lang.String> handAuthoredPaths)
|
| 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) |
factoriesLocation - the generated file, relative to the compilation's destination directoryhandAuthoredPaths - the project-relative files the compiler merges into it