开发者

sbt to exclude source directory

开发者 https://www.devze.com 2023-04-04 03:21 出处:网络
How do I config build.sbt to exclude src/main/java d开发者_如何学运维irectory? I would like to put my Java sources there but I don\'t want to compile them. Also, can I exclude a file or group of files

How do I config build.sbt to exclude src/main/java d开发者_如何学运维irectory? I would like to put my Java sources there but I don't want to compile them. Also, can I exclude a file or group of files specify with RE. Can these be easily configured in build.sbt?


javaSource and scalaSource are inputs to unmanagedSourceDirectories. You can then set unmanagedSourceDirectories to be scalaSource only:

unmanagedSourceDirectories in Compile <<=
   scalaSource in Compile apply ( (s: File) => s :: Nil)

or a bit shorter:

unmanagedSourceDirectories in Compile <<= (scalaSource in Compile)( _ :: Nil)

See Classpaths, sources, and resources for details. Also, the inspect command is useful for determining how settings are built up from other settings.


Well, there might be a better way but I'd add this to my build.sbt:

javaSource in Compile := file("some/path/that/doesnt/exist")

0

精彩评论

暂无评论...
验证码 换一张
取 消