Russ P.
Russ P.

Reputation: 87

variations of sbt directory structure

The standard sbt directory structure is like this: src main java scala test java scala I have only one java file, and I would like to simplify this structure by eliinating the intermediate java and scala directories so that the .scala files appear directly under main and test. I tried that and had problems with objects not found and such. Is there a way to configure sbt to make this work? Thanks.

Upvotes: 0

Views: 303

Answers (1)

Dmytro Mitin
Dmytro Mitin

Reputation: 51683

Change the default Scala source directory

https://www.scala-sbt.org/1.x/docs/Howto-Customizing-Paths.html#Change+the+default+Scala+source+directory

scalaSource in Compile := baseDirectory.value / "src" / "main"    
scalaSource in Test    := baseDirectory.value / "src" / "test"
javaSource  in Compile := baseDirectory.value / "src" / "main"    
javaSource  in Test    := baseDirectory.value / "src" / "test"

The Scala source directory can be the same as the Java source directory.

Upvotes: 1

Related Questions