When is crosspaths set to true?
Asked Answered
C

1

9

I failed to find a good documentation about the use and purpose of crosspaths. Can someone point me to the documentation or answer these specific questions.

  1. My Scala version is 2.11.6, but when crosspaths is set to true, I see two source folders - 'scala' and 'scala-2.11'. Shouldn't there be just one of these two? What is the meaning of these two folders?
  2. What code goes in 'scala' and what goes in 'scala-2.11'?
Cinema answered 28/3, 2015 at 5:36 Comment(0)
L
7

crossPaths is set to true to enable/disable Cross-Building (and it's true by default).

As of sbt 0.13.8 you're seeing that by default sbt handles source directories per Scala version, to remove the repetition of every project doing this themselves.

So if you have multiple Scala versions you're cross building against, out the box you have source directories where you can put that version-specific code.

But I agree that it's confusing: if you don't have multiple crossScalaVersions there's no need for both a scala and a scala-2.11.

The majority of your code should always live in scala, and if you ever have more than one Scala version you're cross building against and you have version-specific code then use scala-2.11, scala-2.10, etc.

Langobard answered 28/3, 2015 at 10:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.