Groovy to Kotlin - Migrating a Gradle Build

Поделиться
HTML-код
  • Опубликовано: 26 дек 2024

Комментарии • 14

  • @oharaandrew314
    @oharaandrew314 Месяц назад +5

    Welcome to the party! Perhaps just in time for the new declarative DSL to drop!

    • @PairingWithDuncan
      @PairingWithDuncan  Месяц назад +2

      All the more content to thrill you with

    • @vlogan79
      @vlogan79 Месяц назад

      You jest, but Jetbrains are working on a new build system...

    • @oharaandrew314
      @oharaandrew314 Месяц назад +1

      No, not even. Gradle is working on a new declarative DSL.
      As for Amper, so far, there's been conflicting information on whether it's a layer on top of gradle or not. If it is, then I fear it will add too many new failure points to be worthwhile.

    • @PairingWithDuncan
      @PairingWithDuncan  Месяц назад +1

      @oharaandrew314 Isn’t Amper both? The problem is that we want a JFDI build, where we can also customise everything when we have specialist requirements

  • @oharaandrew314
    @oharaandrew314 Месяц назад +5

    I don't know if the Kotlin DLS is any "better" than the original Groovy DSL. They say you're supposed to take advantage of the autocomplete to inspect available properties, but as you've seen, the script doesn't even get syntax highlighting until it's fully correct, so I rarely actually get to use it.
    This doesn't make the Kotlin DLS any worse though; I think both are about the same amount of pain to work with. But for consistency, I might as well use the Kotlin DSL in my Kotlin project. And since I don't even know Groovy, at least I know what my copy-pasta is doing.

    • @PairingWithDuncan
      @PairingWithDuncan  Месяц назад +1

      I think this sums up my view. Neither is good enough, Kotlin is a bit better.

    • @xozzy7809
      @xozzy7809 Месяц назад +2

      In my opinion is a lot better, the problem with groovy gradle files is that people at some point tend to write scripts that works by accident, they dont declare plugins but declare extensions for them and the plugin is applied in different file etc. This leads to IDE being completly useless, hovewer in kotlin due to type safety it forces you to write better code, and IDE is actually helpful.

  • @righteouscoder
    @righteouscoder Месяц назад +2

    Version Catalog should probably be your next hurdle, it really does make updating dependencies MUCH easier (and less error prone) one large multi-module project and I like that the catalog is reusable between projects, a little fiddley to get strings and such, but honestly makes everything so much nicer once done.

    • @PairingWithDuncan
      @PairingWithDuncan  Месяц назад +3

      At the risk of flogging a dead elephant, this is on my list for next week!

  • @sandrodelacruz8125
    @sandrodelacruz8125 Месяц назад +1

    Why didn't you use the AI to help fix the issues?

    • @PairingWithDuncan
      @PairingWithDuncan  Месяц назад

      To be honest, because when I tried that in a run-through (I prefer the term to rehearsal ;-) it just dug me in to a deeper hole.

  • @sandrodelacruz8125
    @sandrodelacruz8125 Месяц назад +1

    Who cares about removing the apply? If it works I would leave it.

    • @PairingWithDuncan
      @PairingWithDuncan  Месяц назад

      I suppose my thought was that if I had other builds to convert, the extension would save a bunch of manual work.