For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

getElements

Return a provider containing all elements added to this collection.

The returned provider retains the build dependencies of providers added by addLater or addAllLater.

The value produced by a provider with build dependencies, by definition, is not valid until those build dependencies are executed. For example, if a task produces an output file, the value of a provider returning that file is not valid until the task executes.

Querying the contents of this provider before the build dependencies of providers added by addLater and addAllLater will result in undefined behavior. In general, the returned provider should only be used to wire values between tasks. Avoid directly calling get or any other method that realizes the value of the returned provier.

Since

9.7.0