codeconsole opened a new pull request, #16088:
URL: https://github.com/apache/grails-core/pull/16088
Follow-up to #16068. In that PR @matrei noted:
> We should also add a comment in the `GroovyPagePlugin` where we are
registering the `gspCompile` configuration, that it is an extension point for
applications to add compile dependencies for GSP compilation. I can't think of
a use case for that right now, and if there is no use case, we could remove the
`gspCompile` configuration all together.
There is no use case. This removes it.
## Where it came from
`gspCompile` was introduced in 2014 (42c739fb85) as the classpath for the
original Ant-based GSP compiler, which ran through `IsolatedAntBuilder`:
```groovy
antBuilder.withClasspath(project.configurations.gspCompile).execute {
taskdef(name: 'gspc', classname:
'org.grails.web.pages.GroovyPageCompilerTask')
...
}
```
It held the two artifacts that compiler needed — `grails-web-gsp` and the
servlet API. It was never an extension point; it was the compiler's own
toolchain classpath.
When GSP compilation moved to the forked `GroovyPageForkCompileTask` —
classpath `compileClasspath + gspCompile + compiled classes + providedCompile`
— the `grails-web-gsp` entry was dropped and only the servlet API line
survived. #16068 removed that line, which leaves a configuration that is empty
in every build and contributes no files to the GSP compile classpath.
## What still supplies the classpath
GSPs compile against `compileClasspath`, the project's compiled classes, and
`providedCompile` for a WAR build. That is what actually supplies everything
GSP compilation needs, and it is unchanged here.
## Behavior break
A build that declares dependencies on `gspCompile` now fails with `Could not
find method gspCompile()`. The migration is `compileOnly`, which lands on the
same compile classpath the GSP compiler reads:
```groovy
dependencies {
// Grails 7
// gspCompile 'com.example:some-library:1.0'
// Grails 8
compileOnly 'com.example:some-library:1.0'
}
```
Documented as section 41 of the Grails 8 upgrade guide.
## Tests
Adds `GroovyPagePluginFunctionalSpec`, a TestKit spec that applies
`org.apache.grails.gradle.grails-gsp` to a project and asserts the
configuration is gone while `compileGroovyPages` and `compileWebappGroovyPages`
still resolve the compile classpath, provided dependencies and compiled
classes. The classpath assertions use marker directories as file dependencies,
so nothing is resolved from a repository. The first assertion was verified to
fail when the configuration is restored.
Verified with `:grails-gradle-plugins:test --rerun-tasks` (90 tests),
`:grails-gradle-plugins:check`, `aggregateViolations` (Checkstyle, CodeNarc,
PMD, SpotBugs all clean) and `:grails-doc:publishGuide`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]