Cross build scala-reflect for 2.10 and 2.11

sbt, scala

Solution

Simply use the `scalaVersion` setting directly:

"org.scala-lang" % "scala-reflect" % scalaVersion.value

Problem

I'm trying to make a library cross compile for 2.10 and 2.11. It's working great so far, but I hit a snag when I tried to address `scala-reflect`. `"org.scala-lang" % "scala-reflect" % "2.11.4"` How do I make this cross compile, since it's not a standard dependency in that it doesn't use the normal cross compiled version numbers. Similarly, `scala-xml` has been broken out of 2.11 into a separate library. How do I include that only for 2.11 builds when I cross compile? The sbt page on cross building doesn't cover these cases at all.

Original source