I had a lot of trouble getting sbt-idea to work in my Scala 2.10 project.
I tried compiling sbt-idea
from its git repo, making sure that to have set
scalaVersion := "2.10.0-RC5"
in build/Build.scala
, and using publish-local
command to compile it in git. But I nevertheless keep getting
[error] sbt.IncompatiblePluginsException: Binary incompatibility in plugins detected.
when I then use that in my published version, say by simply adding
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.3.0-SNAPSHOT")
to the project/plugins.sbt
file.
Don't think you need to build SBT for Scala 2.10. I keep my gen-idea and eclipse project generators in the global build.sbt file and it works for all my projects (or so it seems ;-)
I'm using Ubuntu, so where the SBT config files are saved on your computer may be different.
Create a folder called plugins
under the hidden sbt directory. On Linux this is located at ~/.sbt
(where tilde is an alias for your home directory). So now you should have ~/.sbt/plugins
Then create a file called build.sbt
under this directory and add the following to it:
resolvers += "Sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"
resolvers += "Sonatype releases" at "https://oss.sonatype.org/content/repositories/releases/"
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0")
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.2.0-SNAPSHOT")
To test, I just generated a scala 2.10 project with it, and it seems fine.
Oh, the file above also adds support for the eclipse
command in SBT if you want to generate Scala-IDE projects.
I was able to use an older version of gen-idea
by adding the following to project/plugins.sbt
in the project itself:
import sbt._
import Defaults._
libraryDependencies += sbtPluginExtra(
m = "com.github.mpeltonen" % "sbt-idea" % "1.2.0", // Plugin module name and version
sbtV = "0.12", // SBT version
scalaV = "2.9.2" // Scala version compiled the plugin
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With