What is a .gradle file?
text/x-groovy
A .gradle file is a Gradle build script written in the Groovy DSL. It configures a project through blocks such as plugins, repositories, dependencies, and tasks, where each block is really a Groovy closure evaluated against a delegate object — which is why a build script is executable code rather than static configuration. The Kotlin DSL equivalent uses the .gradle.kts extension.
How to use a .gradle file
Use an example .gradle file to test build-script parsers, dependency extractors, and SBOM generators, verifying that dependency coordinates are read from each configuration, that plugin declarations are found, and that dynamic version ranges are surfaced rather than resolved.
Download example .gradle files
- Gradle Build Script (Groovy DSL)A Gradle Groovy DSL build script with a plugins block, a Java toolchain, five dependency configurations, task configuration via named() and a registered task. Every coordinate and repository is fictional, so nothing resolves.
- Gradle Settings Script with Version CatalogA Gradle settings script — the file that actually defines a multi-project build — with pluginManagement, a repositories mode, a version catalog declaring libraries, a bundle and a plugin, and one project remapped to a custom directory.