Add Gradle property
Recipe ID
org.openrewrite.gradle.AddPropertyArtifact
org.openrewrite:rewrite-gradleAdd a property to the gradle.properties file.
Usage
You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.gradle.AddProperty --recipe-option "key=org.gradle.caching" --recipe-option "value=true" --recipe-option "overwrite=true"If the recipe isn’t available locally, install it with:
mod config recipes jar install org.openrewrite:rewrite-gradle:8.88.0Options
| Name | Type | Description |
|---|---|---|
keyrequired | String | The name of the property to add. e.g. org.gradle.caching |
valuerequired | String | The value of the property to add. e.g. true |
overwriterequired | Boolean | If a property with the same key exists, overwrite. e.g. true |
filePattern | String | A glob expression that can be used to constrain which directories or source files should be searched. When not set, all source files are searched. e.g. **/*.properties |
Data tables
Structured output this recipe can produce.
- Source files that had resultsSource files that were modified by the recipe run.
org.openrewrite.table.SourcesFileResults - Source files that had search resultsSearch results that were found during the recipe run.
org.openrewrite.table.SearchResults - Source files that errored on a recipeThe details of all errors produced by a recipe run.
org.openrewrite.table.SourcesFileErrors - Recipe performanceStatistics used in analyzing the performance of recipes.
org.openrewrite.table.RecipeRunStats