【问题标题】:Dependencies with ensime using type sbt使用 sbt 类型的 ensime 依赖项
【发布时间】:2011-10-31 18:35:39
【问题描述】:

在我的 build.sbt 中有以下内容:

name := "Ledger Accounting"

libraryDependencies += "junit" % "junit" % "4.8" % "test"

libraryDependencies += "org.scalatest" % "scalatest" % "1.3" % "test"

这在我的 .ensime 中,同一个目录:

:use-sbt t
:project-package "uk.co.mydomain.ledger"

使用 sbt 我可以编译上面的代码并测试一个导入 scalatest 类的类,但是在 emacs 中,ensime 在 libraryDependencies 中看不到任何内容。

关于如何让 ensime 获取我的 build.sbt 并将 scalatest 添加到我的类路径的任何想法?理想情况下,不需要我管理相同依赖项的两个列表!

【问题讨论】:

    标签: scala emacs ensime


    【解决方案1】:

    正在处理中。请参阅 Github 项目中的 comments on issue 157。两个相关的引用:

    我目前正在研究我希望将是一个全面的解决方案 对于 sbt - 使用 expectj 与正在运行的 sbt 进程对话。应该 支持 0.7 和 0.9 - 0.10 -- 随时查看分支(仅 现在支持 0.7)。 - aemoncannon(分支是sbt-revamp

    和,

    我已经实现了 mathiask 想法 3 的简单版本作为权宜之计 测量以使某些东西与当前的 ensime 一起工作,在 在最终解决方案准备好之前,任何人都需要一些东西: https://github.com/fhars/sbt-ensime-plugin - fhars

    我建议尝试 fhars 的插件来生成 .ensime 文件。您还可以编写自己的 SBT 任务来输出类路径;我的 SBT 项目定义中有一个 variation of this

    【讨论】:

    • Kipton - 非常感谢。现在我可以继续学习 scala 并享受有趣的功能和 ensime。非常感谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-20
    • 2019-04-02
    • 1970-01-01
    • 2017-11-05
    • 2017-04-20
    • 2016-06-19
    相关资源
    最近更新 更多