working directory in sbt

后端 未结 2 569
一整个雨季
一整个雨季 2020-12-19 00:24

I would like to be able to run the java program in a specific directory. I think, that it is quite convenient to parametrize working directory, because it allows to easily m

相关标签:
2条回答
  • 2020-12-19 00:42

    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.

    0 讨论(0)
  • 2020-12-19 00:56

    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/")
    
    0 讨论(0)
提交回复
热议问题