Frage

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 happy.

I wonder is it possible to use gradle to build scala projects? Is there any big scala projects that uses gradle?

Some of my friends just tell me "Never ever think of using gradle for scala project", but refused to tell me the reason.

War es hilfreich?

Lösung

It's quite easy to use Gradle with Scala. We did it for a long time (a mixed team 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 than with sbt
  • Integration of some Scala tools like 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)

Andere Tipps

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top