Repository navigation
Add grails-compile-static Forge feature - #16512
Closed
codeconsole wants to merge 3 commits into
Closed
codeconsole wants to merge 3 commits into
codeconsole wants to merge 3 commits into
Conversation
Selecting grails-compile-static generates the compileStatic block of the grails build configuration with all = true, adding gsp = true when the application uses GSP, so the generated controllers, services, tag libraries and views compile statically. CreateAppSpec generates an application with the feature and compiles its pages, so a starter page that does not compile statically fails the build rather than the first application that opts in.
codeconsole
force-pushed
the
feat/forge-compile-static-8.0.x
branch
from
October 4, 2026 14:56
a1cbe5b to
7dedb2b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8.0.x #16512 +/- ##
==================================================
- Coverage 59.5234% 59.5213% -0.0020%
Complexity 25014 25014
==================================================
Files 2175 2175
Lines 108633 108635 +2
Branches 19822 19822
==================================================
- Hits 64662 64661 -1
- Misses 35016 35019 +3
Partials 8955 8955 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Split out of #16499 during review, where both reviewers were fine with this part.
Selecting the new
grails-compile-staticForge feature generates thecompileStaticblock of thegrailsbuild configuration:grails { compileStatic { all = true gsp = true // only when the application uses GSP } }allcovers controllers, services and tag libraries but deliberately not GSP, so the feature writesgsp = truetoo when the application has GSP. A REST API application getsall = truealone.The block is written by
buildGradle.rocker.raw, the same way the existingassets { }block is. The feature is listed under Configuration and documented in What's New and ingrailsCompileStatic.adoc, after theall/gspexample it generates.Testing
GrailsCompileStaticSpecchecks the block for a web application,allwithoutgspfor a REST API application, and no block without the feature.CreateAppSpecgenerates an application with the feature and runscompileGroovyPages, so a generated application, its starter page included, has to compile statically../gradlew :grails-forge-core:codeStylepasses.