Is it possible to use gradle to develop scala projects?

后端 未结 2 1320
清酒与你
清酒与你 2021-02-06 23:28

I\'m using sbt to build scala projects, but it always seems too complex(unfamiliar) and heavy to me. I\'m also using gradle to build java projects, and which makes me hap

相关标签:
2条回答
  • 2021-02-06 23:34

    It's quite easy to use gradle with Scala. We did it for a long time (team mixed of Java ,Groovy and Scala developers) and have been quite happy with it. Most things work quite well out of the box.

    More about gradle with scala: http://www.gradle.org/docs/current/userguide/scala_plugin.html

    There are some problems/downfalls though:

    • Mixed code compilation when depending on Scala Code from Java in Mixed Code projects. (Some configuration and it will work, but not out of the box)
    • more configuration for Scala specific tools needed as in sbt
    • Integration of some Scala-Tools like the Scalastyle or scct is not possible yet
    • no sbt console (gradle console has not been working properly since the last time I checked)
    • adding the scala_version number to artifacts has to be added manually each time (no %% as in sbt)
    0 讨论(0)
  • 2021-02-06 23:36

    It's definitely possible. Gradle's Scala support is documented in the "Scala plugin" chapter in the Gradle User Guide. The plugin is used by big companies on big projects, and can be configured to use the same incremental Scala compiler as sbt. So best try for yourself and see if it fits your requirements.

    0 讨论(0)
提交回复
热议问题