What’s the recommended tool/library to execute a m...
# getting-started
k
What’s the recommended tool/library to execute a major code rewrite of kotlin codebase which is not doable with simple find-replace Say we use one library which has certain methods, annotations and there’s exist a new library with one-to-one mapping for each use case in old library. Given there’s a fixed pattern on how code should be re-written using new library, is there a way to automate this process using code parser My initial hunch is to use kotlin-embeddable or kotlin-poet but not sure if I’ll be able to maintain line numbers and keep rest of the codebase untouched
j
If automap is possible, do you even need mapping? Looks like duplicated model.
c
Intellij’s Structural Search and Replace might be an option. More powerful than a standard text or regex search, but doesn’t need to drop down to parsing and modifying AST
💯 3
o
s
OpenRewrite doesn't have that many recipes for Kotlin though: https://docs.openrewrite.org/recipes/kotlin