refreshVersions icon indicating copy to clipboard operation
refreshVersions copied to clipboard

Migration: Support dependencies inside buildSrc/src/main/kotlin/*.gradle.kts

Open thorntonrp opened this issue 3 years ago • 4 comments

The plugin "de.fayard.refreshVersions" doesn't appear to work for buildSrc plugins inside a multi-module project, but it would be nice if it could.

Steps to produce scenario:

  1. With Gradle 7.2, created a multi-module project with gradle init, choosing options 2-3-2-2 (application, Java, yes, Kotlin), and choosing "demo" as the project name and source package.

  2. Add the following to ./settings.gradle.kts and ./buildSrc/settings.gradle.kts

    pluginManagement {
        plugins {
            id("de.fayard.refreshVersions") version "0.20.0"
        }
    }
    
    plugins {
        id("de.fayard.refreshVersions")
    }
    
  3. Run the command gradle refreshVersionsMigrate

  4. Open the file ./buildSrc/src/demo/kotlin/demo.java-common-conventions.gradle.kts. Notice that these versions have not been replaced. Replacing the versions manually with _ doesn't work either.

    dependencies {
        constraints {
            implementation("org.apache.commons:commons-text:1.9")
        }
        testImplementation("org.junit.jupiter:junit-jupiter:5.7.2")
    }
    

thorntonrp avatar Aug 30 '21 21:08 thorntonrp

@LouisCAD I'm working on this.

imashnake0 avatar Dec 23 '21 00:12 imashnake0

Keen to know if there are any updates here (or workarounds in the meantime) - thanks!

louiseightsix avatar Jul 14 '22 00:07 louiseightsix

@louiseightsix @imashnake0 No one has worked on this no, we were super busy with Versions Catalog support.

This is our current code for deciding what to migrate.

https://github.com/jmfayard/refreshVersions/blob/00dd569da08daefa59eb60f096a8864b28063b4d/plugins/dependencies/src/main/kotlin/de/fayard/refreshVersions/RefreshVersionsMigrateTask.kt#L257-L266

If someone wants to make it smarter, I'm happy to review a PR!

jmfayard avatar Sep 13 '22 22:09 jmfayard

Any news here?

tiehfood avatar Aug 01 '23 15:08 tiehfood