@groovy.transform.CompileStatic class GroovyPagePlugin extends java.lang.Object implements Plugin<Project>
A plugin that adds support for compiling Groovy Server Pages (GSP)
| Modifiers | Name | Description |
|---|---|---|
static class |
GroovyPagePlugin.ScaffoldedControllers |
Reads the controller sources for the mark of a scaffolded one, as a tracked build input. |
| Constructor and description |
|---|
GroovyPagePlugin() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
apply(Project project) |
|
protected java.lang.String |
getTmpDirPath(Project project) |
|
protected FileCollection |
resolveClassesDirs(SourceSetOutput output, Project project) |
|
protected Provider<java.lang.Boolean> |
scaffoldsAnyController(Project project)Whether any controller in this project is scaffolded, which decides whether the views are staged before they are compiled. |
| 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) |
Whether any controller in this project is scaffolded, which decides whether the views are staged before they are compiled. The answer is needed while the build is being configured, before anything has been compiled, so it is read from the sources.
Read through a ValueSource rather than by opening the files here. Gradle re-runs a value source on every build and invalidates the configuration cache when its answer changes, so a controller that becomes scaffolded rebuilds the graph that generates its views. Read directly, the answer would be an undeclared input: settled once, cached, and wrong from then on.
The match is deliberately loose. GenerateScaffoldedViewsTask reads the real annotation from the compiled class, so a false positive here costs a staging copy and a generation task that writes nothing -- while a false negative costs a view that is missing from the artifact, found by whoever opens that page.