Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rewrite-gradle-plugin to rewrite-recipe-bom #123

Open
jkschneider opened this issue Jul 12, 2022 · 4 comments
Open

Add rewrite-gradle-plugin to rewrite-recipe-bom #123

jkschneider opened this issue Jul 12, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@jkschneider
Copy link
Member

Before doing this, also publish rewrite-gradle-plugin to maven central so that corp environment procurement processes don't need to request against Gradle plugin portal.

@jkschneider jkschneider added the enhancement New feature or request label Jul 12, 2022
@jkschneider jkschneider moved this to Backlog in OpenRewrite Jul 12, 2022
@shanman190
Copy link
Collaborator

shanman190 commented Jul 16, 2022

I would think that rewrite-gradle-plugin would be a consumer of rewrite-recipe-bom. That would make it a bit awkward, I would think, to then make it something aligned by the bom.

@escardin
Copy link

We declare all our dependencies and versions in a kotlin file we then reference everywhere else. We can specify the gradle plugin version independently, but because the versions of rewrite and the plugin don't match, it becomes extra work to look everything up and ensure everything is compatible. Using a single BOM makes it easy for us to ensure compatibilty.

@shanman190
Copy link
Collaborator

That definitely makes sense. As of right now, I think that rewrite has cut it down to 2 versions (from a lot): the rewrite-recipes-bom and rewrite-gradle-plugin.

rewrite-recipes-bom provides version alignment for rewrite proper and all recipe jars. Then rewrite-gradle-plugin which has become mostly independent.

For this to work as described, you'd have to use the platform bom in two places. The first would be for the plugin classpath itself via buildscript.dependencies, buildSrc, an included build, or an external plugin. The second would be in the rewriteDependencies configuration in the project.dependencies.

As a counter example, the below is possible today with the latest versions -- using just the two dependency versions as described previously -- and would be:

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

dependencies {
    "rewrite"(platform("org.openrewrite.recipe:rewrite-recipe-bom:1.5.0"))
    "rewrite"("org.openrewrite.recipe:rewrite-testing-frameworks")
    // remaining additional recipe jars as desired
}

@escardin
Copy link

Yep we already use buildscript dependencies, but without the jar being published to central I think it was an issue. I don't mind repeating the reference in code if I have peace of mind that everything aligns properly. It's also not the end of the world to keep the plugin separate, mostly just a hassle to have to track down both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

3 participants