Skip to content
DEV Community

DEV Community

Top comments (4)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
Collapse Expand
molexx profile image
molexx
  • Joined

"Migrating the existing syntax of your build to Kotlin, bit by bit, while retaining the structure β€” what we call a mechanical migration"

Intriguing! I have a large gradle file and can't allocate the time to convert it using option 2.
Is this suggesting that I can convert one file to kotlin bit by bit? I assumed that renaming the file to .kts would stop the existing groovy from being accepted.

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /

Collapse Expand
jmfayard profile image
Jean-Michel πŸ•΅πŸ»β€β™‚οΈ Fayard
One of the most salient features of our Tech Hiring culture is that there is so much bullshit. Everyone knows this. Each of us contributes his share. But we tend to take the situation for granted.
  • Email
  • Location
    Berlin, Germany
  • Education
    ENSIMAG + UniversitΓ€t Karlsruhe (TH)
  • Pronouns
    he / him
  • Work
    Kotlin, Backend, Open Source maintainer, Technical Writing
  • Joined

Usually in a large build file, there are parts that looks like code and parts that are very declarative.
What I would do is keep the file in groovy (build.gradle), but remove from it everything that looks like code. Put that part in the buildSrc folder in kotlin.
In the end you will have a very declarative groovy file, that would look almost the same in kotlin anyway.

That's almost what I do here. Well dependency strings are not exactly code, but they are easier to manage as code.

Also if you have a project with multiple modules, you can freely convert one file to kotlin (build.gradle.kts) and keep the rest in groovy. I would migrate the root build file since this the most interesting for adding new stuff.

Collapse Expand
chhh profile image
Dmitry Avtonomov
Computational mass spectrometry and data visualization
  • Location
    Portland, OR
  • Education
    Moscow Institute of Physics and Technology
  • Joined

I guess the plugin ID has changed to "de.fayard.buildSrcVersions"

Collapse Expand
jmfayard profile image
Jean-Michel πŸ•΅πŸ»β€β™‚οΈ Fayard
One of the most salient features of our Tech Hiring culture is that there is so much bullshit. Everyone knows this. Each of us contributes his share. But we tend to take the situation for granted.
  • Email
  • Location
    Berlin, Germany
  • Education
    ENSIMAG + UniversitΓ€t Karlsruhe (TH)
  • Pronouns
    he / him
  • Work
    Kotlin, Backend, Open Source maintainer, Technical Writing
  • Joined

Completly true, thanks a lot, I updated the article.

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.

For further actions, you may consider blocking this person and/or reporting abuse

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account