I am trying to enable forking in sbt for test
task only, which excluding the rests of test command (test-only
, test:compile
, etc).
At first I thought the solution would be:
fork in test := true
But then I saw on the documentation, doing that will enable forking all test tasks which is not what I want.
I also found out there is Test
variable (has uppercase first letter). What is the difference between test
and Test
?
Then I also saw another example:
fork in (Test, run) := true
which sbt manual said it's for forking test:run
and test:runMain:
. At first I thought (Test, run)
means test:run
, but seeing another example below, it seems the meaning is not like that:
// sets the working directory for `run` and `runMain` only
baseDirectory in (Compile,run) := file("/path/to/working/directory/")
So there are variables with capital first letter (e.g. Test, Compile, Runtime), and variables with lowercase first letter (e.g. test, testOnly, compile, console, run), the latter seems corresponds to sbt commands, but I'm not clear about the former. So what's the difference between them?