Gradle 6.6 RC6 Release Highlights: Configuration Caching, Runtime Classpath Normalization, and Credential Management
Gradle 6.6 RC6 introduces experimental configuration caching for faster builds, runtime classpath normalization to improve cache hits, and a new credentials API that externalizes authentication details, while also adding Java compilation support, file‑system watch stability, dependency improvements, and various bug fixes.
Gradle 6.6 RC6 has been released. Gradle is a project automation build tool inspired by Apache Ant and Maven, supporting dependency management and multi‑project builds; it uses a Groovy‑based DSL instead of traditional XML.
The most notable feature is the experimental configuration caching option, a performance optimization that lets Gradle skip the configuration phase and start executing tasks sooner.
Before any task runs, Gradle performs a configuration phase, which adds significant overhead, especially for large projects. Configuration caching stores the results of this phase and reuses them in subsequent builds, dramatically improving build speed. When enabled, Gradle can completely bypass the configuration phase as illustrated.
Enabling configuration caching also allows Gradle to optimise task execution and, by default, run more tasks in parallel.
This feature is highly experimental, disabled by default, and not recommended for production. It can be turned on with the --configuration-cache command‑line flag or by adding it to the run configuration.
Standardized runtime classpath improves cache hit rate
For up‑to‑date checking and the build cache, Gradle must determine whether two task input properties have identical values. It first normalises the inputs before comparing them.
Runtime classpath analysis now inspects META-INF files and property files, ignoring changes to comments, whitespace, and ordering, and can selectively ignore attributes that do not affect the runtime classpath.
normalization {
runtimeClasspath {
metaInf {
ignoreAttribute("Implementation-Version")
ignoreProperty("timestamp")
}
}
}Any ZIP file on the classpath that is regenerated but differs only in non‑essential values or comments will have a higher chance of cache hits. This is most useful for JAR files but also applies to AAR, WAR, and APK files.
Handling user‑provided credentials
Builds sometimes require credentials, for example when publishing artifacts to a repository. Keeping credentials outside the build script is a best practice.
This version introduces a new credentials API that uses Gradle properties (supplied via command line, environment variables, or gradle.properties ) to provide credentials, and it performs a fast‑fail when required credentials are missing.
repositories {
maven {
name = 'mySecureRepository'
credentials(PasswordCredentials)
// url = uri(<
>)
}
}The repository name mySecureRepository will cause Gradle to look for properties mySecureRepositoryUsername and mySecureRepositoryPassword for the credentials.
Additionally, a new provider API can be used to supply credentials to external tools:
tasks.register('login', Exec) {
def loginProvider =
providers.credentials(PasswordCredentials, 'login')
inputs.property('credentials', loginProvider)
doFirst {
PasswordCredentials loginCredentials = loginProvider.get()
// use credentials
}
}The above credentials are searched in Gradle properties as loginUsername and loginPassword .
Other improvements in this release include support for the Java compilation --release flag, stability enhancements for file‑system watching, dependency‑management upgrades, and various bug fixes.
Laravel Tech Community
Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.