https://kotlinlang.org logo
Join Slack
Powered by
# gsoc-kotlin-openrewrite
  • s

    Shauvik Roy Choudhary

    03/18/2025, 11:42 AM
    set the channel description: Discuss GSoC Kotlin OpenRewrite Recipes project https://kotlinlang.org/docs/gsoc-2025.html#add-more-kotlin-openrewrite-recipes-medium-175-hrs
  • s

    Shauvik Roy Choudhary

    03/18/2025, 12:03 PM
    Hi @Zakaria Shahen This sounds like a great recipe to start. Let me figure out why the repo was archived from our openrewrite contact but feel free to fork if needed.
    z
    s
    • 3
    • 3
  • s

    Shauvik Roy Choudhary

    03/18/2025, 12:16 PM
    @Stream The idea for this project is to help with Kotlin migrations. So, finding the top usecases and developing recipes for common migration tasks is the key!
  • s

    Stream

    03/18/2025, 11:40 PM
    @Shauvik Roy Choudhary In this month, I had spent some time on OpenRewrite framework and built some recipes on myself. With that, I started to be curious that how should we migrate Java code to Kotlin with OpenRewrite, as far as the normal operations in OpenRewrite are done by modifying the LST. Will we implement the migration logic by modify the original codebase by something other than LST?
    a
    • 2
    • 5
  • s

    Stream

    03/20/2025, 5:05 PM
    https://github.com/Stream29/rewrite-recipe-starter-kotlin I'm working on a OpenRewrite recipe template. I've found some issues with making recipes with Kotlin. First, it does not compatible with Kotlin 2.1.0.
    Copy code
    w: The artifact `org.jetbrains.kotlin:kotlin-compiler-embeddable` is present in the build classpath along Kotlin Gradle plugin.
    This may lead to unpredictable and inconsistent behavior.
    For more details, see: <https://kotl.in/gradle/internal-compiler-symbols>
    I didn't find the kotlin-compiler-embedable dependency, so I think it's one of the plugins' fault. Second, the java version is implemented with some annotation processors. Including lombok and org.openrewriterewrite templatinglatest.release. They may cause compability issues with Kotlin.
    a
    • 2
    • 4
  • s

    Shauvik Roy Choudhary

    03/22/2025, 4:02 PM
    Hello, I'm interested in OpenRewrite recipes for Java-to-Kotlin migration. I have visited their website and repository on GitHub, and I noticed that they have rewrite-kotlin and rewrite-kotlin modules separately, but no specific java-to-kotlin module was found. Should I construct my own Java-to-Kotlin recipe? Where should I start? Would replacing if statements for null checks with safe calls in Kotlin be a good approach and replacing the new keyword in Java with idiomatic Kotlin code be the correct approach? Thread in Slack Conversation
  • s

    Shauvik Roy Choudhary

    05/14/2025, 10:12 AM
    archived the channel