Gradle 9.7.0 and more configuration cache compatibility - #250
Gradle 9.7.0 and more configuration cache compatibility#250labkey-susanh wants to merge 28 commits into
Conversation
…to be compatible with the configuration cache
| task.dbType = properties.shortType | ||
| task.mustRunAfter(BuildUtils.getServerProject(project).tasks.pickMSSQL) | ||
| task.mustRunAfter(BuildUtils.getServerProject(project).tasks.pickPg) | ||
| task.notCompatibleWithConfigurationCache("Walks the project tree") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Awesome. I wondered about that.
There was a problem hiding this comment.
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.
| String sourceCompatibility = (String) project.property('sourceCompatibility') | ||
| String targetCompatibility = (String) project.property('targetCompatibility') |
There was a problem hiding this comment.
Should this explicitly declare where these properties come from?
| String sourceCompatibility = (String) project.property('sourceCompatibility') | |
| String targetCompatibility = (String) project.property('targetCompatibility') | |
| String sourceCompatibility = (String) rootProject.property('sourceCompatibility') | |
| String targetCompatibility = (String) rootProject.property('targetCompatibility') |
There was a problem hiding this comment.
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")) |
There was a problem hiding this comment.
This useLocalBuild calculation is repeated several times. Might be nice to add a BuildUtils.useLocalBuild method to centralize the calculation.
There was a problem hiding this comment.
Good idea. Done.
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
verifyLicensePatch,patchApiModule,deployModule,undeployModule,symlinkNode,undeployModulesto configuration-cache compatible tasksModuleFinderto not use deprecatedhasPropertycheck that looks in parent projectModuleDistributionandRunUiTestto be compatible with the configuration cacheMultiGitto mark as not configuration-cache compatibleTeamCityplugin to be compatible with the configuration cacheTestRunner'scompileUITestJavatask to be config-cache compatible and move the declaration of theaspectjconfiguration to that plugin