-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gradle-Plugin: Do not let Gradle build fail w/ configuration cache
Gradle's configuration cache aims to prevent running (expensive) code to configure the build (tasks, et al). Preventing configuration can save a (comparatively) huge amount of time, especially on small/tiny CI machines (looking at you, GH standard hosted runner). But to be able to use the configuration cache, the build itself and all plugins must respect a couple of rules. Gradle types that must not be referenced during task _execution_ are for example: `Project`, `Configuration`, `Task` and some more. Those need to be replaced with either more specialized types or with different mechanisms. See [Gradle build cache requirements](https://docs.gradle.org/8.0.2/userguide/configuration_cache.html#config_cache:requirements) for details about the Gradle feature. This change basically prevents that a Gradle build w/ enabled configuration cache fails, by telling Gradle that the Quarkus tasks do not work with the configuration cache, so it can fall back to some best effort (for the rest of the build). Other changes lift or lower object references and store values in fields to prevent hard build time errors (despite the "incompatible w/ configuration cache setting"). Most of it is to remove the usage of `Project` in the relevant code paths. Gradle tests in the Quarkus source tree got the `--configuration-cache` setting, so that the tests run with an enabled configuration cache. I was able to successfully run tests, checkstyle, spotless in a local Nessie build w/ the updated Quarkus plugin and Gradle's configuration cache enabled. Fully adopting the Quarkus plugin to Gradle's configuration cache is a very big effort, and even for a "normal build" (so no dev mode) there are a lot of quite dynamic things happening and it will at least take quite a while and multiple PRs. Not sure, whether it's achievable at a reasonable cost. One commit in this PR lets the Gradle integrations tests use the Gradle daemon, which at least feels to improve integration test runtime behavior. The daemon is started with an idle timeout of 10 seconds. Local tests and CI runs did not "complain". Also "added support" for the VLSI Gradle Jandex plugin in addition to the "existing support" for the Kordamp Gradle Jandex plugin. ITs adopted accordingly.
- Loading branch information
Showing
36 changed files
with
393 additions
and
169 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.