Plugin for IntelliJ Idea and Android Studio that converts direct Gradle dependency declarations into version catalog format (TOML).
Copy/Paste legacy dependency declarations from Maven Central or tutorials and easily convert them into the new format. Simply select/mark the legacy dependencies in your Gradle build file and convert them via the entry in the Edit menu or the default keyboard shortcut: Ctrl+Alt+Shift+D
- Kotlin:
implementation("com.opappdevs:depstocatalog:1.0.0")
- Groovy (short):
implementation 'com.opappdevs:depstocatalog:1.0.0'
opappdevs = "1.0.0"
com-opappdevs-depstocatalog = { group = "com.opappdevs", name = "depstocatalog", version.ref = "opappdevs" }
implementation(libs.com.opappdevs.depstocatalog)
This behavior could be configurable in future versions:
- The version label is the last part of the group
- The dependency label is created from the last two parts of the group (if available) and the fragment name
- The output for multiple dependencies is grouped into version, definition, and declaration
- Any non-matched text between dependency declarations in the selection gets removed (such as catalog version notation or comments)
- Output currently isn't being sorted
- BUG: differences in tld only are not captured (unrealistic scenario)
- BUG: differences in tld and org should also result in independent version numbers (unrealistic scenario)
- BUG: differences in version number should result in separate definitions and declarations (unrealistic scenario)
- support Maven coordinates directly
- support Groovy (long) format
- automatically put the definitions into the catalog file
Distributed under the MIT license.