是否可以使用 gradle 开发 scala 项目? [英] Is it possible to use gradle to develop scala projects?

查看:35
本文介绍了是否可以使用 gradle 开发 scala 项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 sbt 来构建 scala 项目,但它对我来说似乎总是太复杂(不熟悉)和沉重.我也在使用 gradle 来构建 java 项目,这让我很开心.

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.

我想知道是否可以使用 gradle 来构建 scala 项目?有没有使用 gradle 的大型 scala 项目?

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

我的一些朋友只是告诉我从没想过将 gradle 用于 scala 项目",但拒绝告诉我原因.

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

推荐答案

在 Scala 中使用 gradle 非常简单.我们做了很长时间(由 Java、Groovy 和 Scala 开发人员组成的团队)并且对它非常满意.大多数事情开箱即用.

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.

关于 gradle 的更多信息:http://www.gradle.org/docs/current/userguide/scala_plugin.html

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

虽然有一些问题/缺点:

There are some problems/downfalls though:

  • 在混合代码项目中依赖 Java 中的 Scala 代码时的混合代码编译.(一些配置,它会工作,但不是开箱即用)
  • 在 sbt 中需要更多 Scala 特定工具的配置
  • 目前还无法集成一些 Scala 工具,例如 Scalastylescct
  • 没有 sbt 控制台(自从我上次检查以来,gradle 控制台一直没有正常工作)
  • 每次都必须手动添加 scala_version 编号到工件(没有 %% 和 sbt 一样)
  • 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)

这篇关于是否可以使用 gradle 开发 scala 项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆