简体   繁体   中英

Dependencies with ensime using type sbt

got the following in my build.sbt:

name := "Ledger Accounting"

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

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

This in my .ensime, same directory:

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

Using sbt I can compile the above and test a class which imports scalatest classes, however in emacs ensime cannot see anything in libraryDependencies.

Any ideas on how to make ensime pick up my build.sbt and add scalatest to my classpath? Ideally something that doesn't require me managing two lists of the same dependencies!

It's being worked on. See the comments on issue 157 in the Github project. Two relevant quotes:

I'm currently working on what I hope will be a comprehensive solution for sbt - using expectj to talk to the running sbt process. Should support 0.7 and 0.9 - 0.10 -- feel free to check out the branch (only supports 0.7) right now. - aemoncannon (the branch is sbt-revamp )

and,

I have implemented a simple version of idea 3 of mathiask as a stopgap measure to get something sort of working with the current ensime, in case anyone needs something before the final solution is ready: https://github.com/fhars/sbt-ensime-plugin - fhars

I suggest trying fhars' plugin to generate the .ensime file. You could also write your own SBT task to output the classpath; I have a variation of this in my SBT project definition.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM