Skip to content

feat(grails-gradle): move indy configuration from generated apps to Gradle plugin#15375

Open
jamesfredley wants to merge 1 commit into7.1.xfrom
feat/move-indy-config-to-gradle-plugin
Open

feat(grails-gradle): move indy configuration from generated apps to Gradle plugin#15375
jamesfredley wants to merge 1 commit into7.1.xfrom
feat/move-indy-config-to-gradle-plugin

Conversation

@jamesfredley
Copy link
Contributor

Summary

Move the Groovy invokedynamic (indy) configuration from generated build.gradle files to the Grails Gradle Plugin, centralizing the setting and providing user feedback.

Changes

  • Add indy property to GrailsExtension (default: false)
  • Configure GroovyCompile tasks in GrailsGradlePlugin to use the extension's indy setting
  • Display lifecycle message explaining indy is disabled for performance and how to enable it
  • Remove hardcoded indy=false from grails-forge template
  • Remove hardcoded indy=false from grails-profiles base skeleton

User Experience

The message appears once per project during configuration:

> Configure project :
Grails: Groovy invokedynamic (indy) is disabled to improve performance (see issue #15293).
        To enable invokedynamic: grails { indy = true } in build.gradle

Users can enable indy in their build.gradle:

grails {
    indy = true
}

Testing

  • ✅ grails-gradle-plugins compiles successfully
  • ✅ grails-forge-core compiles successfully
  • ✅ Message appears once during project configuration
  • ✅ Application starts and runs correctly

Closes #15321

@jamesfredley jamesfredley moved this to In Progress in Apache Grails Feb 3, 2026
@jamesfredley jamesfredley added this to the grails:7.0.8 milestone Feb 3, 2026
@jamesfredley jamesfredley self-assigned this Feb 3, 2026
@jamesfredley jamesfredley force-pushed the feat/move-indy-config-to-gradle-plugin branch from 8dbb060 to f4a0ed7 Compare February 3, 2026 17:35
@jdaugherty jdaugherty requested a review from matrei February 3, 2026 17:48
@jdaugherty
Copy link
Contributor

#15321 was already closed by adding it to the gradle file.

Can you help me understand why you want to move this to the extension? The current implementation will break anyone who tries to override it - which is something significant enough that I think it should at least go into 7.1.x.

Are you wanting to change this default to true in Grails 8? That's the only reason I can think to move it to the extension.

* When enabled, Groovy uses JVM invokedynamic instead of traditional callsite caching.
* To enable invokedynamic in build.gradle: grails { indy = true }
*/
boolean indy = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For anyone that generated an application with the 7.0.6+ codeline, it will now flip it back to false - making this a breaking change.

@bito-code-review
Copy link

The change introduces a configurable 'indy' option in GrailsExtension, defaulting to false, and removes the hardcoded 'indy = false' from build templates. For apps generated with 7.0.6+ that had this setting, behavior remains the same. However, existing apps without the explicit setting may see indy flipped from its previous default (likely true) to false, potentially causing a breaking change in performance or behavior.

@jamesfredley
Copy link
Contributor Author

indy=false provides a massive performance improvement in Grails 7.x and I think we should consider making it the default without the extra config in build.gradle.

As we work on Grails 8 we may be able to achieve performance closer with some ideas from #15374 plus changes in Groovy.

…radle plugin

Move the Groovy invokedynamic (indy) configuration from generated
build.gradle files to the Grails Gradle Plugin, centralizing the
setting and providing user feedback.

Changes:
- Add 'indy' property to GrailsExtension (default: false)
- Configure GroovyCompile tasks in GrailsGradlePlugin to use the
  extension's indy setting
- Display lifecycle message explaining indy is disabled for
  performance and how to enable it
- Remove hardcoded indy=false from grails-forge template
- Remove hardcoded indy=false from grails-profiles base skeleton

The message appears once per project during configuration:
  Grails: Groovy invokedynamic (indy) is disabled to improve
          performance (see issue #15293).
          To enable invokedynamic: grails { indy = true } in build.gradle

Closes #15321
@jamesfredley jamesfredley force-pushed the feat/move-indy-config-to-gradle-plugin branch from f4a0ed7 to c9544f6 Compare February 3, 2026 18:14
@jamesfredley jamesfredley changed the base branch from 7.0.x to 7.1.x February 4, 2026 22:33
Copy link
Contributor

@jdaugherty jdaugherty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with this going into 7.1, but we need to update the upgrade guide to point out this difference. Can you add a blurb about this change?

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

Labels

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Disable invoke dynamic by default

2 participants