How do I configure an extra folder for sbteclipse to include? I have a default sbt directory layout with an additional it/scala folder. I want that folder to be included in the generated .project and .classpath files, but I don't know how to do that....
Asked
Active
Viewed 1,349 times
3 Answers
3
You can achieve this for example by adding something like the following to your build.sbt
:
unmanagedSourceDirectories in Compile <++= baseDirectory { base =>
Seq(
base / "some/subdir/src"
)
}
For details of the relation between unmanaged-sources
, unmanaged-source-directories
and scala-source
you might want to check the documentation. After exporting the eclipse project from sbt, you should find a corresponding entry in your .classpath
file, like:
<classpathentry output="target/scala-2.9.1/classes" path="some/subdir/src" kind="src"></classpathentry>

bluenote10
- 23,414
- 14
- 122
- 178
0
there can be case in which you may just want to add a folder say conf to the eclipse classpath which contains configurations required at runtime. Below is the trick -
unmanagedJars in Compile ++= {
val confBase = (baseDirectory.value ** "conf")
confBase.classpath
}

vishal
- 31
- 3
0
if you want to add, e.g., the folder src/folderXYZ
, then add to build.sbt
:
Compile / unmanagedSourceDirectories += baseDirectory.value / "src/folderXYZ"

Hartmut Pfarr
- 5,534
- 5
- 36
- 42