Additional sbteclipse source folders

How to configure an additional folder to enable sbteclipse? I have a default sbt directory layout with an extra / scala folder. I want this folder to be included in the generated .project and .classpath files, but I do not know how to do this ....

+4
source share
2 answers

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 more information on the relationship between unmanaged-sources , unmanaged-source-directories and scala-source you can check the documentation. After exporting the eclipse project from sbt, you should find the corresponding entry in your .classpath file, for example:

  <classpathentry output="target/scala-2.9.1/classes" path="some/subdir/src" kind="src"></classpathentry> 
+3
source

there may be times when you can simply add a folder named conf to the eclipse class path that contains the configurations needed at runtime. Below is the trick -

 unmanagedJars in Compile ++= { val confBase = (baseDirectory.value ** "conf") confBase.classpath } 
0
source

Source: https://habr.com/ru/post/1448018/


All Articles