Jacek L.
Jacek L.

Reputation: 1416

How to attach SBT classes to Intellij Idea?

I have probably a silly problem. I would like to write SBT build script (Build.scala) in IntelliJ Idea but IDE does not recognize SBT classes (Build, Project, etc.). I attached sbt-launch.jar to the project but it didn't change anything since sbt-launch.jar does not contain these classes. What should I do to make this work?

Upvotes: 3

Views: 885

Answers (3)

Udayakumar Rayala
Udayakumar Rayala

Reputation: 2284

What you need to attach is the SBT libraries which is downloaded not the sbt launcher. SBT launcher jar downloads SBT and Scala into a different directory.

I would also suggest using sbt-idea plugin instead of trying to setup the project yourself. But If you still want to do it by yourself then add the following jar files to your intellij module:

<boot dir>/scala-2.9.1/org.scala-tools.sbt/sbt/0.11.2/*.jar
<boot dir>/scala-2.9.1/lib/*.jar

The boot dir is different depending on how you installed sbt. If you installed from yum or some other standard way your boot directory will be ~/.sbt/boot.

Upvotes: 0

Bryan Hunt
Bryan Hunt

Reputation: 3783

Ok, on a Linux system with ZSH installed, I've been using the following to elucidate class file locations.... nasty, but better than nothing

zsh

setopt extendedglob

for i ( /home/work/.sbt/boot/scala-2.9.2/org.scala-sbt/sbt/0.12.0/*(.) ); do for j ( $(zipinfo -1 $i) ) ; do echo $i $j ; done ; done | grep Task

Using the above, I discovered that Task is defined in:

/home/work/.sbt/boot/scala-2.9.2/org.scala-sbt/sbt/0.12.0/task-system-0.12.0.jar

I guess we will need to do this for ever referenced class.

Upvotes: 0

Sergey Passichenko
Sergey Passichenko

Reputation: 6930

Use sbt-idea plugin

Upvotes: 1

Related Questions