Re: specify multiple test folders in Build.sbt

476 views
Skip to first unread message

rinma lavi

unread,
May 25, 2013, 9:48:17 AM5/25/13
to simple-b...@googlegroups.com
unmanagedSourceDirectories in Test <<= (scalaSource in  Test)( base => base / "test1" :: base / "test2" :: Nil)

Not sure why would you want to do that in one project with the same source, you may want to separate java and scala.

unmanagedSourceDirectories in Test <<= (scalaSource in Test, javaSource in Test)( _ / "test1" :: _ / "test2" :: Nil)

You will notice their base is src/test/{scala, java}.
If this is not adequate you can navigate : _ / ".." / .... .
Or you could do that thing you did there:
scalaSource in Test <<= baseDirectory / "whereyouwantthemto"
or disuse what someone wrote( wanted to write, unconceptualize) there:
scalaSource in Test <<= (sourceDirectory in Test) / "scalatest"

Usually you will see Seqs used there,
I personally prefer List notation, looks prettier to me,
makes no difference actually.

Try inspect on them to see what they are made of.

inspect test:source-directories

cheers!


On Friday, 24 May 2013 11:57:04 UTC+2, Sawyer wrote:
I am using sbt 0.12.3, in my build.sbt file, I saw:

Seq(
  scalaSource in Compile <<= baseDirectory / "app",
  javaSource in Compile <<= baseDirectory / "app",
  sourceDirectory in Compile <<= baseDirectory / "app",
  scalaSource in Test <<= baseDirectory / "test",
  javaSource in Test <<= baseDirectory / "test",
  sourceDirectory in Test <<= baseDirectory / "test",
  resourceDirectory in Compile <<= baseDirectory / "conf"
)


How can I add another folder to

      scalaSource in Test <<= baseDirectory / "test"

Thanks!

rinma lavi

unread,
May 27, 2013, 10:54:07 AM5/27/13
to simple-b...@googlegroups.com
Glad you found in helpfull.


Them operators seem nicely explained here:

Play can be inspirational:

Lift build definition is interesting:

Or if you are brave enough:

HF!


On Monday, 27 May 2013 05:43:05 UTC+2, Sawyer wrote:
Thank you very much, this is quite helpful !

btw, I want to know is this knowledge documented anywhere in the official documentation?
Before I posted this question I actually did have tried something similar but can't pass the compilation of the build.sbt, and I don't know what should I put at the right side of <<=, I don't know there is a  unmanagedSourceDirectories can be used at the left side of <<=。
Reply all
Reply to author
Forward
0 new messages