Skip to content

feat: enhance Gradle dependency management by updating version catalo… - #147

Merged
KamilPatora merged 3 commits into
mainfrom
kamil/fix-gradle-version-catalog-migration
Aug 4, 2026
Merged

feat: enhance Gradle dependency management by updating version catalo…#147
KamilPatora merged 3 commits into
mainfrom
kamil/fix-gradle-version-catalog-migration

Conversation

@KamilPatora

Copy link
Copy Markdown
Collaborator

…g accessors

val text = PlainTextParser.convert(sourceFile).text
LIBS_VERSIONS_PLAIN.findAll(text).forEach { usedVersionKeys.add(it.groupValues[1]) }
}
if (sourceFile is Toml.Document && sourceFile.isTomlVersionCatalogFile()) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quick return please :D
instead of doing nested if condition :D

val versionedText = regexpDependencyChanger.update(interpolation.text)
val accessorText = versionCatalogAccessorRenames.entries.fold(versionedText) { text, (oldAccessor, newAccessor) ->
text.replace(
Regex("""(?<![A-Za-z0-9_.])libs\.${Regex.escape(oldAccessor)}(?![A-Za-z0-9_])"""),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regex to some constant? or some named method?

@KamilPatora
KamilPatora merged commit 4ae0b4d into main Aug 4, 2026
3 checks passed
@KamilPatora
KamilPatora deleted the kamil/fix-gradle-version-catalog-migration branch August 4, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants