Skip to content

Add grails-compile-static Forge feature - #16512

Closed
codeconsole wants to merge 3 commits into
apache:8.0.xfrom
codeconsole:feat/forge-compile-static-8.0.x
Closed

codeconsole wants to merge 3 commits into
apache:8.0.xfrom
codeconsole:feat/forge-compile-static-8.0.x

Conversation

@codeconsole

Copy link
Copy Markdown
Contributor

Description

Split out of #16499 during review, where both reviewers were fine with this part.

Selecting the new grails-compile-static Forge feature generates the compileStatic block of the grails build configuration:

grails {
    compileStatic {
        all = true
        gsp = true   // only when the application uses GSP
    }
}

all covers controllers, services and tag libraries but deliberately not GSP, so the feature writes gsp = true too when the application has GSP. A REST API application gets all = true alone.

The block is written by buildGradle.rocker.raw, the same way the existing assets { } block is. The feature is listed under Configuration and documented in What's New and in grailsCompileStatic.adoc, after the all/gsp example it generates.

Testing

  • GrailsCompileStaticSpec checks the block for a web application, all without gsp for a REST API application, and no block without the feature.
  • CreateAppSpec generates an application with the feature and runs compileGroovyPages, so a generated application, its starter page included, has to compile statically.
  • ./gradlew :grails-forge-core:codeStyle passes.

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
codeconsole force-pushed the feat/forge-compile-static-8.0.x branch from a1cbe5b to 7dedb2b Compare October 4, 2026 14:56
@codeconsole codeconsole closed this Oct 4, 2026
@codecov

codecov Bot commented Oct 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.5213%. Comparing base (175e4c2) to head (7dedb2b).
⚠️ Report is 20 commits behind head on 8.0.x.

Additional details and impacted files

Impacted file tree graph

@@                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                

see 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant