Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 286
Ben Fitzgerald Avatar asked Nov 13 '22 18:11

Ben Fitzgerald


1 Answers

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.

like image 148
Kipton Barros Avatar answered Dec 18 '22 14:12

Kipton Barros