nomisRev / rewrite-gradle-plugin

Eliminate tech-debt. As part of your build process.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logo

Eliminate Tech-Debt. At build time.

ci Gradle Plugin Portal Apache 2.0

What is this?

This project provides a Gradle plugin that applies Rewrite checking and fixing tasks as build tasks, one of several possible workflows for propagating change across an organization's source code.

plugins {
    id("java")
    id("org.openrewrite.rewrite").version("latest_version_here")
}

rewrite {
    // Reformats Java Code
    activeRecipe("org.openrewrite.java.format.AutoFormat")
}

Consuming latest snapshots from OSSRH

To use the latest -SNAPSHOT of the rewrite-gradle-plugin, update your project's settings.gradle.kts:

pluginManagement {
    resolutionStrategy {
        eachPlugin {
            if (requested.id.namespace == "org.openrewrite") {
                useModule("org.openrewrite:plugin:${requested.version}")
            }
        }
    }

    repositories {
        // ...
        maven {
            url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
        }
        // ...
        // you'll likely also need this if you don't have a pluginManagement section already:
        gradlePluginPortal()
        // ...
    }
}

The plugin can be consumed in your build.gradle.kts:

plugins {
    id("org.openrewrite.rewrite") version "X.Y.Z-SNAPSHOT"
    // or resolved dynamically to absolute latest:
    id("org.openrewrite.rewrite") version "latest.integration"
}

Documentation

About

Eliminate tech-debt. As part of your build process.

License:Apache License 2.0


Languages

Language:Java 68.9%Language:Kotlin 28.2%Language:Groovy 3.0%