Skip to content

Gradle 9.7.0 and more configuration cache compatibility - #250

Open
labkey-susanh wants to merge 28 commits into
developfrom
fb_configCacheClasses
Open

Gradle 9.7.0 and more configuration cache compatibility#250
labkey-susanh wants to merge 28 commits into
developfrom
fb_configCacheClasses

Conversation

@labkey-susanh

@labkey-susanh labkey-susanh commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Rationale

Gradle 9.7.0 is the latest

Several tasks used for building and deploying needed own classes or property adjustments to become compatible with the configuration cache. Use of the configuration cache will be the default with Gradle 10, which is supposedly to be released sometime this year.

There are still some adjustments needed to adhoc tasks related to running tests before we can fully run on TeamCity with the configuration cache enabled. I'll leave this for a later PR.

Related Pull Requests

Changes

  • Update to Gradle 9.7.0
  • Convert verifyLicensePatch, patchApiModule, deployModule, undeployModule, symlinkNode, undeployModules to configuration-cache compatible tasks
  • Update ModuleFinder to not use deprecated hasProperty check that looks in parent project
  • Update ModuleDistribution and RunUiTest to be compatible with the configuration cache
  • Updates to MultiGit to mark as not configuration-cache compatible
  • Convert tasks that write out startup properties in TeamCity plugin to be compatible with the configuration cache
  • Update TestRunner's compileUITestJava task to be config-cache compatible and move the declaration of the aspectj configuration to that plugin

task.dbType = properties.shortType
task.mustRunAfter(BuildUtils.getServerProject(project).tasks.pickMSSQL)
task.mustRunAfter(BuildUtils.getServerProject(project).tasks.pickPg)
task.notCompatibleWithConfigurationCache("Walks the project tree")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can safely remove these undeployModulesNotFor* tasks entirely. They only work with non-embedded tomcat and are used to undeploy mssql-only modules, neither of which are relevant anymore.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Awesome. I wondered about that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It could be that we can remove the UndeployModules task altogether if not used by TeamCity. I'll ask if anyone is actively using it otherwise.

Comment on lines +185 to +186
String sourceCompatibility = (String) project.property('sourceCompatibility')
String targetCompatibility = (String) project.property('targetCompatibility')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this explicitly declare where these properties come from?

Suggested change
String sourceCompatibility = (String) project.property('sourceCompatibility')
String targetCompatibility = (String) project.property('targetCompatibility')
String sourceCompatibility = (String) rootProject.property('sourceCompatibility')
String targetCompatibility = (String) rootProject.property('targetCompatibility')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, better to do that, though Gradle isn't currently complaining about it.

final abstract ConfigurableFileCollection modulesApiJars = project.objects.fileCollection().from(Api.getModulesApiJars(project))

@Internal
final abstract Property<Boolean> useLocalBuild = project.objects.property(Boolean).convention(project.hasProperty("useLocalBuild") && "false" != project.property("useLocalBuild"))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This useLocalBuild calculation is repeated several times. Might be nice to add a BuildUtils.useLocalBuild method to centralize the calculation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good idea. Done.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants