working directory in sbt

青春壹個敷衍的年華 提交于 2019-11-29 09:47:13

If you fork, you can control everything, including the working directory.

http://www.scala-sbt.org/0.13.5/docs/Detailed-Topics/Forking.html

Example code:

fork in run := true
baseDirectory in run := file("/path/to/working/directory/")

In sbt changing 'working directory' via baseDirectory setting for test changes baseDirectory which is not base dir in my understangind and it is not equal new java.io.File(".").getAbsolutePath.

I'm not sure what the above statement means, but with sbt you need to fork to change your working directory during the run or test. This is documented in Enable forking and Change working directory.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!