比较 sbt 和 Gradle [英] comparing sbt and Gradle

查看:19
本文介绍了比较 sbt 和 Gradle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究 Scala 并注意到了 sbt.我对 Java/groovy 项目中的 Gradle 非常满意,而且我知道 Gradle 有一个 scala 插件.

I am diving into Scala and noticed sbt. I have been quite happy with Gradle in java/groovy projects, and I know there's a scala plugin for Gradle.

在 Scala 项目中偏爱 sbt 而不是 Gradle 的充分理由是什么?

What could be good reasons to favour sbt over Gradle in a Scala project?

推荐答案

请注意,SBT 和 Gradle 之间的一个关键区别是其依赖管理:

Note that one key difference between SBT and Gradle is its dependency management:

  • SBT: Ivy, with a a revision which can be given as a fixed one (1.5.2, for instance) or as latest (or dynamic) one.
    See "Ivy Dependency"
    That means the "-SNAPSHOT" mechanism support can be problematic, even though Mark Harrah details in this thread:

缓存可能会混淆是真的,但 Ivy 不理解解析快照并不是真的.Eugene 在另一个线程中解释了这一点,也许在管理员列表中.0.12 中解决了 sbt 的自动更新问题.

It is true the cache can get confused, but it is not true that Ivy doesn't understand resolving snapshots. Eugene explained this point in another thread, perhaps on the admin list. There is an issue with sbt's auto-update that was addressed in 0.12.

据我所知,Ivy 不支持以 Maven 的方式发布快照.我相信我已经在别处说明了这一点,但如果有人想改善这种情况,我认为最好与 Gradle 团队合作,重用他们的依赖管理代码.

What Ivy does not support, as far as I know, is publishing snapshots in the manner Maven does. I believe I have stated this elsewhere, but if anyone wants to improve the situation, my opinion is that effort is best spent working with the Gradle team to reuse their dependency management code.

  • Gradle:这个线程提到(Peter Niederwieser):
    • Gradle: This thread mentions (Peter Niederwieser):
    • 让您知道,Ivy 和 Maven 快照依赖项的问题是 Gradle 最终用自己的依赖项管理代码替换 Ivy 的原因之一.这是一项艰巨的任务,但给我们带来了很多好处.

      Just to let you know, problems with Ivy and Maven snapshot dependencies were one of the reasons why Gradle eventually replaced Ivy with its own dependency management code. It was a big task, but brought us a lot of goodness.

      这条推文提到未来所有情况都可能发生变化:

      This tweet mentions that the all situation could evolve in the future:

      Mark 过去曾说过,他对使用 Gradle 而不是 Ivy 进行 SBT 很感兴趣.

      Mark said in the past that he was interested in using Gradle instead of Ivy for SBT.

      (这两个工具可以互相学习)

      这篇关于比较 sbt 和 Gradle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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