Skip to main content

Find Gradle wrappers

org.openrewrite.gradle.search.FindGradleWrapper

Find Gradle wrappers.

Recipe source

GitHub, Issue Tracker, Maven Central

This recipe is available under the Apache License Version 2.0.

Options

TypeNameDescriptionExample
StringversionOptional. A version expression representing the versions to search for7.x
StringversionPatternOptional. Allows version selection to be extended beyond the original Node Semver semantics. So for example,Setting 'version' to "25-29" can be paired with a metadata pattern of "-jre" to select Guava 29.0-jre-jre
StringdistributionOptional. The distribution of Gradle to find. "bin" includes Gradle binaries. "all" includes Gradle binaries, source code, and documentation. Valid options: bin, all

Example

Parameters
ParameterValue
version[6,)
versionPatternnull
distributionnull
Before
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\\://services.gradle.org/distributions/gradle-7.4-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
After
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
~~>distributionUrl=https\\://services.gradle.org/distributions/gradle-7.4-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

Usage

This recipe has no required configuration parameters and comes from a rewrite core library. It can be activated directly without adding any dependencies.

  1. Add the following to your build.gradle file:
build.gradle
plugins {
id("org.openrewrite.rewrite") version("7.7.0")
}

rewrite {
activeRecipe("org.openrewrite.gradle.search.FindGradleWrapper")
setExportDatatables(true)
}

repositories {
mavenCentral()
}

  1. Run gradle rewriteRun to run the recipe.

See how this recipe works across multiple open-source repositories

Run this recipe on OSS repos at scale with the Moderne SaaS.

The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories.

Please contact Moderne for more information about safely running the recipes on your own codebase in a private SaaS.

Data Tables

Gradle wrappers in use

org.openrewrite.gradle.table.GradleWrappersInUse

Gradle wrappers in use.

Column NameDescription
Wrapper versionThe version of the Gradle wrapper in use.
Wrapper distributionThe distribution type of the Gradle wrapper in use.

Contributors

Shannon Pamperl, Jonathan Schnéider, Tim te Beek