refreshVersions icon indicating copy to clipboard operation
refreshVersions copied to clipboard

Dependency with dependency configuration isn't migrated correctly

Open 1gravity opened this issue 3 years ago • 4 comments

🐛 Describe the bug

Dependencies with exclude are migrated and won't compile any more. E.g.

    implementation("androidx.preference:preference-ktx:_") {
        exclude(group = "androidx.lifecycle", module = "lifecycle-viewmodel-ktx")
    }

is migrated to:

    implementation(AndroidX.preference.ktx) {
        exclude(group = "androidx.lifecycle", module = "lifecycle-viewmodel-ktx")
    }

which doesn't compile

⚠️ Current behavior

see above

✅ Expected behavior

It should either be not migrated at all or migrated to include a dependencyConfiguration: Action<ExternalModuleDependency>

💣 Steps to reproduce

run ./gradlew refreshVersionMigrate in a project with exclude dependency configuration.

1gravity avatar Oct 07 '22 16:10 1gravity

You can try adding toString() to the dependency notation as a workaround.

LouisCAD avatar Oct 07 '22 18:10 LouisCAD

@LouisCAD yes that works but I can also change it back to "androidx.preference:preference-ktx:_", it's both manual effort. I appreciate the effort behind the library. I do however have more and more cases that I need to correct manually after each migration. While I'm willing to do that in my own projects, I cannot recommend the use of the plugin in my professional environment (yet).

1gravity avatar Oct 08 '22 00:10 1gravity

You don't have to migrate every single time…

LouisCAD avatar Oct 08 '22 22:10 LouisCAD

@LouisCAD I migrate when I add a new dependency which I do a lot since I work on many different repos at a time. It's not hard to manually revert the faulty changes because I know them by now. In a professional environment however it's difficult to make sure that's done properly ("run the migration, then revert the following changes: .. list of changes to revert"). I hope that makes sense.

1gravity avatar Oct 09 '22 16:10 1gravity